Ma · Mathematics

How to Find the Optimal Path in a Calculus Problem

Published By the 9to5Science editorial team

At a glance

  1. 1. Define the goal

    Decide what you are minimizing or maximizing: distance, travel time, cost, or another quantity.

  2. 2. Choose a variable

    Represent the possible path choices with a variable and write down its allowed range.

  3. 3. Build the objective

    Express the total distance, time, or cost as a function of that variable.

  4. 4. Check all candidates

    Find interior critical points, test endpoints and constraints, then compare the objective values.

An “optimal path” is a path that gives the best value of a specified quantity. The shortest route is not always the fastest route: a path may pass through regions where travel is faster or cheaper. To solve an optimization problem, first identify what is being optimized and which paths are allowed.

For many introductory calculus problems, you can describe the choice of path using one variable. You then write the total distance, time, or cost as a function of that variable, find candidate minima or maxima, and check the candidates against the endpoints and constraints.

Turn the path into a function

Start by drawing and labeling the geometry. Choose a variable that captures the decision—for example, where to enter a road, where to cross a river, or where a path meets a boundary. Use the diagram and the Pythagorean theorem to express each segment of the route.

Next, decide what the objective is. If a traveler moves at different speeds on different parts of a route, minimizing distance may not minimize travel time. In that case, calculate the time for each segment using

time=distancespeed\text{time} = \frac{\text{distance}}{\text{speed}}

and add the times to form the objective function. Finally, state the variable’s domain: the physical situation usually limits which values are possible.

Worked example: choosing where to enter the water

Suppose a person starts on a straight shore, 100 m from the point PP nearest a destination. The destination is 50 m offshore, directly opposite PP. The person can walk along the shore at 5 m/s and swim at 1.5 m/s. Where should they enter the water to minimize total travel time?

Let xx be the signed distance along the shore from PP, positive toward the starting point, so the starting point has coordinate x=100x=100. For an entry point between the start and PP, 0≤x≤1000 \leq x \leq 100. The person walks 100−x100-x metres. The swimming route is the hypotenuse of a right triangle with sides xx and 50, so its length is x2+502\sqrt{x^2+50^2} metres. For any entry point with x≤100x \leq 100, the total travel time is

T(x)=100−x5+x2+25001.5.T(x) = \frac{100-x}{5} + \frac{\sqrt{x^2+2500}}{1.5}.

Differentiate and set the derivative equal to zero to find interior candidates:

T′(x)=−15+x1.5x2+2500=0.T'(x) = -\frac{1}{5} + \frac{x}{1.5\sqrt{x^2+2500}} = 0.

Rearranging gives

xx2+2500=0.3,x2=0.09(x2+2500),0.91x2=225.\frac{x}{\sqrt{x^2+2500}} = 0.3, \qquad x^2 = 0.09(x^2+2500), \qquad 0.91x^2 = 225.

Thus x=225/0.91≈15.7x = \sqrt{225/0.91} \approx 15.7 m. The negative square root does not satisfy the unsquared equation. This candidate is a minimum: for x≤100x \leq 100,

T′′(x)=25001.5(x2+2500)3/2>0,T''(x) = \frac{2500}{1.5(x^2+2500)^{3/2}} > 0,

so the time function is convex. On the interval 0≤x≤1000 \leq x \leq 100, the endpoints are also worth checking. At x=0x=0, the traveler walks to PP and then swims straight to the destination; at x=100x=100, they swim the entire route. Their times are about 53.3 s and 74.5 s, respectively. At the critical point, the person walks about 84.3 m and swims about 52.4 m, taking approximately 51.8 s in total.

If entry points anywhere along the straight shore are allowed, the same point is the global minimum. For x≤100x \leq 100, T′′(x)>0T''(x)>0 and T′(x)T'(x) has its unique zero at x≈15.7x \approx 15.7, so TT decreases before that point and increases from it through x=100x=100. For x>100x>100, the person walks x−100x-100 metres, and the time is

T(x)=x−1005+x2+25001.5.T(x) = \frac{x-100}{5} + \frac{\sqrt{x^2+2500}}{1.5}.

Its derivative is 15+x1.5x2+2500>0\frac{1}{5} + \frac{x}{1.5\sqrt{x^2+2500}} > 0, so the time also increases for x>100x>100. The fastest route is therefore to enter the water about 15.7 m before reaching PP.

A reliable method for other problems

  1. Define the objective. State exactly what “best” means: shortest distance, least time, lowest cost, or something else.
  2. Choose variables and constraints. A diagram often reveals a useful variable and its allowable interval.
  3. Write the objective. Express every relevant segment or cost in terms of the variable, then combine them.
  4. Find candidates. Solve where the derivative is zero, and also include points where the derivative does not exist.
  5. Check the whole feasible set. Test endpoints and any other boundary cases, and compare objective values. A critical point alone does not prove a global optimum.

If a problem allows paths to bend around obstacles, also check routes along the obstacle boundary and corners. In a uniform, unobstructed region, the straight line between two points is the shortest path. When the path itself can vary continuously, rather than just one crossing point, the problem may require calculus of variations. Such problems often represent the quantity to minimize as an integral over a curve and use the Euler–Lagrange equation.

Common mistakes

  • Optimizing the wrong quantity: Minimizing distance does not necessarily minimize time when speeds differ.
  • Forgetting the domain: A derivative may produce a candidate that is physically impossible.
  • Ignoring endpoints: A constrained optimum can occur at a boundary, even when the derivative is not zero there.
  • Using the wrong geometry: Check which sides of each right triangle are horizontal, vertical, or along the route before applying the Pythagorean theorem.
  • Assuming a critical point is automatically the answer: Verify that it gives the required minimum or maximum and compare it with all other feasible candidates.

The exact optimal path depends on the problem’s distances, speeds, obstacles, and objective. Without those details, there is no unique numerical answer; the modeling and candidate-checking process is what applies across optimization problems.

References

  1. Calculus: Early Transcendentals, James Stewart

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.