$\newcommand{\dollar}{\} \DeclareMathOperator{\erf}{erf} \DeclareMathOperator{\arctanh}{arctanh} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&}$

## Section4.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 $\displaystyle \frac{dy}{dx}$ when $y$ is an implicit function of $x\text{?}$

• In the context of an implicit curve, how can we use $\displaystyle \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{.}$ Figure4.65At left, the circle given by $x^2 + y^2 = 16\text{.}$ In the middle, the portion of the circle $x^2 + y^2 = 16$ that has been highlighted in the box at left. And at right, the lemniscate given by $x^3 - y^3 = 6xy\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 Figure4.65 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 Figure4.65, 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 $\displaystyle \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{,}$ both of which are explicit functions. So, the implicit function $x^2 + y^2 = 16$ defines two explicit functions of $x \text{.}$

The righthand curve in Figure4.65 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 $\displaystyle \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.

###### Example4.66

Let $f$ be a differentiable function of $x$ whose formula is not known, and recall that $\displaystyle \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{.}$

1. $\displaystyle \frac{d}{dx} \left[ x^2 + f(x) \right]$

2. $\displaystyle \frac{d}{dx} \left[ x^2 f(x) \right]$

3. $\displaystyle \frac{d}{dx} \left[ c + x + f(x)^2 \right]$

4. $\displaystyle \frac{d}{dx} \left[ f(x^2) \right]$

5. $\displaystyle \frac{d}{dx} \left[ xf(x) + f(cx) + cf(x) \right]$

Hint
1. Use the sum rule.

2. Use the product rule.

3. Remember that $c$ is a constant. You have a choice of which rule to use to differentiate $f(x)^2\text{.}$

4. $f(x^2)$ is a composite function.

5. Use the structure of each term in the sum to determine which rules are appropriate.

1. $2x+f'(x)\text{.}$

2. $2xf(x)+x^2f'(x)\text{.}$

3. $1+2f(x)f'(x)\text{.}$

4. $2xf'(x^2)\text{.}$

5. $f(x)+xf'(x)+cf'(cx)+cf'(x)\text{.}$

Solution
1. Applying the sum rule, we see that

\begin{equation*} \frac{d}{dx}\left[x^2+f(x)\right]=\frac{d}{dx}\left[x^2\right]+\frac{d}{dx}\left[f(x)\right]=2x+f'(x)\text{.} \end{equation*}
2. Applying the product rule, we find

\begin{equation*} \frac{d}{dx}\left[x^2f(x)\right]=\frac{d}{dx}\left[x^2\right]f(x)+x^2\frac{d}{dx}\left[f(x)\right]=2xf(x)+x^2f'(x)\text{.} \end{equation*}
3. Applying the sum rule yields

\begin{equation*} \frac{d}{dx}\left[c+x+f(x)^2\right]=\frac{d}{dx}\left[c\right]+\frac{d}{dx}\left[x\right]+\frac{d}{dx}\left[f(x)^2\right]=1+\frac{d}{dx}\left[f(x)^2\right]\text{.} \end{equation*}

Using the chain rule9Note that we could instead use the product rule. to differentiate the final term, we end up with

\begin{equation*} \frac{d}{dx}\left[c+x+f(x)^2\right]=1+2f(x)\frac{d}{dx}\left[f(x)\right]=1+2f(x)f'(x)\text{.} \end{equation*}
4. We use the chain rule and calculate

\begin{equation*} \frac{d}{dx}\left[f(x^2)\right]=f'(x^2)\frac{d}{dx}\left[x^2\right]=2xf'(x^2)\text{.} \end{equation*}

\begin{equation*} \frac{d}{dx}\left[xf(x)+f(cx)+cf(x)\right]=\frac{d}{dx}\left[xf(x)\right]+\frac{d}{dx}\left[f(cx)\right]+\frac{d}{dx}\left[cf(x)\right]\text{.} \end{equation*}

We now apply the product rule to the first term, the chain rule to the middle term, and the constant multiple rule to the final term. This gives us

\begin{align*} \frac{d}{dx}\left[xf(x)+f(cx)+cf(x)\right]=\mathstrut \amp [f(x)+xf'(x)]+[cf'(cx)]+c[f'(x)]\\ =\mathstrut \amp f(x)+xf'(x)+cf'(cx)+cf'(x)\text{.} \end{align*}

### SubsectionImplicit Differentiation

###### Example4.67

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 $\displaystyle \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{,}$ $\displaystyle \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{.}$

\begin{equation*} \frac{d}{dx} \left[ x^2 + y^2 \right] = \frac{d}{dx} \left[ 16 \right]\text{.} \end{equation*}

On the right, the derivative of the constant $16$ is $0\text{,}$ and on the left we can apply the sum rule, so it follows that

\begin{equation*} \frac{d}{dx} \left[ x^2 \right] + \frac{d}{dx} \left[ y^2 \right] = 0\text{.} \end{equation*}

Note carefully the different roles being played by $x$ and $y\text{.}$ Because $x$ is the independent variable, $\displaystyle \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 Example4.66, where we computed $\displaystyle \frac{d}{dx}[f(x)^2]\text{.}$ Computing $\displaystyle \frac{d}{dx}[y^2]$ is the same and requires the chain rule, by which we find that $\displaystyle \frac{d}{dx}[y^2] = 2y^1 \frac{dy}{dx}\text{.}$ We now have that

\begin{equation*} 2x + 2y \frac{dy}{dx} = 0\text{.} \end{equation*}

We solve this equation for $\displaystyle \frac{dy}{dx}$ by subtracting $2x$ from both sides and dividing by $2y\text{.}$

\begin{equation*} \frac{dy}{dx} = -\frac{2x}{2y} = -\frac{x}{y}\text{.} \end{equation*}

It is important to observe that 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.

###### Example4.68

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

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

\begin{equation*} \frac{d}{dx}\left[ x^3 + y^2 - 2xy \right] = \frac{d}{dx} \left[ 2 \right]\text{.} \end{equation*}

By the sum rule and the fact that the derivative of a constant is zero, we have

\begin{equation*} \frac{d}{dx}[x^3] + \frac{d}{dx}[y^2] - 2\frac{d}{dx}[xy] = 0\text{.} \end{equation*}

For the three derivatives we now must execute, the first uses the 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

\begin{equation*} 3x^2 + 2y\frac{dy}{dx} - 2[y+x\frac{dy}{dx}] = 0\text{.} \end{equation*}

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

\begin{equation*} 2y\frac{dy}{dx} - 2x \frac{dy}{dx}= 2y - 3x^2\text{.} \end{equation*}

Then we factor out $\displaystyle \frac{dy}{dx}\text{.}$

\begin{equation*} \frac{dy}{dx}(2y - 2x) = 2y - 3x^2\text{.} \end{equation*}

Finally, we divide both sides by $(2y - 2x)$ and conclude that

\begin{equation*} \frac{dy}{dx} = \frac{2y-3x^2}{2y-2x}\text{.} \end{equation*}

Note that the expression for $\displaystyle \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 $\displaystyle \frac{dy}{dx}\text{,}$ using the notation

\begin{equation*} \left. \frac{dy}{dx} \right|_{(-1,1)} = \frac{2(1)-3(-1)^2}{2(1)-2(-1)} = -\frac14\text{.} \end{equation*}

This value matches our visual estimate of the slope of the tangent line shown in Figure4.69.

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

We use the notation

\begin{equation*} \left. \frac{dy}{dx} \right|_{(a,b)} \end{equation*}

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

###### Example4.70

Consider the curve defined by the equation $x = y^5 - 5y^3 + 4y\text{,}$ whose graph is pictured below in Figure4.71.

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

2. Use implicit differentiation to find a formula for $\displaystyle \frac{dy}{dx}\text{.}$

3. 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{.}$ Hint
1. Does the graph pass the vertical line test?

2. Note, for instance, that $\displaystyle \frac{d}{dx}[y^5] = 5y^4\frac{dy}{dx}\text{.}$

3. Remember the meaning of $\displaystyle \left. \frac{dy}{dx} \right|_{(0,1)}\text{.}$

1. The graph of the curve fails the vertical line test.

2. $\displaystyle \frac{dy}{dx} = \frac{1}{5y^4 - 15y^2 + 4}\text{.}$

3. $\displaystyle y = -\frac{1}{6}x + 1\text{.}$

Solution
1. 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{.}$

2. We differentiate implicitly, taking the derivative of each side with respect to $x\text{:}$

\begin{equation*} \frac{d}{dx}[x ]= \frac{d}{dx}[y^5 - 5y^3 + 4y]\text{.} \end{equation*}

We then evaluate the derivative on the left and use the sum rule on the right to find that

\begin{equation*} 1 = \frac{d}{dx}[y^5] - \frac{d}{dx}[5y^3] + \frac{d}{dx}[4y]\text{.} \end{equation*}

Viewing $y$ as a function of $x$ and using the chain and constant multiple rules, we now have

\begin{equation*} 1 = 5y^4\frac{dy}{dx} - 15y^2\frac{dy}{dx} + 4\frac{dy}{dx}\text{.} \end{equation*}

Factoring yields

\begin{equation*} 1 = \frac{dy}{dx}\big(5y^4 - 15y^2 + 4\big)\text{,} \end{equation*}

and therefore

\begin{equation*} \frac{dy}{dx} = \frac{1}{5y^4 - 15y^2 + 4}\text{.} \end{equation*}
3. 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*} \left. \frac{dy}{dx} \right|_{(0,1)} = \frac{1}{5(1)^4 - 15(1)^2 + 4} = -\frac{1}{6}\text{.} \end{equation*}

