MATH-100 · Lesson 4 of 5 · 52 min

Applications: related rates and optimization

Derivatives earn their place in engineering by answering two kinds of question. The first is "how fast?": if one quantity is changing at a known rate, how fast is a connected quantity changing? The second is "what is best?": which dimensions use the least material, which load gives the most power, which operating point costs the least?

This lesson covers both, plus three tools that build on them: linear approximation for estimating errors, Newton's method for solving equations numerically, and L'Hôpital's rule for limits that resist algebra. It is a long lesson with many worked examples, because these methods are learned by doing.

In a related-rates problem, several quantities change with time and are linked by an equation. You know the rate of some of them and need the rate of another. Because they are linked, their rates are linked too, and the chain rule connects them.

A reliable method works for almost every problem:

  • Draw a diagram and label every quantity that changes with a variable, not a number.
  • Write down the rate you know and the rate you want, as derivatives with respect to time.
  • Find an equation linking the variables (geometry, a physical law, or a model).
  • Differentiate both sides of that equation with respect to time, using the chain rule.
  • Only now substitute the numbers for the particular instant, and solve for the unknown rate.

The order of the last two steps matters. If you substitute numbers before differentiating, the quantities that are changing become constants, and their derivatives vanish incorrectly.

Worked problem

Spreading spill

A circular oil spill grows so that its radius increases at 0.5 m/s. How fast is the area increasing when the radius is 4 m?

Show solution
  1. Known: \(dr/dt = 0.5\) m/s. Wanted: \(dA/dt\) when \(r = 4\).
  2. Equation: \(A = \pi r^2\).
  3. Differentiate with respect to \(t\): \(\dfrac{dA}{dt} = 2\pi r\dfrac{dr}{dt}\).
  4. Substitute: \(\dfrac{dA}{dt} = 2\pi(4)(0.5) = 4\pi\).

Answer: 4π ≈ 12.6 m²/s. The area grows faster as the spill gets bigger, even though the radius grows steadily

A 5 m ladder leaning against a wall, bottom 3 m from the wall, sliding away at 0.5 m/s
The ladder's length is fixed, so x² + y² = 25 at every instant. As the bottom slides out, the top must slide down.

Worked problem

Sliding ladder

A 5 m ladder leans against a wall. Its bottom slides away from the wall at 0.5 m/s. How fast is the top sliding down when the bottom is 3 m from the wall?

Show solution
  1. Let \(x\) be the distance from wall to bottom and \(y\) the height of the top. Known: \(dx/dt = 0.5\). Wanted: \(dy/dt\) when \(x = 3\).
  2. Equation (Pythagoras): \(x^2 + y^2 = 25\).
  3. Differentiate: \(2x\dfrac{dx}{dt} + 2y\dfrac{dy}{dt} = 0\), so \(\dfrac{dy}{dt} = -\dfrac{x}{y}\dfrac{dx}{dt}\).
  4. At this instant \(x = 3\), so \(y = \sqrt{25 - 9} = 4\).
  5. Substitute: \(\dfrac{dy}{dt} = -\dfrac{3}{4}(0.5) = -0.375\) m/s.

Answer: The top slides down at 0.375 m/s. The negative sign means y is decreasing

Notice that \(dy/dt = -(x/y)(dx/dt)\) grows as \(y\) shrinks. Near the bottom of its fall the top of the ladder moves very fast, which is one reason ladders that start to slip are so dangerous.

An inverted cone 2 m in radius and 4 m deep, partly filled with water to depth h
The water forms a smaller cone similar to the tank, so its radius is always half its depth.

Worked problem

Filling a conical tank

Water flows at 0.5 m³/min into an inverted conical tank 4 m deep with a top radius of 2 m. How fast is the water level rising when the water is 2 m deep?

