Nathan Wakefield, Christine Kelley, Marla Williams, Michelle Haver, Lawrence Seminario-Romero, Robert Huben, Aurora Marks, Stephanie Prahl, Based upon Active Calculus by Matthew Boelkins

Section2.7Derivatives of Functions Given Implicitly

Motivating Questions

What does it mean to say that a curve is an implicit function of \(x\text{,}\) rather than an explicit function of \(x\text{?}\)

How does implicit differentiation enable us to find a formula for \(\frac{dy}{dx}\) when \(y\) is an implicit function of \(x\text{?}\)

In the context of an implicit curve, how can we use \(\frac{dy}{dx}\) to answer important questions about the tangent line to the curve?

In all of our studies with derivatives so far, we have worked with functions whose formula is given explicitly in terms of \(x\text{.}\) But there are many interesting curves whose equations involving \(x\) and \(y\) are impossible to solve for \(y\) in terms of \(x\text{.}\)

Perhaps the simplest and most natural of all such curves are circles. Because of the circle's symmetry, for each \(x\)-value that is strictly between the endpoints of the horizontal diameter, there are two corresponding \(y\)-values. For instance, on the left side of Figure2.82 above, we have labeled \(A = (-3,\sqrt{7})\) and \(B = (-3,-\sqrt{7})\text{.}\) These points demonstrate that the circle fails the vertical line test and indicate that it is impossible to represent the circle through a single function of the form \(y = f(x)\text{.}\) However, portions of the circle, such as the highlighted arc that is magnified in the center of Figure2.82, can be represented explicitly as a function of \(x\text{.}\) Moreover, it is evident that the circle is locally linear, so we ought to be able to find a tangent line to the curve at every point. Thus, it makes sense to wonder if we can compute \(\frac{dy}{dx}\) at any point on the circle, even though we cannot write \(y\) explicitly as a function of \(x\text{.}\)

We say that the equation \(x^2 + y^2 = 16\) defines \(y\) implicitly as a function of \(x\text{.}\) The graph of the equation can be broken into pieces where each piece can be defined by an explicit function of \(x\text{.}\) For the circle, we could choose to take the top half as one function of \(x\text{,}\) namely \(y = \sqrt{16 - x^2}\text{,}\) and the bottom half as \(y = -\sqrt{16 - x^2}\text{.}\) The equation for the circle defines two implicit functions of \(x\text{.}\)

The righthand curve in Figure2.82 above is called a lemniscate and is just one of many fascinating possibilities for implicitly given curves.

The question we want to address in this section is how can we find an equation for \(\frac{dy}{dx}\) without an explicit formula for \(y\) in terms of \(x\text{?}\) The following example reminds us of some ways we can compute derivatives of functions in settings where the function's formula is not known.

Example2.83

Let \(f\) be a differentiable function of \(x\) whose formula is not known, and recall that \(\frac{d}{dx}[f(x)]\) and \(f'(x)\) are interchangeable notations. Compute the following derivatives; note that each function you must differentiate is a combination of: explicit functions of \(x\text{,}\) the unknown function \(f\text{,}\) and an arbitrary constant \(c\text{.}\)

We begin our exploration of implicit differentiation with the example of the circle described by \(x^2 + y^2 = 16\text{.}\) How can we find a formula for \(\frac{dy}{dx}\text{?}\)

By viewing \(y\) as an implicit function of \(x\text{,}\) we think of \(y\) as some function whose formula \(f(x)\) is unknown, but which we can differentiate. Just as \(y\) represents an unknown formula, so too its derivative with respect to \(x\text{,}\) \(\frac{dy}{dx}\text{,}\) will be (at least temporarily) unknown.

So we view \(y\) as an unknown differentiable function of \(x\) and differentiate both sides of the equation with respect to \(x\text{.}\)

Note carefully the different roles being played by \(x\) and \(y\text{.}\) Because \(x\) is the independent variable, \(\frac{d}{dx} \left[x^2\right] = 2x\text{.}\) But \(y\) is the dependent variable and \(y\) is an implicit function of \(x\text{.}\) Recall Example2.83, where we computed \(\frac{d}{dx}[f(x)^2]\text{.}\) Computing \(\frac{d}{dx}[y^2]\) is the same and requires the chain rule, by which we find that \(\frac{d}{dx}[y^2] = 2y^1 \frac{dy}{dx}\text{.}\) We now have that

There are several important things to observe about the result that \(\frac{dy}{dx} = -\frac{x}{y}\text{.}\) First, this expression for the derivative involves both \(x\) and \(y\text{.}\) This makes sense because there are two corresponding points on the circle for each value of \(x\) between \(-4\) and \(4\text{,}\) and the slope of the tangent line is different at each of these points.

Second, this formula is entirely consistent with our understanding of circles. The slope of the radius from the origin to the point \((a,b)\) is \(m_r = \frac{b}{a}\text{.}\) The tangent line to the circle at \((a,b)\) is perpendicular to the radius, and thus has slope \(m_t = -\frac{a}{b}\text{,}\) as shown on the right in Figure2.85. In particular, the slope of the tangent line is zero at \((0,4)\) and \((0,-4)\text{,}\) and is undefined at \((-4,0)\) and \((4,0)\text{.}\) All of these values are consistent with the formula \(\frac{dy}{dx} = -\frac{x}{y}\text{.}\)

Figure2.85The circle given by \(x^2 + y^2 = 16\) with point \((a,b)\) on the circle and the tangent line at that point, with labeled slopes \(m_r\) and \(m_t\) of the radial line and tangent line, respectively.

Example2.86

For the curve given implicitly by \(x^3 + y^2 - 2xy = 2\text{,}\) shown below in Figure2.87, find the slope of the tangent line at \((-1,1)\text{.}\)

We begin by differentiating the curve's equation implicitly. Taking the derivative of each side with respect to \(x\) yields

For the three derivatives we now must execute, the first uses the simple power rule, the second requires the chain rule (since \(y\) is an implicit function of \(x\)), and the third necessitates the product rule (again, since \(y\) is a function of \(x\)). Applying these rules, we now find that

We want to solve this equation for \(\frac{dy}{dx}\text{.}\) To do so, we first collect all of the terms involving \(\frac{dy}{dx}\) on one side of the equation.

Note that the expression for \(\frac{dy}{dx}\) depends on both \(x\) and \(y\text{.}\) To find the slope of the tangent line at \((-1,1)\text{,}\) we substitute the coordinates into the formula for \(\frac{dy}{dx}\text{,}\) using the notation

This value matches our visual estimate of the slope of the tangent line shown in Figure2.87.

Example2.86 shows that it is possible when differentiating implicitly to have multiple terms involving \(\frac{dy}{dx}\text{.}\) We use addition and subtraction to collect all terms involving \(\frac{dy}{dx}\) on one side of the equation, then factor to get a single term of \(\frac{dy}{dx}\text{.}\) Finally, we divide to solve for \(\frac{dy}{dx}\text{.}\)

to denote the evaluation of \(\frac{dy}{dx}\) at the point \((a,b)\text{.}\) This is analogous to writing \(f'(a)\) when \(f'\) depends on a single variable.

Warning2.88

There is a big difference between writing \(\frac{d}{dx}\) and \(\frac{dy}{dx}\text{.}\) For example,

gives an instruction to take the derivative with respect to \(x\) of the quantity \(x^2 + y^2\text{,}\) presumably where \(y\) is a function of \(x\text{.}\) On the other hand,

means the product of the derivative of \(y\) with respect to \(x\) with the quantity \(x^2 + y^2\text{.}\) Understanding this notational subtlety is absolutely necessary.

Example2.89

Consider the curve defined by the equation \(x = y^5 - 5y^3 + 4y\text{,}\) whose graph is pictured below in Figure2.90.

Explain why it is not possible to express \(y\) as an explicit function of \(x\text{.}\)

Use implicit differentiation to find a formula for \(\frac{dy}{dx}\text{.}\)

Use your result from part (b) to find an equation of the line tangent to the graph of \(x = y^5 - 5y^3 + 4y\) at the point \((0, 1)\text{.}\)

Use a graphing utility and your result from part (b) to estimate all of the points at which the graph of \(x = y^5 - 5y^3 + 4y\) has a vertical tangent line.

Because the graph of the curve fails the vertical line test, \(y\) cannot be a function of \(x\text{.}\) This also confirms our intuition that there is not an algebraic means by which we can rearrange the equation \(x = y^5 - 5y^3 + 4y\) to write \(y\) in terms of \(x\text{.}\)

We differentiate implicitly, taking the derivative of each side with respect to \(x\text{:}\)

To find an equation of the line tangent to the graph of \(x = y^5 - 5y^3 + 4y\) at the point \((0, 1)\text{,}\) we only need the slope of the tangent line. Hence we compute

\begin{equation*}
y - 1 = -\frac{1}{6}(x-0),
\end{equation*}

or \(y = -\frac{1}{6}x + 1\text{.}\)

Since a line is vertical whenever its slope is undefined, we seek all points \((x,y)\) that make \(\frac{dy}{dx}\) undefined. This will occur precisely when the denominator, \(5y^4 - 15y^2 + 4\text{,}\) is zero. Using a graphing utility or computer algebra system to solve the equation \(5y^4 - 15y^2 + 4 = 0\text{,}\) we find that this happens at the four approximate \(y\)-values \(y \approx \pm 0.543912, \pm 1.64443\text{.}\) For each such value, we use the original equation \(x = y^5 - 5y^3 + 4y\) to find the \(x\)-value of the point. Doing so, we have established that there are four points at which the tangent line is vertical, and they are approximately \((1.418697,0.543912)\text{,}\) \((-1.418697,-0.543912)\text{,}\) \((-3.63143, 1.64443)\text{,}\) and \((3.63143, -1.64443)\text{.}\)

It is natural to ask where the tangent line to a curve is vertical or horizontal. The slope of a horizontal tangent line must be zero, while the slope of a vertical tangent line is undefined. Often the formula for \(\frac{dy}{dx}\) is expressed as a quotient of functions of \(x\) and \(y\text{,}\) say

The tangent line is horizontal precisely when the numerator is zero and the denominator is nonzero, making the slope of the tangent line zero. If we can solve the equation \(p(x,y) = 0\) for either \(x\) and \(y\) in terms of the other, we can substitute that expression into the original equation for the curve. This gives an equation in a single variable, and if we can solve that equation we can find the point(s) on the curve where \(p(x,y) = 0\text{.}\) At those points, the tangent line is horizontal.

Similarly, the tangent line is vertical whenever \(q(x,y) = 0\) and \(p(x,y) \ne 0\text{,}\) making the slope undefined.

Example2.91

Consider the curve defined by the equation \(y(y^2-1)(y-2) = x(x-1)(x-2)\text{,}\) whose graph is pictured below in Figure2.92. Through implicit differentiation, it can be shown that

Use this fact to answer each of the following questions.

Determine the exact \(x\)-coordinates of all points \((x,y)\) at which the tangent line to the curve is horizontal. Then use the graph to determine how many points of horizontal tangency correspond to each \(x\)-coordinate you find.

Determine the exact \(y\)-coordinates of all points \((x,y)\) at which the tangent line to the curve is vertical. Then use the graph to determine how many points of horizontal tangency correspond to each \(y\)-coordinate you find.

Find the equation of the tangent line to the curve at one of the points where \(x = 1\text{.}\)

The tangent line is horizontal when \(x=\frac{3\pm\sqrt3}3\text{;}\) each of these two \(x\)-values corresponds to four points of horizontal tangency on the curve.

The tangent line is vertical when \(y = \frac{1}{2}, \frac{1 \pm \sqrt{5}}{2}\text{.}\) Each of these \(y\)-values corresponds to a single point of vertical tangency on the curve.

The four possibilities are \(y - 1 = \frac{1}{2}(x-1)\text{,}\) \(y=-\frac12(x-1)\text{,}\) \(y+1=\frac16(x-1)\text{,}\) or \(y-2=-\frac16(x-1)\text{.}\)

To find where the tangent line to the curve is horizontal, we set \(\frac{dy}{dx} = 0\text{,}\) which requires that the numerator be zero. In other words, we need to solve

Expanding and combining like terms, we find that \(3x^2 - 6x + 2 = 0\text{,}\) which occurs where

\begin{equation*}
x = \frac{6\pm\sqrt{(-6)^2-4(3)(2)}}{2(3)}=\frac{3\pm\sqrt{3}}{3}\text{.}
\end{equation*}

Since \(\frac{3+\sqrt3}3\approx 1.57735\) and \(\frac{3-\sqrt3}3\approx 0.42265\text{,}\) we see from the graph in Figure2.92 that at each such \(x\)-value, there are four corresponding \(y\)-values^{13}For instance, when \(x =\frac{3-\sqrt3}3\text{,}\) then \(y\) must satisfy the equation \(y(y^2-1)(y-2) = x(x-1)(x-2)|_{x=\frac{3-\sqrt3}3} = \frac{2\sqrt3}9
\text{.}\) Because this is a quartic (degree 4) equation in \(y\text{,}\) we can use computational technology to help us find the solutions. Doing so, we find four approximate values for \(y\text{:}\) \(y \approx -1.058, 0.229, 0.771, 2.058\text{.}\) Thus our estimates for four points at which the tangent line is horizontal are: \(\left(\frac{3-\sqrt3}3, -1.058\right)\text{,}\) \(\left(\frac{3-\sqrt3}3, 0.229\right)\text{,}\) \(\left(\frac{3-\sqrt3}3, 0.771\right)\text{,}\) and \(\left(\frac{3-\sqrt3}3, 2.058\right)\text{.}\) Similar work can be done to find the four points at which the tangent line is horizontal when \(x=\frac{3+\sqrt3}3\text{.}\) for which the tangent line will be horizontal.

The tangent line to the curve is vertical wherever \(\frac{dy}{dx}\) is undefined, which occurs precisely where

Expanding and combining like terms, we see that we need to solve the cubic equation \(4y^3 - 6y^2 - 2y + 2 = 0\text{.}\) From the graph, it appears that \(y=\frac12\) is a point at which the tangent line is vertical, and we verify this by plugging it into our cubic equation. The equation then factors as \(2(2y-1)(y^2-y-1)=0\text{,}\) with the quadratic term having roots \(y=\frac{1\pm\sqrt5}2\text{.}\) Visual inspection of the curve at \(y=\frac12\text{,}\) \(y\approx -1.236\text{,}\) and \(y\approx -0.618\) reveals that each of these \(y\)-values occurs at exactly one point of vertical tangency.^{14}We may wish to find the \(x\)-coordinate that corresponds to each such \(y\)-value. For instance, when \(y = \frac{1}{2}\text{,}\) \(x\) must satisfy \(\frac{1}{2}\big(\frac{1}{4}-1\big)\big(\frac{1}{2}-2\big) = x(x-1)(x-2)\text{,}\) or in other words, \(x^3 - 3x^2 + 2x = \frac{9}{16}\text{.}\) We can use technology to verify that there is only one such \(x\text{,}\) and \(x \approx 2.210\text{.}\) Similar work can be done to find the \(x\)-values that correspond to \(y = \frac{1 \pm \sqrt{5}}{2}\text{.}\)

There are four points on the curve where \(x = 1\text{,}\) which correspond to the \(y\)-values that satisfy \(y(y^2-1)(y-2) = 0\text{:}\) \((1,0)\text{,}\) \((1,1)\text{,}\) \((1,-1)\text{,}\) \((1,2)\text{.}\) We choose the point \((1,1)\) and evaluate \(\frac{dy}{dx}\) at this point. Doing so,

For each of the following curves, use implicit differentiation to find \(\frac{dy}{dx}\) and determine the equation of the tangent line at the given point.

Evaluating at the point \((-3,3)\text{,}\) we have \(\left. \frac{dy}{dx} \right|_{(-3,3)} = \frac{3(-3)^2-6(3)}{3(3)^2 + 6(-3)} = 1\text{.}\) Thus the tangent line has equation \(y - 3 = 1(x+3)\text{,}\) or \(y=x+6\text{.}\)

After differentiating with respect to \(x\text{,}\) we have

Evaluating the slope of the tangent line at \((0,0)\text{,}\) we have \(\left. \frac{dy}{dx} \right|_{(0,0)} = \frac{1}{2}\text{,}\) and thus the tangent line at \((0,0)\) has equation \(y = \frac{1}{2}x\text{.}\)

Differentiating both sides with respect to \(x\) yields

On the left side, we need to start with the product rule; the right side requires the chain rule because \(y\) is a function of \(x\text{.}\) Applying these rules gives us

Hence the tangent line equation is \(y-1=0.235(x-0.619)\text{.}\)

Implicit differentiation also gives us tools that we can use to find the derivative of functions that are given explicitly. The following example demonstrates the technique for one such function.

Example2.94

Find \(\frac{dy}{dx}\) when \(y=x^x\text{.}\)

We first notice that our previous rules of differentiation do not apply in this case because we have a variable in both the base and the exponent of this expression. In order to solve this problem, we will need to turn it into an equivalent implicit function. We begin by taking the natural logarithm of both sides to get

In an equation involving \(x\) and \(y\) where portions of the graph can be defined by explicit functions of \(x\text{,}\) we say that \(y\) is an implicit function of \(x\text{.}\) A good example of such a curve is the unit circle.

We use implicit differentiation to differentiate an implicitly defined function. We differentiate both sides of the equation with respect to \(x\text{,}\) treating \(y\) as a function of \(x\) by applying the chain rule. If possible, we subsequently solve for \(\frac{dy}{dx}\) using algebra.

While \(\frac{dy}{dx}\) may now involve both the variables \(x\) and \(y\text{,}\) \(\frac{dy}{dx}\) still gives the slope of the tangent line to the curve. It may be used to decide where the tangent line is horizontal \(\big(\frac{dy}{dx} = 0\big)\) or vertical \(\big(\frac{dy}{dx}\) is undefined\(\big)\text{,}\) or to find the equation of the tangent line at a particular point on the curve.

Consider the curve given by the equation \(2y^3+y^2-y^5 = x^4 - 2x^3 + x^2\text{.}\) Find all points at which the tangent line to the curve is horizontal or vertical. Be sure to use a graphing utility to plot this implicit curve and to visually check the results of algebraic reasoning that you use to determine where the tangent lines are horizontal and vertical.

For the curve given by the equation \(\sin(x+y) + \cos(x-y) = 1\text{,}\) find the equation of the tangent line to the curve at the point \(\left(\frac{\pi}{2}, \frac{\pi}{2}\right)\text{.}\)

Implicit differentiation enables us a different perspective from which to see why the rule \(\frac{d}{dx} [a^x] = a^x \ln(a)\) holds, if we assume that \(\frac{d}{dx}[\ln(x)] = \frac{1}{x}\text{.}\) This exercise leads you through the key steps to do so.

Let \(y = a^x\text{.}\) Rewrite this equation using the natural logarithm function to write \(x\) in terms of \(y\) (and the constant \(a\)).

Differentiate both sides of the equation you found in (a) with respect to \(x\text{,}\) keeping in mind that \(y\) is implicitly a function of \(x\text{.}\)

Solve the equation you found in (b) for \(\frac{dy}{dx}\text{,}\) and then use the definition of \(y\) to write \(\frac{dy}{dx}\) solely in terms of \(x\text{.}\) What have you found?