# Difference between revisions of "Implicit Differentiation"

## Background

So far, you may only have differentiated functions written in the form ${\displaystyle y=f(x)}$. But some functions are better described by an equation involving ${\displaystyle x}$ and ${\displaystyle y}$. For example, ${\displaystyle x^{2}+y^{2}=16}$ describes the graph of a circle with center ${\displaystyle \left(0,0\right)}$ and radius 4, and is really the graph of two functions ${\displaystyle y=\pm {\sqrt {16-x^{2}}}}$, the upper and lower semicircles:

Sometimes, functions described by equations in ${\displaystyle x}$ and ${\displaystyle y}$ are too hard to solve for ${\displaystyle y}$, for example ${\displaystyle x^{3}+y^{3}=6xy}$. This equation really describes 3 different functions of x, whose graph is the curve:

We want to find derivatives of these functions without having to solve for ${\displaystyle y}$ explicitly. We do this by implicit differentiation. The process is to take the derivative of both sides of the given equation with respect to ${\displaystyle x}$, and then do some algebra steps to solve for ${\displaystyle y'}$ (or ${\displaystyle {\dfrac {dy}{dx}}}$ if you prefer), keeping in mind that ${\displaystyle y}$ is a function of ${\displaystyle x}$ throughout the equation.

## Warm-up exercises

Given that ${\displaystyle y}$ is a function of ${\displaystyle x}$, find the derivative of the following functions with respect to ${\displaystyle x}$.

1)   ${\displaystyle y^{2}}$

Solution:
${\displaystyle 2yy'}$
Reason:
Think ${\displaystyle y=f(x)}$, and view it as ${\displaystyle (f(x))^{2}}$ to see that the derivative is ${\displaystyle 2f(x)\cdot f'(x)}$ by the chain rule, but write it as ${\displaystyle 2yy'}$.

2)   ${\displaystyle xy}$

Solution:
${\displaystyle xy'+y}$
Reason:
${\displaystyle x}$ and ${\displaystyle y}$ are both functions of ${\displaystyle x}$ which are being multiplied together, so the product rule says it's ${\displaystyle x\cdot y'+y\cdot 1}$.

3)   ${\displaystyle \cos y}$

Solution:
${\displaystyle -y'\sin y}$
Reason:
The function ${\displaystyle y}$ is inside of the cosine function, so the chain rule gives ${\displaystyle (-\sin y)\cdot y'=-y'\sin y}$.

4)   ${\displaystyle {\sqrt {x+y}}}$

Solution:
${\displaystyle {\frac {1+y'}{2{\sqrt {x+y}}}}}$
Reason:
Write it as ${\displaystyle (x+y)^{\frac {1}{2}}}$, and use the chain rule to get   ${\displaystyle {\frac {1}{2}}\left(x+y\right)^{-{\frac {1}{2}}}\cdot \left(1+y'\right)}$, then simplify.

## Exercise 1: Compute y'

Find ${\displaystyle y'}$ if ${\displaystyle \sin y-3x^{2}y=8}$.

Note the ${\displaystyle \sin y}$ term requires the chain rule, the ${\displaystyle 3x^{2}y}$  term needs the product rule, and the derivative of 8 is 0.

We get

${\displaystyle {\begin{array}{rcl}\sin y-3x^{2}y&=&8\\\left(\cos y\right)y'-\left(3x^{2}y'+6xy\right)&=&0\quad ({\text{derivative of both sides with respect to }}x)\\\left(\cos y\right)y'-3x^{2}y'&=&6xy\\\left(\cos y-3x^{2}\right)y'&=&6xy\\y'&=&{\dfrac {6xy}{\cos y-3x^{2}}}.\end{array}}}$

## Exercise 2: Find equation of tangent line

Find the equation of the tangent line to ${\displaystyle x^{2}+2xy-y^{2}+x=2}$  at the point ${\displaystyle \left(1,0\right)}$.

We first compute ${\displaystyle y'}$ by implicit differentiation.

${\displaystyle {\begin{array}{rcl}x^{2}+2xy-y^{2}+x&=&2\\2x+2xy'+2y-2yy'+1&=&0\\x+xy'+y-yy'+{\frac {1}{2}}&=&0\\xy'-yy'&=&-x-y-{\frac {1}{2}}\\(x-y)y'&=&-(x+y+{\frac {1}{2}})\\y'&=&-{\dfrac {x+y+{\frac {1}{2}}}{x-y}}\end{array}}}$

At the point ${\displaystyle \left(1,0\right)}$, we have ${\displaystyle x=1}$ and ${\displaystyle y=0}$. Plugging these into our equation for ${\displaystyle y'}$ gives

${\displaystyle {\begin{array}{rcl}y'&=&-{\dfrac {1+0+{\frac {1}{2}}}{1-0}}=-{\frac {3}{2}}.\\\end{array}}}$

This means the slope of the tangent line at ${\displaystyle \left(1,0\right)}$ is ${\displaystyle m=-{\frac {3}{2}}}$, and a point on this line is ${\displaystyle \left(1,0\right)}$. Using the point-slope form of a line, we get

${\displaystyle {\begin{array}{rcl}y-0&=&-{\frac {3}{2}}\left(x-1\right)\\\\y&=&-{\frac {3}{2}}x+{\frac {3}{2}}.\\\end{array}}}$

Here's a picture of the curve and tangent line:

## Exercise 3: Compute y"

Find ${\displaystyle y''}$ if ${\displaystyle ye^{y}=x}$.

Use implicit differentiation to find ${\displaystyle y'}$ first:

${\displaystyle {\begin{array}{rcl}ye^{y}&=&x\\ye^{y}y'+y'e^{y}&=&1\\y'\left(ye^{y}+e^{y}\right)&=&1\\y'&=&{\dfrac {1}{ye^{y}+e^{y}}}\\&=&\left(ye^{y}+e^{y}\right)^{-1}\end{array}}}$

Now ${\displaystyle y''}$ is just the derivative of ${\displaystyle \left(ye^{y}+e^{y}\right)^{-1}}$ with respect to ${\displaystyle x}$. This will require the chain rule. Notice we already found the derivative of ${\displaystyle ye^{y}}$ to be ${\displaystyle ye^{y}y'+y'e^{y}}$.

So

${\displaystyle {\begin{array}{rcl}y''&=&-1\left(ye^{y}+e^{y}\right)^{-2}\left(ye^{y}y'+y'e^{y}+e^{y}y'\right)\\\\&=&{\dfrac {-1}{\left(ye^{y}+e^{y}\right)^{2}}}\left(ye^{y}y'+2y'e^{y}\right)\\\\&=&-{\dfrac {y'e^{y}\left(y+2\right)}{\left(e^{y}\right)^{2}\left(y+1\right)^{2}}}\\\\&=&-{\dfrac {y'\left(y+2\right)}{e^{y}\left(y+1\right)^{2}}}\quad ({\text{since }}e^{y}\neq 0).\end{array}}}$

But we mustn't leave ${\displaystyle y'}$ in our final answer. So, plug ${\displaystyle y'={\dfrac {1}{e^{y}\left(y+1\right)}}}$ back in to get

${\displaystyle {\begin{array}{rcl}y''&=&-{\dfrac {{\frac {1}{e^{y}\left(y+1\right)}}\left(y+2\right)}{e^{y}\left(y+1\right)^{2}}}\\\\&=&-{\dfrac {y+2}{\left(e^{y}\right)^{2}\left(y+1\right)^{3}}}\end{array}}}$