Skip to main content

CLP-1 Differential Calculus

Section 2.11 Implicit Differentiation

Subsection 2.11.1 Implicit Differentiation

Implicit differentiation is a simple trick that is used to compute derivatives of functions either
  • when you don’t know an explicit formula for the function, but you know an equation that the function obeys or
  • even when you have an explicit, but complicated, formula for the function, and the function obeys a simple equation.
The trick is just to differentiate both sides of the equation and then solve for the derivative we are seeking. In fact we have already done this, without using the name “implicit differentiation”, when we found the derivative of \(\log x\) in the previous section. There we knew that the function \(f(x)=\log x\) satisfied the equation \(e^{f(x)}=x\) for all \(x\text{.}\) That is, the functions \(e^{f(x)}\) and \(x\) are in fact the same function and so have the same derivative. So we had
\begin{gather*} \diff{}{x}e^{f(x)} = \diff{}{x}x = 1 \end{gather*}
We then used the chain rule to get \(\diff{}{x}e^{f(x)}=e^{f(x)}f'(x)\text{,}\) which told us that \(f'(x)\) obeys the equation
\begin{align*} e^{f(x)}f'(x) &=1 & \text{and we can now solve for $f'(x)$}\\ f'(x) &= e^{-f(x)} = e^{-\log x} = \frac{1}{x}. \end{align*}
The typical way to get used to implicit differentiation is to play with problems involving tangent lines to curves. So here are a few examples finding the equations of tangent lines to curves. Recall, from Theorem 2.3.4, that, in general, the tangent line to the curve \(y=f(x)\) at \(\big(x_0,y_0\big)\) is \(y=f(x_0)+f'(x_0)(x-x_0)=y_0+f'(x_0)(x-x_0)\text{.}\)

Example 2.11.1. Finding a tangent line using implicit differentiation.