Show solution
  1. Known: \(dV/dt = 0.5\). Wanted: \(dh/dt\) when \(h = 2\).
  2. The volume of a cone is \(V = \tfrac13\pi r^2 h\). Similar triangles give \(r/h = 2/4\), so \(r = h/2\).
  3. Eliminate \(r\) before differentiating: \(V = \tfrac13\pi\left(\tfrac{h}{2}\right)^2 h = \dfrac{\pi h^3}{12}\).
  4. Differentiate: \(\dfrac{dV}{dt} = \dfrac{\pi h^2}{4}\dfrac{dh}{dt}\).
  5. Substitute \(h = 2\): \(0.5 = \pi\dfrac{dh}{dt}\), so \(\dfrac{dh}{dt} = \dfrac{0.5}{\pi} \approx 0.159\) m/min.

Answer: About 0.16 m/min (16 cm per minute)

Maximum and minimum values

Optimization means finding the largest or smallest value of a function. Two kinds of extreme value matter:

  • An absolute (global) maximum or minimum is the largest or smallest value over the whole interval being considered.
  • A local maximum or minimum is the largest or smallest value compared with nearby points only: the top of a hill or the bottom of a valley.

The Extreme Value Theorem guarantees that a continuous function on a closed interval \([a, b]\) has both an absolute maximum and an absolute minimum. They can only occur at two kinds of place:

  • Critical points: interior points where \(f'(x) = 0\) or \(f'(x)\) does not exist.
  • Endpoints of the interval.

The closed-interval method

To find the absolute extremes of a continuous function on \([a, b]\): find the critical points inside the interval, evaluate \(f\) at each critical point and at both endpoints, and pick the largest and smallest values. No derivative tests are needed, just a comparison.

Worked problem

Closed-interval method

Find the absolute maximum and minimum of \(f(x) = x^3 - 3x^2 + 1\) on \([-1, 4]\).

