Minimize Distance to Walk
Optimization Problem

Calculus Optimization Tutorial with Two Solution Methods

The first derivative is used to minimize (optimize) the distance travelled between two points.

In what follows, \( C \) represents the constant of integration where applicable.

Problem

The diagram below shows the path that Wilson follows every morning to take water from the river to his farm. Help Wilson minimize the total distance travelled from his house to the farm.

Minimize distance travelled problem
Figure 1. Walking path from house to river and farm
Show Solution to the Problem

Two methods to solve this problem are suggested below.

METHOD 1: Calculus (First Derivative)

In the diagram below, we find the distances \( d \) and \( D \), add them, and minimize the total distance.

Minimize distance travelled solution
Figure 2. Geometric layout for distances \( d \) and \( D \)
\[ d = \sqrt{x^2 + 5^2} \] \[ D = \sqrt{(20 - x)^2 + 10^2} \]

The total distance \( T \) is given by:

\[ T = d + D = \sqrt{x^2 + 25} + \sqrt{(20 - x)^2 + 100} \]

We now find the first derivative \( \dfrac{dT}{dx} \) of \( T \) with respect to \( x \), check that \( T \) has a minimum value, and find the value of \( x \) that minimizes \( T \):

\[ \frac{dT}{dx} = \frac{x}{\sqrt{x^2 + 25}} - \frac{20 - x}{\sqrt{(20 - x)^2 + 100}} \]

The graph of \( \dfrac{dT}{dx} \) is shown below. At approximately \( x = 6.67 \), the first derivative is equal to zero; below that value it is negative, and above that value it is positive. Hence, \( T \) has a minimum value at around \( x = 6.67 \).

First derivative of distance T
Figure 3. Graph of the first derivative \( \dfrac{dT}{dx} \)

Setting \( \dfrac{dT}{dx} = 0 \) to find the critical value:

\[ \frac{x}{\sqrt{x^2 + 25}} = \frac{20 - x}{\sqrt{(20 - x)^2 + 100}} \]

Cross-multiplying:

\[ x \sqrt{(20 - x)^2 + 100} = (20 - x) \sqrt{x^2 + 25} \]

Squaring both sides:

\[ x^2 \left((20 - x)^2 + 100\right) = (20 - x)^2 (x^2 + 25) \] \[ x^2(400 - 40x + x^2 + 100) = (400 - 40x + x^2)(x^2 + 25) \] \[ x^2(x^2 - 40x + 500) = (x^2 - 40x + 400)(x^2 + 25) \] \[ x^4 - 40x^3 + 500x^2 = x^4 + 25x^2 - 40x^3 - 1000x + 400x^2 + 10000 \] \[ 500x^2 = 425x^2 - 1000x + 10000 \implies 75x^2 + 1000x - 10000 = 0 \]

Dividing the quadratic equation by 25:

\[ 3x^2 + 40x - 400 = 0 \]

Solving for \( x \) using the quadratic formula and selecting the positive value:

\[ x = \frac{-40 + \sqrt{40^2 - 4(3)(-400)}}{2(3)} = \frac{-40 + \sqrt{1600 + 4800}}{6} = \frac{-40 + \sqrt{6400}}{6} = \frac{-40 + 80}{6} = \frac{40}{6} = \frac{20}{3} \approx 6.67 \; \text{km} \]

METHOD 2: Geometric Projection

We construct a "virtual house" (reflection) \( H \) on the other side of the river. For the total distance \( d + D \) to be minimum, points \( H \), \( O \), and \( F \) must be collinear because the shortest distance between two points is a straight line. For these points to be collinear, angles \( HOH' \) and \( FOF' \) must be equal in size, meaning their tangents are equal.

Projection of the house
Figure 4. Geometric projection method

Calculating the tangents for both angles in terms of \( x \):

\[ \tan(HOH') = \frac{5}{x} \] \[ \tan(FOF') = \frac{10}{20 - x} \]

Equating the tangents:

\[ \frac{5}{x} = \frac{10}{20 - x} \]

Solving for \( x \):

\[ 5(20 - x) = 10x \implies 100 - 5x = 10x \implies 15x = 100 \implies x = \frac{100}{15} = \frac{20}{3} \approx 6.67 \; \text{km} \]

References and Links