Class 12 Maths, Worked in Full Past papersGet updates
Chapter 6 · Application of Derivatives

Example 29: Helicopter on y=x2+7y = x^2 + 7⁠, soldier at (3,7)(3, 7)

ExamplesOptimisation · Section 6.4.1
The question

An Apache helicopter of enemy is flying along the curve given by y=x2+7y = x^2 + 7⁠. A soldier, placed at (3,7)(3, 7)⁠, wants to shoot down the helicopter when it is nearest to him. Find the nearest distance.

Exam answer

Let the helicopter be at (x,x2+7)(x, x^2 + 7)⁠. Its distance from (3,7)(3, 7) is f(x)\sqrt{f(x)}⁠, where

f(x)=(x−3)2+(x2+7−7)2=(x−3)2+x4\begin{aligned} f(x) &= (x - 3)^2 + (x^2 + 7 - 7)^2 \\ &= (x - 3)^2 + x^4 \end{aligned}

The distance is least when f(x)f(x) is least.

f′(x)=2(x−3)+4x3=2(x−1)(2x2+2x+3)\begin{aligned} f'(x) &= 2(x - 3) + 4x^3 \\ &= 2(x - 1)(2x^2 + 2x + 3) \end{aligned}

As 2x2+2x+3>02x^2 + 2x + 3 > 0 for all xx (its discriminant is 4−24<04 - 24 < 0⁠), f′(x)=0⇒x=1f'(x) = 0 \Rightarrow x = 1⁠.

For x<1x < 1⁠, f′(x)<0f'(x) < 0⁠; for x>1x > 1⁠, f′(x)>0f'(x) > 0⁠. So ff is least at x=1x = 1⁠.

f(1)=(1−3)2+14=5f(1) = (1 - 3)^2 + 1^4 = 5

Hence the nearest distance is 5\sqrt5 units.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

The helicopter's position is fixed by one number, its xx-coordinate, so its distance from the soldier is a function of xx⁠. A distance is never negative and  \sqrt{\ } is increasing, so the distance is smallest exactly where its square is smallest. Minimising the square avoids differentiating a square root.

Given, to find, and the plan
Given
The path y=x2+7y = x^2 + 7 (every real xx⁠) and the soldier at (3,7)(3, 7)⁠.
To find
The least distance between the soldier and a point of the path.
Plan
Write the squared distance f(x)=(x−3)2+x4f(x) = (x - 3)^2 + x^4⁠. Factorise f′f'⁠, find the critical points, use the sign of f′f' to show the only one gives the least value of ff on all of R\R⁠, and take the square root.

Basics you need

1Distance formula

The distance between (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is (x2−x1)2+(y2−y1)2\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}⁠. Basics: building the function to optimise

2Minimise the square instead

For numbers a,b≥0a, b \ge 0⁠: a<b  ⟺  a<ba < b \iff \sqrt a < \sqrt b⁠. So f(x)\sqrt{f(x)} is least exactly where f(x)f(x) is least.

3Factor theorem and the discriminant

If p(1)=0p(1) = 0⁠, then x−1x - 1 is a factor of p(x)p(x)⁠. A quadratic ax2+bx+cax^2 + bx + c with b2−4ac<0b^2 - 4ac < 0 has no real roots, and if a>0a > 0 it is positive for every xx⁠. Basics: factorising and the discriminant

4Decreasing then increasing (Theorem 1, Section 6.3)

If f′<0f' < 0 to the left of cc and f′>0f' > 0 to the right, ff falls to f(c)f(c) and rises after it, so f(c)f(c) is its least value. Lesson: increasing and decreasing functions