Show solution
  1. \(f'(x) = 3x^2 - 6x = 3x(x - 2)\), which is zero at \(x = 0\) and \(x = 2\). Both are inside the interval.
  2. Evaluate: \(f(-1) = -3\), \(f(0) = 1\), \(f(2) = -3\), \(f(4) = 17\).
  3. Largest: 17 at \(x = 4\). Smallest: −3, at both \(x = -1\) and \(x = 2\).

Answer: Absolute maximum 17 at x = 4; absolute minimum −3 at x = −1 and x = 2

Graph of x³ − 3x² + 1 on [−1, 4] with a local maximum at 0, local minimum at 2, inflection at 1 and the absolute maximum at the endpoint 4
The local maximum at x = 0 is not the absolute maximum: the endpoint x = 4 is much higher. Always check endpoints.

Classifying critical points

On an open interval, or when you need to know what kind of point you have found, use a derivative test.

  • First derivative test: if \(f'\) changes from positive to negative at a critical point, it is a local maximum. If it changes from negative to positive, it is a local minimum. If it does not change sign, it is neither.
  • Second derivative test: at a critical point where \(f'(c) = 0\), if \(f''(c) < 0\) it is a local maximum (concave down, like a cap); if \(f''(c) > 0\) it is a local minimum (concave up, like a cup). If \(f''(c) = 0\), the test tells you nothing; use the first derivative test.

For the function above, \(f''(x) = 6x - 6\). At \(x = 0\), \(f''(0) = -6 < 0\): a local maximum. At \(x = 2\), \(f''(2) = 6 > 0\): a local minimum.

A point where the concavity changes is an inflection point. Here \(f''\) changes sign at \(x = 1\), so (1, −1) is an inflection point. In beam design, inflection points mark where the bending moment changes sign, which matters for where reinforcement is placed in concrete beams.

Optimization problems

Applied optimization problems are word problems. The mathematics is usually straightforward; the skill is in setting the problem up. Use these steps:

  • Read the problem and identify the quantity to be maximized or minimized (the objective).
  • Draw a diagram and name the variables.
  • Write the objective as a formula. If it has more than one variable, use the constraint (a fixed perimeter, volume or budget) to eliminate all but one.
  • State the domain: the range of values that make physical sense.
  • Find the critical points, then compare them with the endpoints (or use a derivative test) to confirm which is the optimum.
  • Answer the question asked, with units, and check that the answer makes sense.
A 30 cm square sheet with an x by x square cut from each corner
Cutting larger squares makes the box taller but shrinks its base. Somewhere in between is the best size.

Worked problem

Largest open box

An open-top box is made from a 30 cm × 30 cm sheet by cutting equal squares of side \(x\) from each corner and folding up the sides. What value of \(x\) gives the largest volume?

Show solution
  1. Objective: volume. The base is \((30 - 2x)\) square and the height is \(x\), so \(V(x) = x(30 - 2x)^2\).
  2. Domain: \(0 < x < 15\). (At \(x = 0\) or \(x = 15\) the volume is zero.)
  3. Differentiate with the product rule: \(V'(x) = (30 - 2x)^2 - 4x(30 - 2x) = (30 - 2x)(30 - 6x)\).
  4. \(V'(x) = 0\) at \(x = 15\) (an endpoint) or \(x = 5\).
  5. Check: \(V(5) = 5 \times 20^2 = 2000\) cm³, while the volume is zero at both ends of the domain. So \(x = 5\) gives the maximum.

Answer: Cut 5 cm squares, giving a 20 × 20 × 5 cm box with a volume of 2000 cm³ (2 L)

Worked problem

Cheapest can

A cylindrical can must hold 1 L (1000 cm³). What radius and height use the least sheet metal (minimum surface area, including top and bottom)?

Show solution
  1. Objective: area \(A = 2\pi r^2 + 2\pi r h\) (two ends plus the side).
  2. Constraint: \(\pi r^2 h = 1000\), so \(h = \dfrac{1000}{\pi r^2}\).
  3. Substitute: \(A(r) = 2\pi r^2 + \dfrac{2000}{r}\), for \(r > 0\).
  4. Differentiate: \(A'(r) = 4\pi r - \dfrac{2000}{r^2}\). Setting it to zero gives \(r^3 = \dfrac{500}{\pi}\), so \(r \approx 5.42\) cm.
  5. Then \(h = \dfrac{1000}{\pi(5.42)^2} \approx 10.84\) cm.
  6. \(A''(r) = 4\pi + \dfrac{4000}{r^3} > 0\) for all \(r > 0\), so this is a minimum.

Answer: r ≈ 5.42 cm and h ≈ 10.84 cm. The height equals the diameter

Real cans are usually taller than this. The ideal shape ignores the cost of the seams and the extra-thick ends, and designers trade a little material for a can that fits the hand and the shelf. Optimization gives a starting point; engineering judgement finishes the design.

Worked problem

Fencing beside a river

A contractor has 1200 m of fencing to enclose a rectangular storage yard along a straight river. No fence is needed on the river side. What dimensions give the largest area?

Show solution
  1. Let \(x\) be the length of each side perpendicular to the river. The side parallel to the river is \(1200 - 2x\).
  2. Objective: \(A(x) = x(1200 - 2x) = 1200x - 2x^2\), for \(0 < x < 600\).
  3. \(A'(x) = 1200 - 4x = 0\) at \(x = 300\). \(A''(x) = -4 < 0\), so this is a maximum.
  4. Dimensions: 300 m by 600 m. Area: 180 000 m².

Answer: 300 m × 600 m, enclosing 180 000 m²

Worked problem

Maximum power transfer

A 12 V source with internal resistance \(r = 4\ \Omega\) drives a load resistance \(R\). The power delivered to the load is \(P(R) = \dfrac{144R}{(R + 4)^2}\) watts. What load resistance gives the most power?

Show solution
  1. Quotient rule: \(P'(R) = 144\dfrac{(R + 4)^2 - R \cdot 2(R + 4)}{(R + 4)^4} = \dfrac{144(4 - R)}{(R + 4)^3}\).
  2. \(P'(R) = 0\) at \(R = 4\ \Omega\). \(P' > 0\) for \(R < 4\) and \(P' < 0\) for \(R > 4\), so it is a maximum.
  3. \(P(4) = \dfrac{144 \times 4}{64} = 9\) W.

Answer: R = 4 Ω, matching the internal resistance, delivering 9 W. This is the maximum power transfer theorem used in circuit and antenna design

Linear approximation and error propagation

In Lesson 2 you met the linear approximation \(f(x) \approx f(a) + f'(a)(x - a)\). Writing the small change in input as \(dx\) and the resulting change in output as \(dy\) gives the differential form:

\[dy = f'(x)\,dx\]

This is how engineers estimate how measurement errors carry through a calculation. If you measure \(x\) with an uncertainty \(dx\), the calculated value \(y = f(x)\) has an uncertainty of about \(|f'(x)|\,dx\).

Worked problem

Error in a calculated volume

The radius of a steel ball is measured as 10 cm with a possible error of ±0.05 cm. Estimate the possible error in its calculated volume.

Show solution
  1. \(V = \tfrac43\pi r^3\), so \(dV = 4\pi r^2\,dr\).
  2. \(dV = 4\pi(10)^2(0.05) \approx 62.8\) cm³.
  3. The volume itself is \(\tfrac43\pi(1000) \approx 4189\) cm³, so the relative error is about \(62.8/4189 \approx 1.5\%\).

Answer: About ±63 cm³, or ±1.5%. A 0.5% error in the radius became a 1.5% error in the volume

The pattern in that example is general: for \(y = kx^n\), the relative error in \(y\) is about \(n\) times the relative error in \(x\). Cubing a measurement triples its percentage error; taking a square root halves it. This tells you which measurements in an experiment need the most care.

Newton's method

Many engineering equations cannot be solved with algebra: the friction factor in pipe flow, the depth of flow in a channel, the angle of a mechanism. Newton's method finds a numerical solution of \(f(x) = 0\) by following tangent lines.

Start with a guess \(x_0\). The tangent line at \(x_0\) crosses the x-axis at a point that is usually much closer to the root. Setting the tangent line \(y = f(x_0) + f'(x_0)(x - x_0)\) to zero gives the next estimate, and the process repeats:

\[x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}\]
Tangent lines from x₀ = 1.5 on the curve x³ − x − 1 leading to estimates x₁ and x₂ near the root
Each tangent line meets the axis at the next estimate. Near the root, the number of correct digits roughly doubles with each step.

Worked problem

Solving a cubic

In Lesson 1 the bisection method located a root of \(x^3 - x - 1 = 0\) between 1.25 and 1.5. Use Newton's method from \(x_0 = 1.5\) to find it to six decimal places.

Show solution
  1. \(f(x) = x^3 - x - 1\) and \(f'(x) = 3x^2 - 1\).
  2. \(x_1 = 1.5 - \dfrac{0.875}{5.75} = 1.347826\).
  3. \(x_2 = 1.347826 - \dfrac{0.100682}{4.449905} = 1.325200\).
  4. \(x_3 = 1.325200 - \dfrac{0.002058}{4.268468} = 1.324718\).
  5. \(x_4 = 1.324718\): no change in six decimal places.

Answer: x ≈ 1.324718, in three steps. Bisection would need about 20 halvings for the same accuracy

Newton's method is fast when it works, but it can fail. If \(f'(x_n)\) is zero or very small, the tangent is nearly flat and the next estimate shoots far away. A poor starting guess can lead to a different root, or none. In practice, engineers sketch the function first, start close to the root, and fall back on bisection if the estimates misbehave.

Worked problem

Square roots the way calculators do it

Use Newton's method on \(f(x) = x^2 - 2\) with \(x_0 = 1\) to approximate \(\sqrt{2}\).

Show solution
  1. The formula simplifies to \(x_{n+1} = x_n - \dfrac{x_n^2 - 2}{2x_n} = \dfrac12\left(x_n + \dfrac{2}{x_n}\right)\).
  2. \(x_1 = 1.5\), \(x_2 = 1.416667\), \(x_3 = 1.414216\), \(x_4 = 1.414214\).

Answer: √2 ≈ 1.414214, correct to six places after four steps

L'Hôpital's rule

Derivatives also give a powerful tool for indeterminate limits. If \(\lim_{x \to a} f(x)/g(x)\) gives \(0/0\) or \(\infty/\infty\), then

\[\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}\]

provided the limit on the right exists. Note that you differentiate the top and bottom separately. This is not the quotient rule.

Worked problem

Using L'Hôpital's rule

Evaluate \(\lim_{x \to 0} \dfrac{e^x - 1}{x}\), \(\lim_{x \to \infty} \dfrac{x}{e^x}\) and \(\lim_{x \to 0} \dfrac{1 - \cos x}{x^2}\).

Show solution
  1. First: \(0/0\). Differentiate top and bottom: \(\dfrac{e^x}{1} \to 1\).
  2. Second: \(\infty/\infty\). Differentiate: \(\dfrac{1}{e^x} \to 0\). Exponentials eventually beat any power of \(x\).
  3. Third: \(0/0\). Differentiate: \(\dfrac{\sin x}{2x}\), still \(0/0\). Apply the rule again: \(\dfrac{\cos x}{2} \to \dfrac12\).

Answer: 1, 0 and 1/2

The third result says that for small angles, \(\cos x \approx 1 - \tfrac12 x^2\). That is the second-order small-angle approximation, used when the first-order version \(\cos x \approx 1\) is too crude.

Always check that the form really is \(0/0\) or \(\infty/\infty\) before applying the rule. Using it on a limit like \(\lim_{x \to 0} \dfrac{x + 1}{x + 2}\), which is simply 1/2 by substitution, gives a wrong answer.

Common mistakes

  • MistakeIn a related-rates problem, substituting the numbers for the instant before differentiating.

    InsteadDifferentiate the general equation first, while every changing quantity is still a variable. Substitute values afterwards.

  • MistakeIgnoring signs in related rates, such as reporting the falling ladder's top moving at +0.375 m/s.

    InsteadA negative rate means a quantity is decreasing. Keep the sign and state the direction in words.

  • MistakeFinding a critical point and declaring it the answer without checking endpoints or the second derivative.

    InsteadCompare values at all critical points and endpoints, or use a derivative test to confirm it is the maximum or minimum you need.

  • MistakeLeaving two variables in the objective function.

    InsteadUse the constraint to eliminate all but one variable before differentiating.

  • MistakeApplying L'Hôpital's rule with the quotient rule, or to a limit that is not 0/0 or ∞/∞.

    InsteadDifferentiate the numerator and denominator separately, and only for an indeterminate form.

  • MistakeTrusting Newton's method blindly from any starting guess.

    InsteadSketch the function, start near the root, and watch for estimates that jump around or a derivative close to zero.

Summary and key terms

  • Related rates: link the quantities with an equation, differentiate with respect to time, then substitute the values at the instant of interest.
  • Absolute extremes of a continuous function on a closed interval occur at critical points or endpoints. Compare the function values.
  • First derivative test: a sign change of f′ from + to − marks a local maximum, − to + a local minimum. Second derivative test: f″ < 0 maximum, f″ > 0 minimum.
  • Inflection points are where concavity changes, usually where f″ changes sign.
  • Optimization: define the objective, use constraints to reduce to one variable, set the domain, find critical points and confirm.
  • Differentials dy = f′(x)dx estimate how input errors propagate. For y = kxⁿ, relative error multiplies by n.
  • Newton's method, xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ), solves equations numerically and converges very fast near a root.
  • L'Hôpital's rule evaluates 0/0 and ∞/∞ limits by differentiating the top and bottom separately.
Related rates
Rates of change of quantities linked by an equation.
Critical point
A point where f′ = 0 or f′ does not exist.
Absolute extreme
The largest or smallest value over the whole domain considered.
Local extreme
A peak or valley compared with nearby points.
Inflection point
A point where the graph changes concavity.
Objective function
The quantity being maximized or minimized.
Constraint
A condition that limits the choices, such as a fixed volume or budget.
Differential
dy = f′(x) dx, the linear estimate of a small change.
Newton's method
An iterative method that follows tangent lines to a root.
L'Hôpital's rule
lim f/g = lim f′/g′ for 0/0 and ∞/∞ forms.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. A spherical balloon is inflated at 100 cm³/s. How fast is its radius increasing when the radius is 10 cm?

    Show answer

    V = (4/3)πr³, so dV/dt = 4πr² dr/dt. 100 = 4π(100) dr/dt, giving dr/dt = 1/(4π) ≈ 0.0796 cm/s.

  2. A 1.8 m tall worker walks away from a 6 m lamp post at 1.2 m/s. How fast is the tip of the worker's shadow moving?

    Show answer

    Let x be the worker's distance from the post and s the distance to the shadow tip. Similar triangles: s/6 = (s − x)/1.8, so s = (10/7)x. ds/dt = (10/7)(1.2) ≈ 1.71 m/s.

  3. Find the absolute maximum and minimum of \(f(x) = 2x^3 - 9x^2 + 12x\) on \([0, 3]\).

    Show answer

    f′ = 6x² − 18x + 12 = 6(x − 1)(x − 2). f(0) = 0, f(1) = 5, f(2) = 4, f(3) = 9. Maximum 9 at x = 3; minimum 0 at x = 0.

  4. Find and classify the critical points of \(g(x) = x^4 - 8x^2\).

    Show answer

    g′ = 4x³ − 16x = 4x(x − 2)(x + 2). g″ = 12x² − 16. At x = 0, g″ = −16: local maximum (g = 0). At x = ±2, g″ = 32: local minima (g = −16).

  5. A rectangular plate with a perimeter of 4 m is to have the largest possible area. What are its dimensions?

    Show answer

    With sides x and 2 − x, A = x(2 − x). A′ = 2 − 2x = 0 at x = 1. A square 1 m × 1 m, area 1 m².

  6. An open-top rectangular tank with a square base must hold 32 m³. Find the dimensions that use the least sheet material.

    Show answer

    Base x × x, height h = 32/x². Area A = x² + 4xh = x² + 128/x. A′ = 2x − 128/x² = 0 gives x³ = 64, x = 4 m, h = 2 m. Area 48 m².

  7. The side of a square plate is measured as 50.0 mm ± 0.2 mm. Estimate the error in its calculated area, and the percentage error.

    Show answer

    A = s², dA = 2s ds = 2(50)(0.2) = 20 mm². A = 2500 mm², so the error is 0.8%, twice the 0.4% error in the side.

  8. Use Newton's method with \(x_0 = 1\) to solve \(\cos x = x\) (radians) to four decimal places.

    Show answer

    f = cos x − x, f′ = −sin x − 1. x₁ = 0.7504, x₂ = 0.7391, x₃ = 0.7391. Solution x ≈ 0.7391.

  9. Evaluate \(\lim_{x \to 0} \dfrac{\sin 4x}{\tan x}\) using L'Hôpital's rule.

    Show answer

    It is 0/0. Differentiate: 4 cos 4x / sec² x → 4/1 = 4.

  10. Evaluate \(\lim_{x \to \infty} \dfrac{\ln x}{x}\). What does it tell you about how fast logarithms grow?

    Show answer

    ∞/∞. Differentiate: (1/x)/1 → 0. Logarithms grow more slowly than any positive power of x.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz