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

Example 23: Shortest distance from (0,c)(0, c) to y=x2y = x^2

ExamplesOptimisation · Section 6.4
The question

Find the shortest distance of the point (0,c)(0, c) from the parabola y=x2y = x^2⁠, where 12≤c≤5\frac{1}{2} \le c \le 5⁠.

Exam answer

Let (h,k)(h, k) be any point on the parabola. Then k=h2k = h^2⁠, k≥0k \ge 0⁠, and its distance from (0,c)(0, c) is

D=h2+(k−c)2=k+(k−c)2\begin{aligned} D &= \sqrt{h^2 + (k - c)^2} \\ &= \sqrt{k + (k - c)^2} \end{aligned} D′(k)=1+2(k−c)2k+(k−c)2D'(k) = \frac{1 + 2(k - c)}{2\sqrt{k + (k - c)^2}}

D′(k)=0⇒k=2c−12D'(k) = 0 \Rightarrow k = \frac{2c - 1}{2}⁠, and 2c−12≥0\frac{2c - 1}{2} \ge 0 as c≥12c \ge \frac12⁠.

For k<2c−12k < \frac{2c - 1}{2}⁠, D′(k)<0D'(k) < 0⁠; for k>2c−12k > \frac{2c - 1}{2}⁠, D′(k)>0D'(k) > 0⁠.

So DD is least at k=2c−12k = \frac{2c - 1}{2}⁠.

At k=2c−12k = \frac{2c - 1}{2}⁠, k−c=−12k - c = -\frac12⁠, so

D=2c−12+14=4c−12\begin{aligned} D &= \sqrt{\frac{2c - 1}{2} + \frac14} \\ &= \frac{\sqrt{4c - 1}}{2} \end{aligned}

Hence the shortest distance is 4c−12\dfrac{\sqrt{4c - 1}}{2}⁠.

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

The one idea this problem is built on

The distance from a fixed point to a moving point of a curve is a function of where the moving point is. Describe the moving point by one number, write the distance as a function of that number, and minimise it. On y=x2y = x^2 it is convenient to use the height k=h2k = h^2 of the point (h,k)(h, k)⁠, because then h2h^2 in the distance formula is simply kk⁠.

Given, to find, and the plan
Given
The parabola y=x2y = x^2 and the point (0,c)(0, c) on its axis, with 12≤c≤5\frac{1}{2} \le c \le 5⁠.
To find
The least distance between (0,c)(0, c) and a point of the parabola.
Plan
Take a general point (h,k)(h, k) of the parabola; write the distance DD as a function of k≥0k \ge 0⁠. Differentiate (chain rule), find the critical point, use the sign of D′D' on each side (first derivative test) to see that it gives the least value for all k≥0k \ge 0⁠, and evaluate.

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

2Chain rule for a square root

ddku=12u⋅dudk\frac{d}{dk}\sqrt{u} = \frac{1}{2\sqrt{u}}\cdot\frac{du}{dk}⁠, with inner function uu and outer function  \sqrt{\ }⁠. Basics: chain rule

3First derivative test (Theorem 3, Section 6.4)

If D′D' changes sign from negative to positive as kk increases through a critical point, that point is a point of local minima. Lesson: first and second derivative tests

4Decreasing then increasing (Theorem 1, Section 6.3)

D′<0D' < 0 on an interval makes DD decreasing there, D′>0D' > 0 makes it increasing. A function that decreases up to a point and increases after it takes its least value at that point. Lesson: increasing and decreasing functions

5Sign of a fraction

A fraction with a positive denominator has the sign of its numerator. Basics: sign of a product