Solution

  1. The distance as a function of xx

    When the helicopter is at xx⁠, it is at (x,x2+7)(x, x^2 + 7)⁠. Its distance from (3,7)(3, 7) is

    (x−3)2+(x2+7−7)2=(x−3)2+x4.\begin{aligned} &\sqrt{(x - 3)^2 + (x^2 + 7 - 7)^2} \\ &= \sqrt{(x - 3)^2 + x^4}. \end{aligned}
    One number, xx⁠, describes where the helicopter is, so everything becomes a function of xx⁠. The +7+7 and −7-7 cancel because the soldier is at the same height as the lowest point of the path.
    Distance formula (Basic 1). Basics: building the function to optimise
  2. Work with the squared distance

    Let

    f(x)=(x−3)2+x4,x∈R.f(x) = (x - 3)^2 + x^4, \qquad x \in \R.

    The distance is f(x)\sqrt{f(x)}⁠, and by Basic 2 it is least where ff is least.

    Differentiating ff is simpler than differentiating its square root, and the answer is the same point. (The book calls this squared distance ff and takes the square root at the end.)
     \sqrt{\ } is increasing on [0,∞)[0, \infty) (Basic 2).
  3. Differentiate and factorise

    f′(x)=2(x−3)+4x3=4x3+2x−6=2(2x3+x−3).\begin{aligned} f'(x) &= 2(x - 3) + 4x^3 \\ &= 4x^3 + 2x - 6 = 2(2x^3 + x - 3). \end{aligned}

    x=1x = 1 makes 2x3+x−3=02x^3 + x - 3 = 0⁠, so x−1x - 1 is a factor:

    f′(x)=2(x−1)(2x2+2x+3).f'(x) = 2(x - 1)(2x^2 + 2x + 3).
    To find where f′=0f' = 0 we need factors. Trying small whole numbers in 2x3+x−32x^3 + x - 3 quickly finds x=1x = 1⁠; dividing by x−1x - 1 (or comparing coefficients) gives the quadratic. Check: (x−1)(2x2+2x+3)=2x3+x−3(x - 1)(2x^2 + 2x + 3) = 2x^3 + x - 3⁠.
    Chain rule for (x−3)2(x-3)^2⁠; power rule for x4x^4⁠; factor theorem (Basic 3). Basics: factorising and the discriminant
  4. The only critical point is x=1x = 1

    For the quadratic factor, the discriminant is

    22−4⋅2⋅3=4−24=−20<0,2^2 - 4\cdot 2\cdot 3 = 4 - 24 = -20 < 0,

    so 2x2+2x+3=02x^2 + 2x + 3 = 0 has no real roots; since its leading coefficient is positive, 2x2+2x+3>02x^2 + 2x + 3 > 0 for every xx⁠. Hence f′(x)=0f'(x) = 0 only at x=1x = 1⁠. ff is a polynomial (differentiable everywhere), and xx ranges over all of R\R⁠, so there are no end points to add.

    The book makes the same two remarks: no real roots for the quadratic, and no end points. Knowing that the quadratic factor is always positive (not just non-zero) is what lets us read the sign of f′f' in the next step.
    Discriminant test (Basic 3). Equivalently, 2x2+2x+3=2(x+12)2+52>02x^2 + 2x + 3 = 2\left(x + \frac12\right)^2 + \frac52 > 0⁠.
  5. x=1x = 1 gives the least value of ff on all of R\R

    In f′(x)=2(x−1)(2x2+2x+3)f'(x) = 2(x - 1)(2x^2 + 2x + 3)⁠, the factors 22 and 2x2+2x+32x^2 + 2x + 3 are always positive, so f′f' has the sign of x−1x - 1⁠:

    • x<1x < 1⁠: f′(x)<0f'(x) < 0⁠, ff is decreasing;
    • x>1x > 1⁠: f′(x)>0f'(x) > 0⁠, ff is increasing.

    So f(x)>f(1)f(x) > f(1) for every x≠1x \ne 1⁠, and the least value is

    f(1)=(1−3)2+14=4+1=5.f(1) = (1 - 3)^2 + 1^4 = 4 + 1 = 5.
    The book argues differently: with only one critical point, 5\sqrt5 is "either a maximum value or a minimum value", and since f(0)=3>5\sqrt{f(0)} = 3 > \sqrt5⁠, it must be the minimum. That argument needs more care (a single critical point need not be either), while the sign of f′f' settles it completely. As a further check, f′′(x)=2+12x2>0f''(x) = 2 + 12x^2 > 0⁠, so the second derivative test also gives a local minimum at 1.
    Theorem 1, Section 6.3 (Basic 4); Theorem 4, Section 6.4. Lesson: optimisation problems
  6. The nearest distance and the helicopter's position

    The nearest distance is f(1)=5\sqrt{f(1)} = \sqrt5 units, when the helicopter is at (1,12+7)=(1,8)(1, 1^2 + 7) = (1, 8)⁠.

    −1 0 1 2 3 4 7 8 9 10 x y soldier (3, 7) (1, 8) √5 y = x² + 7
    Equal scales; the vertical axis starts at 6. The dashed circle of radius 5\sqrt5 about the soldier touches the path only at (1,8)(1, 8)⁠, and the shortest segment is perpendicular to the path there.
    Geometric check: the slope of the path at x=1x = 1 is dydx=2x=2\frac{dy}{dx} = 2x = 2⁠, and the slope of the segment from (3,7)(3, 7) to (1,8)(1, 8) is 8−71−3=−12\frac{8 - 7}{1 - 3} = -\frac12⁠. Since 2×(−12)=−12 \times \left(-\frac12\right) = -1⁠, the shortest segment meets the path at a right angle, as a shortest distance to a smooth curve must.
    Perpendicular lines have slopes with product −1-1⁠.
Result

The nearest distance between the soldier and the helicopter is 5\sqrt5 units (about 2.236), when the helicopter is at (1,8)(1, 8)⁠. This agrees with the book.

Check it with numbers
xxf(x)=(x−3)2+x4f(x) = (x-3)^2 + x^4distance f(x)\sqrt{f(x)}
093
0.95.06612.2508
152.2360680
1.15.07412.2526
2174.1231056
Common mistakes
  1. Giving 5 as the answer. 5 is the least squared distance; the distance is 5\sqrt5⁠.
  2. Stopping at "2x2+2x+32x^2 + 2x + 3 has no real roots". Also note it is always positive; that gives the sign of f′f'⁠.
  3. Forgetting to square the vertical gap. The vertical gap is x2x^2⁠, so it contributes (x2)2=x4(x^2)^2 = x^4⁠, not x2x^2⁠.
What to take away
  1. To minimise a distance, minimise its square: same point, easier algebra.
  2. On all of R\R there are no end points; a sign change of f′f' from −- to ++ at the only critical point gives the global minimum.
  3. The shortest segment from a point to a smooth curve is perpendicular to the curve.

Every fact used, and where it comes from

FactUsed inSource
Distance formulaStep 1Coordinate geometry (Basics: building the function)
 \sqrt{\ } is increasingStep 2Algebra
Factor theorem; discriminantSteps 3, 4Algebra (Basics: factorising)
Sign of f′f' gives decreasing/increasingStep 5Theorem 1, Section 6.3
Second Derivative TestStep 5Theorem 4, Section 6.4 (Lesson: tests)
Perpendicular slopes multiply to −1-1Step 6Coordinate geometry
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →