Implicit Differentiation

Knowing the chain rule, we're now armed with a powerful tool for performing some very clever algebraic techniques. One such technique is implicit differentiation. With implicit differentiation, we can compute derivatives that we've never seen before. For example, we know from the power rule that:

ddxxa=axa1 \dfrac{d}{dx} x^a = a x^{a - 1}

However, we've only applied this rule where a{a} is some explicit number. For example, x2,{x^2,} x3,{x^3,} x4,{x^{-4},} etc. But what if the function we're dealing with is something of the form:

f(x)=xm/n, (m,nZ) f(x) = x^{m/n}, \space (m, n \in \uint)

In other words, what happens when we have rational exponents? Algebraically, we know that where m=1,{m = 1,} the expression xm/n{x^{m/n}} yields the nth{n^{\text{\scriptsize{th}}}} root:

x1/n=xn x^{1/n} = \sqrt[n]{x}

And more generally:

xm/n=xmn x^{m/n} = \sqrt[n]{x^m}

Recognizing these relationships, suppose we had the function y=xm/n.{y = x^{m/n}.} We can rewrite the function as:

yn=xm y^n = x^m

Now, we can apply differentiation to the equation above:

ddxyn=xm \dfrac{d}{dx} y^n = x^m

We performed the manipulation because we simply don't know how to differentiate xm/n.{x^{m/n}.} Applying the derivative to both sides:

ddxyn=ddxxm \dfrac{d}{dx} y^n = \dfrac{d}{dx} x^m

In the equation above, y{y} is a function of x{x} — we have to apply the chain rule:

(ddyyn)dydx=mxm1 \left(\dfrac{d}{dy}y^n\right) \dfrac{dy}{dx} = mx^{m-1}

Writing the expression this way, we know that ddyyn=nyn1.{\dfrac{d}{dy}y^n = ny^{n-1}.} Hence:

nyn1dydx=mxm1 ny^{n - 1} \dfrac{dy}{dx} = mx^{m-1}

Solving for dydx:{\dfrac{dy}{dx}:}

dydx=mxm1nyn1=mnxm1(xm/n)n1=mnxm1mn(n1)=mnxm1m+mn=mnx1+mn \begin{aligned} \dfrac{dy}{dx} &= \dfrac{mx^{m-1}}{ny^{n-1}} \\[1em] &= \dfrac{m}{n} \dfrac{x^{m-1}}{(x^{m/n})^{n-1}} \\[1em] &= \dfrac{m}{n} x^{m - 1 - \frac{m}{n}(n-1)} \\[1em] &= \dfrac{m}{n} x^{m - 1 - m + \frac{m}{n}} \\[1em] &= \dfrac{m}{n} x^{-1 + \frac{m}{n}} \\[1em] \end{aligned}

We can clean the final result above by suppose that a=mn:{a = \dfrac{m}{n}:}

dydx=axa1 \dfrac{dy}{dx} = a x^{a - 1}

Let's consider another example: x2+y2=1.{x^2 + y^2 = 1.} As we know, this is the equation for a circle. Solving for y,{y,} we obtain the following:

y2=1x2y=±1x2 \begin{aligned} y^2 = 1 - x^2 y = \pm \sqrt{1 - x^2} \end{aligned}

We say that x2+y2=1{x^2 + y^2 = 1} is the implicit definition for the function, and y=±1x2{y = \pm \sqrt{1-x^2}} is the explicit definition. Of note, the relation x2+y2=1{x^2 + y^2 = 1} is not a function. It's more accurately described as a multifunction, but the notion of implicit and explicit definitions remains equally applicable. The circle multifunction consists of two branches, a positive and a negative branch (i.e., the top half and the bottom half of the circle). For the purposes of simplicity, we'll only consider the positive branch, y=1x2.{y = \sqrt{1-x^2}.}

In terms of differentiation, function definitions containing radicands are unsightly. Often, the first step to differentiating such functions is to rewrite the definition in terms of rational number exponents:

y=1x2=(1x2)12 \begin{aligned} y &= \sqrt{1 - x^2} \\[1em] &= (1 - x^2)^{\frac{1}{2}} \end{aligned}

Writing the definition in terms of fractional exponents, we clearly see an opportunity to apply the chain rule.

y=12(1x2)12(2x)=(2x)(1x2)122=x(1x2)12=x1x2 \begin{aligned} y' &= \dfrac{1}{2}(1 - x^2)^{- \frac{1}{2}}(-2x) \\[1em] &= \dfrac{(-2x)(1-x^2)^{- \frac{1}{2}}}{2} \\[1em] &= - \dfrac{x}{(1 - x^2)^{\frac{1}{2}}} \\[1em] &= - \dfrac{x}{\sqrt{1 - x^2}} \\[1em] \end{aligned}

The evaluation above yields an explicit solution to computing the derivative. We can, however, take an implicit approach, yielding an implicit solution:

ddx(x2+y2=1)=(2x+2yy=0) \dfrac{d}{dx} (x^2 + y^2 = 1) = (2x + 2yy' = 0)

Solving for y{y'}:

y=2x2y=xy   (y=1x2) y' = \dfrac{-2x}{2y} = - \dfrac{x}{y} \space \space \space (y = \sqrt{1 - x^2})

When substitute for y{y}:

y=2x2y=x1x2 y' = \dfrac{-2x}{2y} = - \dfrac{x}{\sqrt{1-x^2}}

Consider the mechanics of this approach. We left the original equation, x2+y2=1,{x^2 + y^2 = 1,} intact. Then, we applied the derivative, arriving at an implicit solution. If we wanted the explicit solution, we substituted for y.{y.} Moreover, the implicit solution can be easily modified to yield both halves of the circle:

y=2x2y=xy   (y=±1x2) y' = \dfrac{-2x}{2y} = - \dfrac{x}{y} \space \space \space (y = \pm \sqrt{1 - x^2})

This analysis evidences the fact that the implicit approach is often much easier than the explicit approach. Let's consider another example:

y4+xy22=0 y^4 + xy^2 - 2 = 0

Like the previous example, we can compute the derivative for this equation with the explicit approach:

y2=x±x24(2)2 y^2 = \dfrac{-x \pm \sqrt{x^2 - 4(-2)}}{2}

Accordingly, isolating y:{y:}

y=±x±x2+82 y = \pm \sqrt{\dfrac{-x \pm \sqrt{x^2 + 8}}{2}}

As we can see, this is a very messy quartic equation. We've got a nasty equation with not just two cases, but four. The implicit method is much, much easier. We differentiate by keeping the original equation intact. The first term:

ddxy4=4y3y \dfrac{d}{dx} y^4 = 4y^3y'

Then we differentiate the second term (applying the product rule):

ddxxy2=y2+x(2yy) \dfrac{d}{dx}xy^2 = y^2 + x(2yy')

Then we differentiate the third term:

ddx(2)=0 \dfrac{d}{dx} (-2) = 0

This process yields:

4y3y+y2+x(2yy)0=0 4y^3y' + y^2 + x(2yy') - 0 = 0

Now all we have to do is solve for y:{y':}

4y3y+y2+x(2yy)0=04y3(y)+y2+2xy(y)=04y3(y)+2xy(y)=y2(y)(4y3+2xy)=y2y=y24y3+2xy \begin{aligned} 4y^3y' + y^2 + x(2yy') - 0 &= 0 \\ 4y^3(y') + y^2 + 2xy(y') &= 0 \\ 4y^3(y') + 2xy(y') &= -y^2 \\ (y')(4y^3 + 2xy) &= -y^2 \\ y' &= -\dfrac{y^2}{4y^3 + 2xy} \\ \end{aligned}

Now, this is just an implicit solution. The explicit solution requires substituting for y,{y,} as we did earlier:

dydx=y=(±x±x2+82)24(±x±x2+82)3+2x(±x±x2+82) \dfrac{dy}{dx} = y' = -\dfrac{\left(\pm \sqrt{\dfrac{-x \pm \sqrt{x^2 + 8}}{2}}\right)^2}{4\left(\pm \sqrt{\dfrac{-x \pm \sqrt{x^2 + 8}}{2}}\right)^3 + 2x\left(\pm \sqrt{\dfrac{-x \pm \sqrt{x^2 + 8}}{2}}\right)}

We leave it to the reader to try the explicit method. While the implicit approach is often faster, there are limitations. For starters, it doesn't avoid the complexity of quartic equation like the one above. For example, with the original equation, y4+xy22=0,{y^4 + xy^2 - 2 = 0,} we know that one solution is the coordinate (1,1).{(1,1).} Thus, the point (1,1){(1,1)} likes on the graph of y4+xy22=0.{y^4 + xy^2 - 2 = 0.} If we plug in this point to the derivative above:

dydx=(±x±x2+82)24(±x±x2+82)3+2x(±x±x2+82)=(±(1)±(1)2+82)24(±(1)±(1)2+82)3+2(1)(±(1)±(1)2+82)=(1)24(1)3+2(1)(1)=16 \begin{aligned} \dfrac{dy}{dx} &= -\dfrac{\left(\pm \sqrt{\dfrac{-x \pm \sqrt{x^2 + 8}}{2}}\right)^2}{4\left(\pm \sqrt{\dfrac{-x \pm \sqrt{x^2 + 8}}{2}}\right)^3 + 2x\left(\pm \sqrt{\dfrac{-x \pm \sqrt{x^2 + 8}}{2}}\right)} \\[2em] &= -\dfrac{\left(\pm \sqrt{\dfrac{-(1) \pm \sqrt{(1)^2 + 8}}{2}}\right)^2}{4\left(\pm \sqrt{\dfrac{-(1) \pm \sqrt{(1)^2 + 8}}{2}}\right)^3 + 2(1)\left(\pm \sqrt{\dfrac{-(1) \pm \sqrt{(1)^2 + 8}}{2}}\right)} \\[2em] &= -\dfrac{(1)^2}{4(1)^3 + 2(1)(1)} \\[2em] &= -\dfrac{1}{6} \end{aligned}

Thus, the slope at the point (1,1){(1,1)} on the graph of y4+xy22=0{y^4 + xy^2 - 2 = 0} is 16.{- \frac{1}{6}.} For the point x=2,{x = 2,} however, we have no choice but to tackle the complexity head on — we must go through all of the tedious manipulation.

Differentiating Inverse Functions

Suppose we have the function y=x.{y = \sqrt{x}.} We can rewrite this function as y2=x.{y^2 = x.} Alternatively, we could write f(x)=x,{f(x) = \sqrt{x},} which in turn can be written as g(y)=xg(y)=y2{g(y) = x \ni g(y) = y^2} (the notation {\ni} means “such that”). More generally:

Notation. Suppose y:xf(x){y: x \to f(x)} is a function, written as y=f(x).{y = f(x).} The function g:yx,{g: y \to x,} written as g(y)=x,{g(y) = x,} is called the inverse function of y.{y.}

In other words, if we have a function y=f(x),{y = f(x),} we can rewrite it as g(y)=x.{g(y) = x.} The function g(y)=x,{g(y) = x,} which is really g(f(x))=x,{g(f(x)) = x,} is called the inverse function of y=f(x).{y = f(x).} The inverse function of y=f(x),{y = f(x),} which is g(y)=x,{g(y) = x,} is usually written with the notation g=f1.{g = f^{-1}.} Similarly, the inverse of g(y)=x,{g(y) = x,} which is y=f(x),{y = f(x),} is usually written as f=g1.{f = g^{-1}.}

Given our definition above, we can see that f(x)=x{f(x) = \sqrt{x}} has the inverse function f1(x)=x2.{f^{-1}(x) = x^2.} Comparing these two graphs:

The graph of ${y = \sqrt{x}}$ to the left, and the graph of ${x = y^2}$ to the right.

The graphs above evidence the fact that the inverse functions are really just switching the x{x} and y{y} values. We can see this more clearly when we plot both functions on the same plane:

Notice how the roles of ${x}$ and ${y}$ are switched. Original: ${x}$ is the input, ${y}$ is the output. Inverse: ${y}$ is the input, ${x}$ is the output.

So what does this have to do with implicit differentiation? Well, as long as we know the derivative of some function f,{f,} we can find the derivative of the inverse function f1.{f^{-1}.} In other words, we can find the derivative of any inverse function f1{f^{-1}} provided we know the derivative of f.{f.}

This may not seem like much of an insight given the examples we've seen earlier, but it proves to be immeasurably useful when we confront some fairly complex functions. For example, consider the function y=arctanx.{y = \arctan x.} This is the function y=tan1x,{y = \tan^{-1} x,} which is the inverse of x=tany.{x = \tan y.} Plotting both these graphs together, we have:

Inverse functions tan and arctan

A more focused view reveals:

Focusing

First, let's consider the derivative of tany.{\tan y.} From trigonometry, we know that tany=sinycosy.{\tan y = \dfrac{\sin y}{\cos y}.} Accordingly, the derivative of tany{\tan y} is computed by applying the quotient rule:

ddytany=(siny)(cosy)(siny)(cosy)(cosy)2=(cosy)(cosy)(siny)(siny)(cosy)2=cos2y+sin2ycos2y=1cos2y=sec2y \begin{aligned} \dfrac{d}{dy} \tan y &= \dfrac{(\sin y)'(\cos y) - (\sin y)(\cos y)'}{(\cos y)^2} \\[2em] &= \dfrac{(\cos y)(\cos y) - (\sin y)(-\sin y)}{(\cos y)^2} \\[2em] &= \dfrac{\cos^2 y + \sin^2 y}{\cos^2 y} \\[2em] &= \dfrac{1}{\cos^2 y} \\[2em] &= \sec^2 y \end{aligned}

Thus, ddytany=sec2y.{\dfrac{d}{dy} \tan y = \sec^2 y.} Now we differentiate:

ddy(tany=x)=(ddytany)(dydx)=1=1cos2yy=1 \begin{aligned} \dfrac{d}{dy}(\tan y = x) &= \left(\dfrac{d}{dy} \tan y\right)\left(\dfrac{dy}{dx}\right) = 1 \\[2em] &= \dfrac{1}{\cos^2 y} \cdot y' = 1 \end{aligned}

Solving for y,{y',} we have:

y=cos2y y' = \cos^2 y

Substituting for y,{y,} we have:

ddxarctanx=y=cos2(arctanx) \dfrac{d}{dx} \arctan x = y' = \cos^2 (\arctan x)

The derivative above is correct, but it is very complicated. Whenever we work with trigonometric functions, we want to always think of applying a trigonometric identity that simplifies the expressions. In this case, we have an identity that's directly applicable:

cosy=11+x2 \cos y = \dfrac{1}{\sqrt{1 + x^2}}

Accordingly:

cos2y=11+x2 \cos^2 y = \dfrac{1}{1 + x^2}

Applying this fact to our derivative:

ddxarctanx=11+x2 \dfrac{d}{dx} \arctan x = \dfrac{1}{1 + x^2}

Having seen implicit differentiation as applied to f(x)=arctanx,{f(x) = \arctan x,} we can see how easy it is for the other inverse trigonometric functions. For example, consider y=arcsinx.{y = \arcsin x.}

y=arcsinxsiny=xddy(siny=x)=(ddysiny=ddyx)=(cosy)y=1 \begin{aligned} y &= \arcsin x \\ \sin y &= x \\ \dfrac{d}{dy} (\sin y = x) &= \left(\dfrac{d}{dy} \sin y = \dfrac{d}{dy} x\right) \\ &= (\cos y) y' = 1 \\ \end{aligned}

Solving for y{y'} and substituting for y{y}:

y=1cosy=11sin2y=11x2 \begin{aligned} y' &= \dfrac{1}{\cos y} \\ &= \dfrac{1}{\sqrt{1 - \sin^2 y}} \\ &= \dfrac{1}{\sqrt{1 - x^2}} \end{aligned}

We now have another useful derivative:

definition. Given the function y=arcsinx,{y = \arcsin x,} the function's derivative y{y'} is:

y=11x2 y' = \dfrac{1}{\sqrt{1-x^2}}