Therefore, the equation of the tangent line is

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

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

###### Example4.72

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.

1. $x^3 - y^3 = 6xy\text{,}$ $(-3,3)$

2. $\ln(y) = x^3 - y+1\text{,}$ $(0,1)$

3. $3x e^{-xy} = y^2\text{,}$ $(0.619,1)$

Hint
1. Note that $\displaystyle \frac{d}{dx}[6xy]$ requires the product rule.

2. With $y$ being a function of $x\text{,}$ $\displaystyle \frac{d}{dx}[\ln(y)]$ requires the chain rule.

3. To calculate $\displaystyle \frac{d}{dx}[x e^{-xy}]\text{,}$ first use the product rule and temporarily defer computing $\displaystyle \frac{d}{dx}[e^{-xy}]\text{.}$

1. $\frac{dy}{dx} = \frac{3x^2-6y}{3y^2+6x} \text{,}$ and the tangent line has equation $y - 3 = 1(x+3)\text{.}$

2. $\frac{dy}{dx} = \frac{3x^2 }{\frac{1}{y} + 1}\text{,}$ and the tangent line has equation $y = 1\text{.}$

3. $\frac{dy}{dx} = \frac{3e^{-xy}-3xye^{-xy}}{2y+3x^2e^{-xy}}\text{,}$ and the tangent line is $y - 1 = 0.235(x - 0.619)\text{.}$

Solution
1. Differentiating with respect to $x\text{,}$

\begin{equation*} \frac{d}{dx}[x^3 - y^3] = \frac{d}{dx}[6xy]\text{,} \end{equation*}

so that by the chain and product rules we have

\begin{equation*} 3x^2 - 3y^2 \frac{dy}{dx} = 6y+6x\frac{dy}{dx}\text{.} \end{equation*}

Rearranging to get all terms with $\displaystyle \frac{dy}{dx}$ on the same side, it follows that

