10.9 Implicit differentiation

This is "just" an application of the chain rule!

What is

ddxy2\frac{d}{dx}y^{2} (10.53)

This depends very much on what yy is. Usually, however, when yy is written, what is really meant is y(x)y(x). Therefore, here, we really have

ddx[(y(x))2]\frac{d}{dx}\left[(y(x))^{2}\right] (10.54)

If we define a new function f(y)f(y) equal to y2y^{2}, we then have

ddx[f(y(x))]\frac{d}{dx}\left[f(y(x))\right] (10.55)

We can then use the chain rule 1313 13 Explained in the section above.

ddx[f(y(x))]=dfdydydx\frac{d}{dx}\left[f(y(x))\right]=\frac{df}{dy}\cdot\frac{dy}{dx} (10.56)

As we know that ddy[f(y)]=2y\frac{d}{dy}\left[f(y)\right]=2y, we can then write the derivative of y2y^{2} with respect to xx as

2ydydx2y\frac{dy}{dx} (10.57)

10.9.1 Optimisation using implicit differentiation

Example 10.9.1

The point P=(1,1)P=(1,1) exists in the x-y plane. The circle CC is defined as

(x4)2+(y4)2=81(x-4)^{2}+(y-4)^{2}=81 (10.58)

Which point on CC is the furthest from (1,1)(1,1)?

Solution: The main thing here is to clearly define the problem in terms of algebraic relations (i.e. equations) which make it easy to solve the problem using differentiation.

What we’re trying to maximise is the distance of some unknown point - which we’ll call (x,y)(x,y) - from the point (1,1)(1,1). We’re not after any old point, though! For our points xx and xx we also require that (x4)2+(y4)2=81(x-4)^{2}+(y-4)^{2}=81 (as they must lie on the circle).

We can define a function which outputs the distance between (1,1)(1,1) and any two points (x,y)(x,y) as

f(x)=(x1)2+(y1)2f(x)=\sqrt{(x-1)^{2}+(y-1)^{2}} (10.59)
1414 14 Note that even though yy appears in this function, the function is still just a function of xx as yy is a function of xx - we just write yy instead of y(x)y(x) as it saves space.

We then know that this function’s turning points (and thus the minima and maxima) will be when

ddx[f(x)]=0\frac{d}{dx}\left[f(x)\right]=0 (10.60)

We can find the derivative using implicit differentiation

ddx[(x1)2+(y1)2]\displaystyle\frac{d}{dx}\left[\sqrt{(x-1)^{2}+(y-1)^{2}}\right] =12ddx[(x1)2+(y1)2](x1)2+(y1)2\displaystyle=\frac{1}{2}\frac{\frac{d}{dx}\left[(x-1)^{2}+(y-1)^{2}\right]}{% \sqrt{(x-1)^{2}+(y-1)^{2}}} (10.61)
=12[2(x1)+2(y1)dydx](x1)2+(y1)2\displaystyle=\frac{1}{2}\frac{\left[2(x-1)+2(y-1)\frac{dy}{dx}\right]}{\sqrt{% (x-1)^{2}+(y-1)^{2}}} (10.62)

and we want to know when this is equal to zero, which means that we can write that

12[2(x1)+2(y1)dydx](x1)2+(y1)2=0\displaystyle\frac{1}{2}\frac{\left[2(x-1)+2(y-1)\frac{dy}{dx}\right]}{\sqrt{(% x-1)^{2}+(y-1)^{2}}}=0 (10.63)
[2(x1)+2(y1)dydx]=0\displaystyle\left[2(x-1)+2(y-1)\frac{dy}{dx}\right]=0 (10.64)

What we’d usually try to do here is substitute either xx for yy or yy for xx into the function which gives us the relationship between xx and yy (in this case, C, as defined in Equation 10.58). Currently, though, this isn’t possible as there’s a dydx\frac{dy}{dx} throwing a spanner in the works. If we differentiate Equation 10.58, however, we can then express dydx\frac{dy}{dx} in terms of xx and yy, and thus eliminate it from the equation.

ddx[(x4)2+(y4)2]=ddx[81]\displaystyle\frac{d}{dx}\left[(x-4)^{2}+(y-4)^{2}\right]=\frac{d}{dx}\left[81\right] (10.65)
2(x4)+2(y4)dydx=0\displaystyle 2(x-4)+2(y-4)\frac{dy}{dx}=0 (10.66)
(x4)+(y4)dydx=0\displaystyle(x-4)+(y-4)\frac{dy}{dx}=0 (10.67)
dydx=(x4)(y4)\displaystyle\frac{dy}{dx}=\frac{-(x-4)}{(y-4)} (10.68)
dydx=4xy4\displaystyle\frac{dy}{dx}=\frac{4-x}{y-4} (10.69)

Returning to Equation 10.64, we can now elimate dydx\frac{dy}{dx}.

2(x1)+2(y1)dydx=0\displaystyle 2(x-1)+2(y-1)\frac{dy}{dx}=0 (10.70)
(x1)+(y1)dydx=0\displaystyle(x-1)+(y-1)\frac{dy}{dx}=0 (10.71)
dydx=1xy1\displaystyle\frac{dy}{dx}=\frac{1-x}{y-1} (10.72)
4xy4=1xy1\displaystyle\frac{4-x}{y-4}=\frac{1-x}{y-1} (10.73)
(4x)(y1)=(1x)(y4)\displaystyle(4-x)(y-1)=(1-x)(y-4) (10.74)
4y4xy+x=y4xy+4x\displaystyle 4y-4-xy+x=y-4-xy+4x (10.75)
3y=3x\displaystyle 3y=3x (10.76)
y=x\displaystyle y=x (10.77)

We can now subsitute this equation into CC (aka Equation 10.58), and find the values we’ve been after all this time.

(x4)2+(y4)2=81\displaystyle(x-4)^{2}+(y-4)^{2}=81 (10.78)
(x4)2+(x4)2=81\displaystyle(x-4)^{2}+(x-4)^{2}=81 (10.79)
2(x4)2=81\displaystyle 2(x-4)^{2}=81 (10.80)
(x4)2=812\displaystyle(x-4)^{2}=\frac{81}{2} (10.81)
x4=±812\displaystyle x-4=\pm\sqrt{\frac{81}{2}} (10.82)
x=4±812\displaystyle x=4\pm\sqrt{\frac{81}{2}} (10.83)

Because x=yx=y there are two cases: in the first

x,y=4+812x,y=4+\sqrt{\frac{81}{2}} (10.84)

In the second case instead

x,y=4812x,y=4-\sqrt{\frac{81}{2}} (10.85)

Plugging the two possible values of xx and yy into f(x)f(x) (hello again distance function - last seen in Equation 10.59), we get (using a handy pocket calculator) that x,y=4+812x,y=4+\sqrt{\frac{81}{2}} is the further point from (1,1)(1,1), and thus the furthest point is

x,y=4+812x,y=4+\sqrt{\frac{81}{2}} (10.86)