Solution

  1. A general point of the parabola

    Let (h,k)(h, k) be any point on y=x2y = x^2⁠. Then k=h2k = h^2⁠, so k≥0k \ge 0⁠, and every k≥0k \ge 0 occurs (at h=±kh = \pm\sqrt{k}⁠).

    To minimise over "all points of the parabola" we need a single variable that runs over all of them. The height kk does that, with allowed range k≥0k \ge 0⁠. The two points (k,k)(\sqrt{k}, k) and (−k,k)(-\sqrt{k}, k) are mirror images in the yy-axis, and (0,c)(0, c) is on that axis, so both are at the same distance from it: using kk loses nothing.
    A square is never negative: k=h2≥0k = h^2 \ge 0⁠. Basics: interval notation
  2. The distance as a function of kk

    D=(h−0)2+(k−c)2=h2+(k−c)2.\begin{aligned} D &= \sqrt{(h - 0)^2 + (k - c)^2} \\ &= \sqrt{h^2 + (k - c)^2}. \end{aligned}

    Replace h2h^2 by kk⁠:

    D(k)=k+(k−c)2,k≥0.D(k) = \sqrt{k + (k - c)^2}, \qquad k \ge 0.
    This is the book's equation (1) followed by the substitution h2=kh^2 = k⁠. Now DD depends on one variable only, and calculus can be used.
    Distance formula (Basic 1) with (x1,y1)=(0,c)(x_1, y_1) = (0, c) and (x2,y2)=(h,k)(x_2, y_2) = (h, k)⁠.
  3. Differentiate by the chain rule

    Inner function u=k+(k−c)2u = k + (k-c)^2⁠, with dudk=1+2(k−c)\frac{du}{dk} = 1 + 2(k - c)⁠; outer function u\sqrt{u}⁠. So

    D′(k)=1+2(k−c)2k+(k−c)2.D'(k) = \frac{1 + 2(k - c)}{2\sqrt{k + (k - c)^2}}.

    The denominator is positive for every k≥0k \ge 0⁠: k+(k−c)2k + (k-c)^2 could be 0 only if k=0k = 0 and k=ck = c⁠, but c≥12c \ge \frac{1}{2}⁠.

    We need D′D' to find the critical points and to read off where DD falls and rises. Because the denominator is positive, the sign of D′(k)D'(k) is simply the sign of the numerator 2(k−c)+12(k - c) + 1 (Basic 5). That makes the rest easy.
    Chain rule: ddku=12u dudk\frac{d}{dk}\sqrt{u} = \frac{1}{2\sqrt{u}}\,\frac{du}{dk}⁠; and ddk(k−c)2=2(k−c)\frac{d}{dk}(k-c)^2 = 2(k-c)⁠. Basics: chain rule
  4. The critical point, and why c≥12c \ge \frac{1}{2} matters

    D′(k)=0  ⟺  2(k−c)+1=0  ⟺  k=2c−12.D'(k) = 0 \iff 2(k - c) + 1 = 0 \iff k = \frac{2c - 1}{2}.

    Call this k0=c−12k_0 = c - \frac{1}{2}⁠. Since c≥12c \ge \frac{1}{2}⁠, k0≥0k_0 \ge 0⁠: it is an allowed height.

    This is where the condition c≥12c \ge \frac{1}{2} is used. If cc were smaller than 12\frac{1}{2}⁠, k0k_0 would be negative, a height the parabola never reaches, and the method would break (Step 7 says what happens then). The upper limit c≤5c \le 5 plays no part in the working; the answer holds for every c≥12c \ge \frac{1}{2}⁠.
    Solving a linear equation: 2k−2c+1=02k - 2c + 1 = 0 gives 2k=2c−12k = 2c - 1⁠. Basics: solving equations
  5. First derivative test, and why it gives the least value

    The numerator is 2(k−c)+1=2(k−k0)2(k - c) + 1 = 2(k - k_0)⁠. So

    • for 0≤k<k00 \le k < k_0⁠: D′(k)<0D'(k) < 0⁠, and DD is decreasing;
    • for k>k0k > k_0⁠: D′(k)>0D'(k) > 0⁠, and DD is increasing.

    When k0>0k_0 > 0⁠, D′D' changes sign from negative to positive at k0k_0⁠, so by the first derivative test k0k_0 is a point of local minima. More than that: DD decreases all the way from k=0k = 0 to k0k_0 and increases for ever after, so D(k)>D(k0)D(k) > D(k_0) for every other allowed kk⁠. The least distance occurs at k=k0k = k_0⁠. (When c=12c = \frac{1}{2}⁠, k0=0k_0 = 0 is the end of the range and DD is increasing on all of k≥0k \ge 0⁠, so again the least value is at k0k_0⁠.)

    The book uses the first derivative test here and, in its Note, explains why: it is easier and shorter than computing D′′D'' for this square root. The sign pattern "−- then ++" over the whole range is what turns a local minimum into the shortest distance overall.
    Theorem 3(ii), Section 6.4, and Theorem 1, Section 6.3. Lesson: first and second derivative tests
  6. The shortest distance

    At k0=2c−12k_0 = \frac{2c-1}{2} we have k0−c=−12k_0 - c = -\frac{1}{2}⁠, so

    D(k0)=2c−12+(−12)2=4c−2+14=4c−12.\begin{aligned} D(k_0) &= \sqrt{\tfrac{2c - 1}{2} + \left(-\tfrac{1}{2}\right)^2} \\ &= \sqrt{\tfrac{4c - 2 + 1}{4}} = \frac{\sqrt{4c - 1}}{2}. \end{aligned}

    The nearest points of the parabola are (±c−12, c−12)\left(\pm\sqrt{c - \frac{1}{2}},\ c - \frac{1}{2}\right)⁠: one on each side of the axis (they coincide at the vertex when c=12c = \frac{1}{2}⁠).

    −2 −1 1 2 1 3 x y (0, c) (√1.5, 1.5) (−√1.5, 1.5) √7/2 c = 2 y = x² here c = 2
    The case c=2c = 2⁠: k0=1.5k_0 = 1.5⁠, and the circle of radius 72\frac{\sqrt 7}{2} about (0,2)(0, 2) touches y=x2y = x^2 at (±1.5,1.5)(\pm\sqrt{1.5}, 1.5) and nowhere comes closer. Equal scales on both axes.
    Putting k0−c=−12k_0 - c = -\frac{1}{2} in first keeps the arithmetic short. Writing 2c−12=4c−24\frac{2c-1}{2} = \frac{4c-2}{4} puts everything over 4, whose square root is 2.
    a4=a2\sqrt{\frac{a}{4}} = \frac{\sqrt{a}}{2} for a≥0a \ge 0⁠; here a=4c−1≥1a = 4c - 1 \ge 1⁠.
  7. A check without calculus, and the case c<12c < \frac{1}{2}

    Completing the square inside the root:

    k+(k−c)2=k2−(2c−1)k+c2=(k−k0)2+c−14.\begin{aligned} k + (k-c)^2 &= k^2 - (2c-1)k + c^2 \\ &= \left(k - k_0\right)^2 + c - \tfrac{1}{4}. \end{aligned}

    The square is least (zero) at k=k0k = k_0⁠, giving D2=c−14=4c−14D^2 = c - \frac{1}{4} = \frac{4c-1}{4}⁠, the same answer. If instead 0<c<120 < c < \frac{1}{2} (not part of this question), k0<0k_0 < 0 is not allowed, DD increases on all of k≥0k \ge 0⁠, and the shortest distance is D(0)=cD(0) = c⁠, to the vertex. At c=12c = \frac{1}{2} the two formulas agree: 12=12\frac{\sqrt{1}}{2} = \frac{1}{2}⁠.

    An independent route to the same number is the best check that the calculus is right. It also explains the restriction on cc in the question.
    k02=(c−12)2=c2−c+14k_0^2 = \left(c - \frac12\right)^2 = c^2 - c + \frac14⁠, so c2−k02=c−14c^2 - k_0^2 = c - \frac14⁠.