\begin{align*} 3x^2-6y = \mathstrut \amp 3y^2\frac{dy}{dx}+6x\frac{dy}{dx}\\ = \mathstrut \amp (3y^2+6x)\frac{dy}{dx}\text{.} \end{align*}

Thus we have established that

\begin{equation*} \frac{dy}{dx} = \frac{3x^2-6y}{3y^2 + 6x}\text{.} \end{equation*}

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{.}$

2. After differentiating with respect to $x\text{,}$ we have

\begin{equation*} \frac{1}{y} \cdot \frac{dy}{dx} = 3x^2 -\frac{dy}{dx}\text{.} \end{equation*}

Taking the usual steps to solve for $\displaystyle \frac{dy}{dx}\text{,}$ we find that

\begin{equation*} \frac{dy}{dx} = \frac{3x^2}{\frac{1}{y} + 1}. \end{equation*}

Evaluating the slope of the tangent line at $(0,1)\text{,}$ we have

\begin{equation*} \displaystyle \left. \frac{dy}{dx} \right|_{(0,1)} = \frac{3(0)^2}{\frac{1}{1}+1} = 0, \end{equation*}

and thus the tangent line at $(0,1)$ has equation $y = 0(x-0)+1\text{,}$ which can be simplified to $y = 1\text{.}$

3. Differentiating both sides with respect to $x$ yields

\begin{equation*} \frac{d}{dx}\left[3xe^{-xy}\right]=\frac{d}{dx}\left[y^2\right]\text{.} \end{equation*}

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

\begin{equation*} 3e^{-xy}+3x\frac{d}{dx}\left[e^{-xy}\right]=2y\frac{dy}{dx}\text{.} \end{equation*}

To continue differentiating the left side, we need the chain rule followed by the product rule:

\begin{align*} 3e^{-xy}+3x\frac{d}{dx}\left[e^{-xy}\right]=\mathstrut \amp 3e^{-xy}+3x\left(e^{-xy}\frac{d}{dx}\left[-xy\right]\right)\\ =\mathstrut \amp 3e^{-xy}+3xe^{-xy}\left(-y-x\frac{dy}{dx}\right)\\ =\mathstrut \amp 3e^{-xy}-3xye^{-xy}-3x^2e^{-xy}\frac{dy}{dx}\text{.} \end{align*}

We now have the equation

\begin{equation*} 3e^{-xy}-3xye^{-xy}-3x^2e^{-xy}\frac{dy}{dx}=2y\frac{dy}{dx}\text{.} \end{equation*}

Since we need to solve for $\displaystyle \frac{dy}{dx}\text{,}$ we combine like terms before factoring and dividing to end up with

\begin{align*} 3e^{-xy}-3xye^{-xy}=\mathstrut \amp 2y\frac{dy}{dx}+3x^2e^{-xy}\frac{dy}{dx}\\ =\mathstrut \amp \left(2y+3x^2e^{-xy}\right)\frac{dy}{dx}\\ \mathstrut \amp \\ \frac{3e^{-xy}-3xye^{-xy}}{2y+3x^2e^{-xy}}=\mathstrut \amp\frac{dy}{dx}\text{.} \end{align*}

Evaluating at the point $(0.619,1)\text{,}$ we find the slope of the tangent line to be

\begin{equation*} \left.\frac{dy}{dx}\right|_{(0.619,1)}=\frac{3e^{-0.619}-3(0.619)e^{-0.619}}{2+3(0.619)^2e^{-0.619}}\approx0.235\text{.} \end{equation*}

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

### SubsectionSummary

• 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 $\displaystyle \frac{dy}{dx}$ using algebra.

• While $\displaystyle \frac{dy}{dx}$ may now involve both the variables $x$ and $y\text{,}$ $\displaystyle \frac{dy}{dx}$ still gives the slope of the tangent line to the curve.