# A calculus of the absurd

#### 10.8 Implicit differentiation

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

What is

$$\frac {d}{dx} y^2$$

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

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

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

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

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

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

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

$$2y \frac {dy}{dx}$$

##### 10.8.1 Optimisation using implicit differentiation
• Example 10.8.1 The point $$P=(1, 1)$$ exists in the x-y plane. The circle $$C$$ is defined as

$$(x-4)^2 + (y-4)^2 = 81 \label {circle for implicit diff optimisation problem}$$

Which point on $$C$$ is the furthest from $$(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)$$ - from the point $$(1, 1)$$. We’re not after any old point, though! For our points $$x$$ and $$x$$ we also require that $$(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)$$ and any two points $$(x, y)$$ as

$$f(x) = \sqrt {(x-1)^2 + (y-1)^2} \label {distance from 1,1}$$

7474 Note that even though $$y$$ appears in this function, the function is still just a function of $$x$$ as $$y$$ is a function of $$x$$ - we just write $$y$$ instead of $$y(x)$$ as it saves space.

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

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

We can find the derivative using implicit differentiation

\begin{align} \frac {d}{dx} \left [ \sqrt {(x-1)^2 + (y-1)^2} \right ] &= \frac {1}{2} \frac {\frac {d}{dx} \left [ (x-1)^2 + (y-1)^2 \right ] } {\sqrt {(x-1)^2 + (y-1)^2}} \\ &= \frac {1}{2} \frac {\left [ 2(x-1) + 2(y-1)\frac {dy}{dx} \right ] } {\sqrt {(x-1)^2 + (y-1)^2}} \end{align}

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

\begin{align} & \frac {1}{2} \frac {\left [ 2(x-1) + 2(y-1)\frac {dy}{dx} \right ] } {\sqrt {(x-1)^2 + (y-1)^2}} = 0 \\ & \left [ 2(x-1) + 2(y-1)\frac {dy}{dx} \right ] = 0 \label {distance function derivative without derivative eliminated} \end{align}

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

\begin{align} & \frac {d}{dx} \left [ (x-4)^2 + (y-4)^2 \right ] = \frac {d}{dx} \left [ 81 \right ] \\ & 2(x-4) + 2(y-4) \frac {dy}{dx} = 0 \\ & (x-4) + (y-4) \frac {dy}{dx} = 0 \\ & \frac {dy}{dx} = \frac {-(x-4)}{(y-4)} \\ & \frac {dy}{dx} = \frac {4-x}{y-4} \end{align}

Returning to Equation 10.63, we can now elimate $$\frac {dy}{dx}$$.

\begin{align} & 2(x-1) + 2(y-1)\frac {dy}{dx} = 0 \\ & (x-1) + (y-1)\frac {dy}{dx} = 0 \\ & \frac {dy}{dx} = \frac {1-x}{y-1} \\ & \frac {4-x}{y-4} = \frac {1-x}{y-1} \\ & (4-x)(y-1) = (1-x)(y-4) \\ & 4y - 4 - xy + x = y - 4 - xy + 4x \\ & 3y = 3x \\ & y = x \end{align}

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

\begin{align} & (x-4)^2 + (y-4)^2 = 81 \\ & (x-4)^2 + (x-4)^2 = 81 \\ & 2(x-4)^2 = 81 \\ & (x-4)^2 = \frac {81}{2} \\ & x-4 = \pm \sqrt {\frac {81}{2}} \\ & x = 4 \pm \sqrt {\frac {81}{2}} \end{align}

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

$$x,y = 4 + \sqrt {\frac {81}{2}}$$

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