Result

For 12≤c≤5\frac{1}{2} \le c \le 5⁠, the shortest distance of (0,c)(0, c) from the parabola y=x2y = x^2 is

4c−12,\frac{\sqrt{4c - 1}}{2},

attained at the points (±c−12, c−12)\left(\pm\sqrt{c - \frac12},\ c - \frac12\right)⁠. This agrees with the book.

Check it with numbers

Take c=2c = 2⁠. The formula gives 72=1.3228757\frac{\sqrt 7}{2} = 1.3228757 at k=1.5k = 1.5⁠. Other points are farther: the vertex (0,0)(0, 0) is at distance 2; (1,1)(1, 1) and (2,2)(\sqrt2, 2) are both at 2=1.4142136\sqrt2 = 1.4142136⁠. For c=5c = 5 the formula gives 192=2.1794495\frac{\sqrt{19}}{2} = 2.1794495⁠, and for c=12c = \frac12 it gives 12\frac12⁠, the distance to the vertex.

Common mistakes
  1. Forgetting k≥0k \ge 0⁠. A critical point with negative kk is not a point of the parabola; that is why c≥12c \ge \frac12 is assumed.
  2. Dropping the chain rule. The derivative of u\sqrt{u} is u′2u\frac{u'}{2\sqrt u}⁠, not 12u\frac{1}{2\sqrt u}⁠.
  3. Only one nearest point. For c>12c > \frac12 there are two, mirror images in the yy-axis.
  4. Calling a local minimum the shortest distance without a reason. The sign of D′D' on the whole range gives the reason.
What to take away
  1. Distance from a point to a curve: parametrise the curve by one variable, write the distance, minimise.
  2. Minimising DD and minimising D2D^2 give the same point (the square root is increasing), and D2D^2 is often easier.
  3. Conditions in the question, like c≥12c \ge \frac12⁠, are usually there to keep the critical point inside the allowed range.

Every fact used, and where it comes from

FactUsed inSource
Distance formulaStep 2Coordinate geometry (Basics: building the function)
ddku=u′2u\frac{d}{dk}\sqrt u = \frac{u'}{2\sqrt u}Step 3Chain rule, Chapter 5 (Basics: chain rule)
First Derivative TestStep 5Theorem 3, Section 6.4 (Lesson: tests)
Sign of D′D' gives decreasing/increasingStep 5Theorem 1, Section 6.3
Why the first test is used hereStep 5Note after Example 23 (it says "Example 35", a stale reference to this example)
Completing the squareStep 7Algebra
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 →