Find the equation of the tangent line to \(y=y^3+xy+x^3\) at \(x=1\text{.}\)
This is a very standard sounding example, but made a little complicated by the fact that the curve is given by a cubic equation — which means we cannot solve directly for \(y\) in terms of \(x\) or vice versa. So we really do need implicit differentiation.
  • First notice that when \(x=1\) the equation, \(y=y^3+xy+x^3\text{,}\) of the curve simplifies to \(y=y^3+y+1\) or \(y^3=-1\text{,}\) which we can solve
     1 
    This type of luck rarely happens in the “real world”. But it happens remarkably frequently in textbooks, problem sets and tests.
    : \(y=-1\text{.}\) So we know that the curve passes through \((1,-1)\) when \(x=1\text{.}\)
  • Now, to find the slope of the tangent line at \((1,-1)\text{,}\) pretend that our curve is \(y=f(x)\) so that \(f(x)\) obeys
    \begin{align*} f(x) &= f(x)^3 + x f(x) + x^3 \end{align*}
    for all \(x\text{.}\) Differentiating both sides gives
    \begin{gather*} f'(x)=3f(x)^2f'(x)+f(x)+xf'(x)+3x^2 \end{gather*}
  • At this point we could isolate for \(f'(x)\) and write it in terms of \(f(x)\) and \(x\text{,}\) but since we only want answers when \(x=1\text{,}\) let us substitute in \(x=1\) and \(f(1)=-1\) (since the curve passes through \((1,-1)\)) and clean things up before doing anything else.
  • Subbing in \(x=1,\ f(1)=-1\) gives
    \begin{align*} f'(1)&=3f'(1)-1+f'(1)+3 & \text{ and so } f'(1)=-\frac{2}{3} \end{align*}
  • The equation of the tangent line is
    \begin{gather*} y=y_0+f'(x_0)(x-x_0)=-1-\frac{2}{3}(x-1) =-\frac{2}{3}x-\frac{1}{3} \end{gather*}
We can further clean up the equation of the line to write it as \(2x+3y=-1\text{.}\)
In the previous example we replace \(y\) by \(f(x)\) in the middle of the computation. We don’t actually have to do this. When we are writing out our solution we can remember that \(y\) is a function of \(x\text{.}\) So we can start with
\begin{align*} y &=y^3+xy+x^3 & \\ \end{align*}

and differentiate remembering that \(y\equiv y(x)\)

\begin{align*} y' &= 3 y^2 y' + xy' + y + 3x^2\\ \end{align*}

And now substitute \(x=1, y=-1\) to get

\begin{align*} y'(1) &= 3 \cdot y'(1) + y'(1) - 1 + 3 & \text{and so}\\ y'(1) &= -\frac{2}{3} \end{align*}
The next one is at the same time a bit easier (because it is a quadratic) and a bit harder (because we are asked for the tangent at a general point on the curve, not a specific one).

Example 2.11.2. Another tangent line through implicit differentiation.

Let \((x_0,y_0)\) be a point on the ellipse \(3x^2+5y^2=7\text{.}\) Find the equation for the tangent lines when \(x=1\) and \(y\) is positive. Then find an equation for the tangent line to the ellipse at a general point \((x_0,y_0)\text{.}\)
Since we are not given a specific point \(x_0\) we are going to have to be careful with the second half of this question.
  • When \(x=1\) the equation simplifies to
    \begin{align*} 3 + 5y^2 &= 7\\ 5y^2 &= 4\\ y &= \pm \frac{2}{\sqrt{5}}. \end{align*}
    We are only interested in positive \(y\text{,}\) so our point on the curve is \((1,2/\sqrt{5})\text{.}\)
  • Now we use implicit differentiation to find \(\diff{y}{x}\) at this point. First we pretend that we have solved the curve explicitly, for some interval of \(x\)’s, as \(y=f(x)\text{.}\) The equation becomes
    \begin{align*} 3x^2 + 5f(x)^2 &= 7 & \text{now differentiate}\\ 6x + 10 f(x) f'(x) &= 0\\ f'(x) &= - \frac{3x}{5f(x)} \end{align*}
  • When \(x=1, y= 2/\sqrt{5}\) this becomes
    \begin{align*} f'(1) &= - \frac{3}{5 \cdot 2/\sqrt{5}} = - \frac{3}{2\sqrt{5}} \end{align*}
    So the tangent line passes through \((1,2/\sqrt{5})\) and has slope \(- \frac{3}{2\sqrt{5}}\text{.}\) Hence the tangent line has equation
    \begin{align*} y &=y_0+f'(x_0)(x-x_0)\\ &= \frac{2}{\sqrt{5}} - \frac{3}{2\sqrt{5}} (x-1)\\ &= \frac{7 - 3x}{2\sqrt{5}} & \text{or equivalently}\\ 3x + 2\sqrt{5} y&= 7 \end{align*}
Now we should go back and do the same but for a general point on the curve \((x_0,y_0)\text{:}\)
  • A good first step here is to sketch the curve. Since this is an ellipse, it is pretty straight-forward.
  • Notice that there are two points on the ellipse — the extreme right and left points \((x_0,y_0)=\pm\big(\sqrt{\frac{7}{3}},0\big)\) — at which the tangent line is vertical. In those two cases, the tangent line is just \(x=x_0\text{.}\)
  • Since this is a quadratic for \(y\text{,}\) we could solve it explicitly to get
    \begin{align*} y &= \pm \sqrt{\frac{7-3x^2}{5}} \end{align*}
    and choose the positive or negative branch as appropriate. Then we could differentiate to find the slope and put things together to get the tangent line.
    But even in this relatively easy case, it is computationally cleaner, and hence less vulnerable to mechanical errors, to use implicit differentiation. So that’s what we’ll do.
  • Now we could again “pretend” that we have solved the equation for the ellipse for \(y=f(x)\) near \((x_0,y_0)\text{,}\) but let’s not do that. Instead (as we did just before this example) just remember that when we differentiate \(y\) is really a function of \(x\text{.}\) So starting from
    \begin{align*} 3x^2 + 5y^2 &=7 &\text{differentiating gives}\\ 6x + 5\cdot 2y \cdot y' &= 0 \end{align*}
    We can then solve this for \(y'\text{:}\)
    \begin{align*} y' &= -\frac{3x}{5y} \end{align*}
    where \(y'\) and \(y\) are both functions of \(x\text{.}\)
  • Hence at the point \((x_0,y_0)\) we have
    \begin{align*} \left. y' \right|_{(x_0,y_0)} &= -\frac{3x_0}{5y_0} \end{align*}
    This is the slope of the tangent line at \((x_0,y_0)\) and so its equation is
    \begin{align*} y &=y_0+y' \cdot (x-x_0)\\ &= y_0 -\frac{3x_0}{5y_0}(x-x_0)\\ \end{align*}

    We can simplify this by multiplying through by \(5y_0\) to get

    \begin{align*} 5y_0 y &= 5y_0^2-3x_0x +3x_0^2\\ \end{align*}

    We can clean this up more by moving all the terms that contain \(x\) or \(y\) to the left-hand side and everything else to the right:

    \begin{align*} 3x_0x+5y_0y &=3x_0^2+5y_0^2\\ \end{align*}

    But there is one more thing we can do, our original equation is \(3x^2+5y^2=7\) for all points on the curve, so we know that \(3x_0^2+5y_0^2=7\text{.}\) This cleans up the right-hand side.

    \begin{align*} 3x_0x+5y_0y &=7 \end{align*}
  • In deriving this formula for the tangent line at \((x_0,y_0)\) we have assumed that \(y_0\ne 0\text{.}\) But in fact the final answer happens to also work when \(y_0=0\) (which means \(x_0=\pm\sqrt{\frac{7}{3} }\)), so that the tangent line is \(x=x_0\text{.}\)
We can also check that our answer for general \((x_0,y_0)\) reduces to our answer for \(x_0=1\text{.}\)
  • When \(x_0=1\) we worked out that \(y_0=2/\sqrt{5}\text{.}\)
  • Plugging this into our answer above gives
    \begin{align*} 3x_0x+5y_0y &=7 &\text{sub in $(x_0,y_0)=(1,2/\sqrt{5})$}:\\ 3 x + 5 \frac{2}{\sqrt{5}} y &= 7 & \text{clean up a little}\\ 3x + 2\sqrt{5} y &=7 \end{align*}
    as required.

Example 2.11.3. A more involved example.

At which points does the curve \(x^2-xy+y^2=3\) cross the \(x\)–axis? Are the tangent lines to the curve at those points parallel?
This is a 2 part question — first the \(x\)-intercepts and then we need to examine tangent lines.
  • Finding where the curve crosses the \(x\)-axis is straight forward. It does so when \(y=0\text{.}\) This means \(x\) satisfies
    \begin{align*} x^2-x\cdot 0+0^2&=3 & \text{ so $x = \pm\sqrt{3}$}. \end{align*}
    So the curve crosses the \(x\)–axis at two points \(\big(\pm\sqrt{3}\,,\,0\big)\text{.}\)
  • Now we need to find the tangent lines at those points. But we don’t actually need the lines, just their slopes. Again we can pretend that near one of those points the curve is \(y=f(x)\text{.}\) Applying \(\diff{}{x}\) to both sides of \(x^2-xf(x)+f(x)^2=3\) gives
    \begin{align*} 2x-f(x)-xf'(x)+2f(x)f'(x)&=0 \end{align*}
    etc etc.
  • But let us stop “pretending”. Just make sure we remember that \(y\) is a function of \(x\) when we differentiate:
    \begin{align*} x^2-xy+y^2 &= 3 & \text{start with the curve, and differentiate}\\ 2x - xy' -y + 2yy' &=0 & \end{align*}
    Now substitute in the first point, \(x=+\sqrt{3}, y=0\text{:}\)
    \begin{align*} 2\sqrt{3} - \sqrt{3}y' + 0 &=0\\ y' &= 2 \end{align*}
    And now do the second point \(x=-\sqrt{3}, y=0\text{:}\)
    \begin{align*} -2\sqrt{3} + \sqrt{3}y' + 0 &=0\\ y' &= 2 \end{align*}
    Thus the slope is the same at \(x=\sqrt{3}\) and \(x=-\sqrt{3}\) and the tangent lines are parallel.
Okay — let’s get away from curves and do something a little different.

Example 2.11.4. A rough game of baseball.

You are standing at the origin. At time zero a pitcher throws a ball at your head
 2 
It seems that it is not a friendly game today.
.
Figure 2.11.5.
The position of the (centre of the) ball at time \(t\) is \(x(t)=d-vt\text{,}\) where \(d\) is the distance from your head to the pitcher’s mound and \(v\) is the ball’s velocity. Your eye sees the ball filling
 3 
This is the “visual angle” or “angular size”.
an angle \(2\theta(t)\) with
\begin{gather*} \sin\big(\theta(t)\big)=\frac{r}{d-vt} \end{gather*}
where \(r\) is the radius of the baseball. The question is “How fast is \(\theta\) growing at time \(t\text{?}\)” That is, what is \(\diff{\theta}{t}\text{?}\)
  • We don’t know (yet) how to solve this equation to find \(\theta(t)\) explicitly. So we use implicit differentiation.
  • To do so we apply \(\diff{}{t}\) to both sides of our equation. This gives
    \begin{gather*} \cos\big(\theta(t)\big)\cdot\theta'(t)=\frac{rv}{(d-vt)^2} \end{gather*}
  • Then we solve for \(\theta'(t)\text{:}\)
    \begin{gather*} \theta'(t)=\frac{rv}{(d-vt)^2\cos\big(\theta(t)\big)} \end{gather*}
  • As is often the case, when using implicit differentiation, this answer is not very satisfying because it contains \(\theta(t)\text{,}\) for which we still do not have an explicit formula. However in this case we can get an explicit formula for \(\cos\big(\theta(t)\big)\text{,}\) without having an explicit formula for \(\theta(t)\text{,}\) just by looking at the right–angled triangle in Figure 2.11.5, above.
  • The hypotenuse of that triangle has length \(d-vt\text{.}\) By Pythagoras, the length of the side of the triangle adjacent of the angle \(\theta(t)\) is \(\sqrt{(d-vt)^2-r^2}\text{.}\) So
    \begin{equation*} \cos\big(\theta(t)\big)=\frac{\sqrt{(d-vt)^2-r^2}}{d-vt} \end{equation*}
    and
    \begin{gather*} \theta'(t)=\frac{rv}{(d-vt)\sqrt{(d-vt)^2-r^2}} \end{gather*}
Okay — just one more tangent-to-the-curve example and then we’ll go on to something different.

Example 2.11.6. The astroid (no that is not a typo).

Let \((x_0,y_0)\) be a point on the astroid
 4 
Here is where is the astroid comes from. Imagine two circles, one of radius \(1/4\) and one of radius \(1\text{.}\) Paint a red dot on the smaller circle. Then imagine the smaller circle rolling around the inside of the larger circle. The curve traced by the red dot is our astroid. Google “astroid” (be careful about the spelling) to find animations showing this.
 5 
The astroid was first discussed by Johann Bernoulli in 1691–92. It also appears in the work of Leibniz.
\begin{gather*} x^{\frac{2}{3}}+y^{\frac{2}{3}}=1. \end{gather*}
Find an equation for the tangent line to the astroid at \((x_0,y_0)\text{.}\)
  • As was the case in examples above we can rewrite the equation of the astroid near \((x_0,y_0)\) in the form \(y=f(x)\text{,}\) with an explicit \(f(x)\text{,}\) by solving the equation \(x^{\frac{2}{3}}+y^{\frac{2}{3}}=1\text{.}\) But again, it is computationally cleaner, and hence less vulnerable to mechanical errors, to use implicit differentiation. So that’s what we’ll do.
  • First up, since \((x_0,y_0)\) lies on the curve, it satisfies
    \begin{gather*} x_0^{\frac{2}{3}}+y_0^{\frac{2}{3}}=1. \end{gather*}
  • Now, no pretending that \(y=f(x)\text{,}\) this time — just make sure we remember when we differentiate that \(y\) changes with \(x\text{.}\)
    \begin{align*} x^{\frac{2}{3}}+y^{\frac{2}{3}} &=1\\ \end{align*}

    Start with the curve, and then differentiate

    \begin{align*} \frac{2}{3}x^{-\frac{1}{3}} + \frac{2}{3} y^{-\frac{1}{3}} y' &=0 \end{align*}
  • Note the derivative of \(x^{\frac{2}{3}}\text{,}\) namely \(\frac{2}{3}x^{-\frac{1}{3}}\text{,}\) and the derivative of \(y^{\frac{2}{3}}\text{,}\) namely \(\frac{2}{3} y^{-\frac{1}{3}}y'\text{,}\) are defined only when \(x\ne 0\) and \(y\ne 0\text{.}\) We are interested in the case that \(x=x_0\) and \(y=y_0\text{.}\) So we better assume that \(x_0\ne 0\) and \(y_0\ne 0\text{.}\) Probably something weird happens when \(x_0=0\) or \(y_0=0\text{.}\) We’ll come back to this shortly.
  • To continue on, we set \(x=x_0, y=y_0\) in the equation above, and then solve for \(y'\text{:}\)
    \begin{equation*} \frac{2}{3}x_0^{-\frac{1}{3}} +\frac{2}{3} y_0^{-\frac{1}{3}} y'(x)=0 \implies y'(x_0)= -\left( \frac{y_0}{x_0} \right)^{\frac{1}{3}} \end{equation*}
    This is the slope of the tangent line and its equation is
    \begin{equation*} y=y_0+f'(x_0)(x-x_0) = y_0 -\left(\frac{y_0}{x_0}\right)^{\frac{1}{3}}(x-x_0) \end{equation*}
Now let’s think a little bit about what the tangent line slope of \(-\root{3}\of {\frac{y_0}{x_0}}\) tells us about the astroid.
  • First, as a preliminary observation, note that since \(x_0^{\frac{2}{3}}\ge0\) and \(y_0^{\frac{2}{3}}\ge0\) the equation \(x_0^{\frac{2}{3}}+y_0^{\frac{2}{3}}=1\) of the astroid forces \(0\le x_0^{\frac{2}{3}},y_0^{\frac{2}{3}} \le 1\) and hence \(-1\le x_0,y_0\le 1\text{.}\)
  • For all \(x_0,y_0 \gt 0\) the slope \(-\root{3}\of {\frac{y_0}{x_0}} \lt 0\text{.}\) So at all points on the astroid that are in the first quadrant, the tangent line has negative slope, i.e. is “leaning backwards”.
  • As \(x_0\) tends to zero, \(y_0\) tends to \(\pm 1\) and the tangent line slope tends to infinity. So at points on the astroid near \((0,\pm 1)\text{,}\) the tangent line is almost vertical.
  • As \(y_0\) tends to zero, \(x_0\) tends to \(\pm 1\) and the tangent line slope tends to zero. So at points on the astroid near \((\pm 1,0)\text{,}\) the tangent line is almost horizontal.
Here is a figure illustrating all this.
Sure enough, as we speculated earlier, something weird does happen to the astroid when \(x_0\) or \(y_0\) is zero. The astroid is pointy, and does not have a tangent there.

Exercises 2.11.2 Exercises

Exercises — Stage 1 .

1.
If we implicitly differentiate \(x^2+y^2=1\text{,}\) we get the equation \(2x+2yy'=0\text{.}\) In the step where we differentiate \(y^2\) to obtain \(2yy'\text{,}\) which rule(s) below are we using? (a) power rule, (b) chain rule, (c) quotient rule , (d) derivatives of exponential functions
2.
Using the picture below, estimate \(\ds\diff{y}{x}\) at the three points where the curve crosses the \(y\)-axis.
Remark: for this curve, one value of \(x\) may correspond to multiple values of \(y\text{.}\) So, we cannot express this curve as \(y=f(x)\) for any function \(x\text{.}\) This is one typical situation where we might use implicit differentiation.
3.
Consider the unit circle, formed by all points \((x,y)\) that satisfy \(x^2+y^2=1\text{.}\)
  1. Is there a function \(f(x)\) so that \(y=f(x)\) completely describes the unit circle? That is, so that the points \((x,y)\) that make the equation \(y=f(x)\) true are exactly the same points that make the equation \(x^2+y^2=1\) true?
  2. Is there a function \(f'(x)\) so that \(y=f'(x)\) completely describes the slope of the unit circle? That is, so that for every point \((x,y)\) on the unit circle, the slope of the tangent line to the circle at that point is given by \(f'(x)\text{?}\)
  3. Use implicit differentiation to find an expression for \(\ds\diff{y}{x}\text{.}\) Simplify until the expression is a function in terms of \(x\) only (not \(y\)), or explain why this is impossible.

Exercises — Stage 2 .

4. (✳).
Find \(\ds\diff{y}{x}\) if \(xy + e^x + e^y = 1\text{.}\)
5. (✳).
If \(e^y=xy^2+x\text{,}\) compute \(\ds\diff{y}{x}\text{.}\)
6. (✳).
If \(x^2\tan(\pi y/4)+2x\log(y) = 16\text{,}\) then find \(y'\) at the points where \(y=1\text{.}\)
7. (✳).
If \(x^3+y^4 = \cos(x^2+y)\) compute \(\diff{y}{x}\text{.}\)
8. (✳).
If \(x^2e^y + 4x\cos(y) = 5\text{,}\) then find \(y'\) at the points where \(y=0\text{.}\)
9. (✳).
If \(x^2+y^2 = \sin(x+y)\) compute \(\diff{y}{x}\text{.}\)
10. (✳).
If \(x^2\cos(y)+2xe^y = 8\text{,}\) then find \(y'\) at the points where \(y=0\text{.}\)
11.
At what points on the ellipse \(x^2+3y^2=1\) is the tangent line parallel to the line \(y=x\text{?}\)
12. (✳).
For the curve defined by the equation \(\sqrt{xy} = x^2y-2\text{,}\) find the slope of the tangent line at the point \((1, 4)\text{.}\)
13. (✳).
If \(x^2y^2+x\sin(y)=4\text{,}\) find \(\ds\diff{y}{x}\text{.}\)

Exercises — Stage 3 .

14. (✳).
If \(x^2+(y+1)e^y = 5\text{,}\) then find \(y'\) at the points where \(y=0\text{.}\)
15.
For what values of \(x\) do the circle \(x^2+y^2=1\) and the ellipse \(x^2+3y^2=1\) have parallel tangent lines?