Calculus/Implicit Differentiation

Generally, you will encounter functions expressed in explicit form, that is, in the form $$y=f(x)$$. To find the derivative of $$y$$ with respect to $$x$$, you take the derivative with respect to $$x$$ of both sides of the equation to get
 * $$\frac{dy}{dx}=\frac{d}{dx}[f(x)]=f'(x)$$

But suppose you have a relation of the form $$f\bigl(x,y(x)\bigr)=g\bigl(x,y(x)\bigr)$$. In this case, it may be inconvenient or even impossible to solve for $$y$$ as a function of $$x$$. A good example is the relation $$y^2+2yx+3=5x$$. In this case you can utilize implicit differentiation to find the derivative. To do so, one takes the derivative of both sides of the equation with respect to $$x$$ and solves for $$y'$$. That is, form
 * $$\frac{d}{dx}\bigl[f\bigl(x,y(x)\bigr)\bigr]=\frac{d}{dx}\big[g\bigl(x,y(x)\bigr)\big]$$

and solve for $$\frac{dy}{dx}$$. You need to employ the chain rule whenever you take the derivative of a variable with respect to a different variable. For example,
 * $$\frac{d}{dx}(y^3)=\frac{d}{dy}[y^3]\cdot\frac{dy}{dx}=3y^2\cdot y'$$

Implicit Differentiation and the Chain Rule
To understand how implicit differentiation works and use it effectively it is important to recognize that the key idea is simply the chain rule. First let's recall the chain rule. Suppose we are given two differentiable functions $$f(x),g(x)$$ and that we are interested in computing the derivative of the function $$f\bigl(g(x)\bigr)$$, the chain rule states that:
 * $$\frac{d}{dx}\bigl[f\bigl(g(x)\bigr)\bigr]=f'\bigl(g(x)\bigr)\cdot g'(x)$$

That is, we take the derivative of $$f$$ as normal and then plug in $$g$$, finally multiply the result by the derivative of $$g$$.

Now suppose we want to differentiate a term like $$y^2$$ with respect to $$x$$ where we are thinking of $$y$$ as a function of $$x$$, so for the remainder of this calculation let's write it as $$y(x)$$ instead of just $$y$$. The term $$y^2$$ is just the composition of $$f(x)=x^2$$ and $$y(x)$$. That is, $$f\bigl(y(x)\bigr)=y(x)^2$$. Recalling that $$f'(x)=2x$$ then the chain rule states that:
 * $$\frac{d}{dx}\bigl[f\bigl(y(x)\bigr)\bigr]=f'\bigl(y(x)\bigr)\cdot y'(x)=2y(x)y'(x)$$

Of course it is customary to think of $$y$$ as being a function of $$x$$ without always writing $$y(x)$$, so this calculation usually is just written as
 * $$\frac{d}{dx}(y^2)=2yy'$$

Don't be confused by the fact that we don't yet know what $$y'$$ is, it is some function and often if we are differentiating two quantities that are equal it becomes possible to explicitly solve for $$y'$$ (as we will see in the examples below.) This makes it a very powerful technique for taking derivatives.

Explicit Differentiation
For example, suppose we are interested in the derivative of $$y$$ with respect to $$x$$, where $$x,y$$ are related by the equation
 * $$x^2+y^2=1$$

This equation represents a circle of radius 1 centered on the origin. Note that $$y$$ is not a function of $$x$$ since it fails the vertical line test ($$y=\pm1$$ when $$x=0$$, for example).

To find $$y'$$, first we can separate variables to get
 * $$y^2=1-x^2$$

Taking the square root of both sides we get two separate functions for $$y$$ :
 * $$y=\pm\sqrt{1-x^2}$$

We can rewrite this as a fractional power:
 * $$y=\pm(1-x^2)^{\frac{1}{2}}$$

Using the chain rule we get,
 * $$y'=\pm\frac{(1-x^2)^{-\frac{1}{2}}\cdot(-2x)}{2}=\mp\frac{x}{\sqrt{1-x^2}}$$

And simplifying by substituting $$y$$ back into this equation gives
 * $$y'=-\frac{x}{y}$$

Implicit Differentiation
Using the same equation
 * $$x^2+y^2=1$$

First, differentiate with respect to $$x$$ on both sides of the equation:
 * $$\frac{d}{dx}[x^2+y^2]=\frac{d}{dx}[1]$$
 * $$\frac{d}{dx}[x^2]+\frac{d}{dx}[y^2]=0$$

To differentiate the second term on the left hand side of the equation (call it $$f(y(x))=y^2$$), use the chain rule:
 * $$\frac{df}{dx}=\frac{df}{dy}\cdot\frac{dy}{dx}=2y\cdot y'$$

So the equation becomes


 * $$2x+2yy'=0$$

Separate the variables:
 * $$2yy'=-2x$$

Divide both sides by $$2y$$, and simplify to get the same result as above:
 * $$y'=-\frac{2x}{2y}$$
 * $$y'=-\frac{x}{y}$$

Uses
Implicit differentiation is useful when differentiating an equation that cannot be explicitly differentiated because it is impossible to isolate variables.

For example, consider the equation,
 * $$x^2+xy+y^2=16$$

Differentiate both sides of the equation (remember to use the product rule on the term $$xy$$):
 * $$2x+y+xy'+2yy'=0$$

Isolate terms with $$y'$$:
 * $$xy'+2yy'=-2x-y$$

Factor out a $$y'$$ and divide both sides by the other term:
 * $$y'=\frac{-2x-y}{x+2y}$$

Example

 * $$xy=1$$

can be solved as:
 * $$y=\frac{1}{x}$$

then differentiated:
 * $$\frac{dy}{dx}=-\frac{1}{x^2}$$

However, using implicit differentiation it can also be differentiated like this:
 * $$\frac{d}{dx}[xy]=\frac{d}{dx}[1]$$

use the product rule:
 * $$x\frac{dy}{dx}+y=0$$

solve for $$\frac{dy}{dx}$$:
 * $$\frac{dy}{dx}=-\frac{y}{x}$$

Note that, if we substitute $$y=\frac{1}{x}$$ into $$\frac{dy}{dx}=-\frac{y}{x}$$, we end up with $$\frac{dy}{dx}=-\frac{1}{x^2}$$ again.

Application: inverse trigonometric functions
Arcsine, arccosine, arctangent. These are the functions that allow you to determine the angle given the sine, cosine, or tangent of that angle.

First, let us start with the arcsine such that:


 * $$y=\arcsin(x)$$

To find $$\frac{\mathrm{d}y}{\mathrm{d}x}$$ we first need to break this down into a form we can work with:


 * $$x=\sin(y)$$

Then we can take the derivative of that:


 * $$1=\cos(y)\cdot\frac{\mathrm{d}y}{\mathrm{d}x}$$

...and solve for $$\frac{\mathrm{d}y}{\mathrm{d}x}$$ :
 * $$\frac{\mathrm{d}y}{\mathrm{d}x}=\frac{1}{\cos(y)}$$

At this point we need to go back to the unit triangle. Since $$y$$ is the angle and the opposite side is $$\sin(y)=x$$, the adjacent side is $$\cos(y)=\sqrt{1-x^2}$$ , and the hypotenuse is 1. Since we have determined the value of $$\cos(y)$$ based on the unit triangle, we can substitute it back in to the above equation and get:

We can use an identical procedure for the arccosine and arctangent: