## Chain Rule

1. If $g(s,t)=f(s^2-t^2,t^2-s^2)$ and $f$ is differentiable, show that

$t\frac{\partial g}{\partial s}+s\frac{\partial g}{\partial t}=0.$

Solution: It may be helpful to realize that $\frac{\partial g}{\partial s}=\frac{\partial f}{\partial s}$, and so on. The function tree here looks something like the following.

We find from the chain rule that

$\frac{\partial g}{\partial s}=\frac{\partial f}{\partial s}=\frac{\partial f}{\partial x}\frac{\partial x}{\partial s}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial s}=\frac{\partial f}{\partial x}2s+\frac{\partial f}{\partial y}(-2s).$

Likewise, we have

$\frac{\partial g}{\partial t}=\frac{\partial f}{\partial x}(-2t)+\frac{\partial f}{\partial y}(2t).$

Now, look at the original equation we were trying to show. It should now be clear that the equation is true.

## Implicit Differentiation

The example that I usually use to show implicit differentiation is $y=\frac{1}{x}$. Of course, this is a function written explicitly, but we’ll assume that we are incapable of doing division and we’ll instead write this as $xy=1$. Viewing both sides a function of $x$, and especially viewing the left as a product of functions of $x$ (one of them being $x$ and one of them being $y=f(x)$), we can now differentiate both sides with respect to $x$. We get

\begin{align*} yx &= 1\\ f(x)x &= 1\\ \frac{d}{dx}[f(x)x]&=\frac{d}{dx}1\\ f’(x)x+f(x)&= 0\\ f’(x)x&=-f(x)\\ f’(x)&=\frac{-f(x)}{x}\\ f’(x)&=\frac{-y}{x}\\ f’(x)&=\frac{-1/x}{x}\\ f’(x)&=-\frac{1}{x^2}. \end{align*}

We’re really using the chain rule here, since we’re considering the derivative of $f(x)x$ and $f(x)$ is a function of $x$. We can do the same thing in multiple variables. Let’s consider an example.

2. Find $y’$ if $x^3+y^3=6xy$.

Solution: We’ll view this as a function of two variables set at a specific level surface. That is, we write

$F(x,y)=x^3+y^3-6xy=0.$

Now, we have something where we can differentiate both sides, as we did in the $y=1/x$ example above. This is a bit weird, since we have a function tree that looks like

We’re actually trying to find the derivative represented by the bottom-right link in the tree. Differentiating both sides of the equation with respect to $x$ gives us

\begin{align*} \frac{\partial F}{\partial x}+\frac{\partial F}{\partial y}\frac{dy}{dx} &= \frac{d}{dx}[0]\\ F_x + F_y\frac{dy}{dx} &= 0\\ \frac{dy}{dx} &= -\frac{F_x}{F_y}. \end{align*}

OK, that’s a nice equation at the end. What this says is the following: If we want to calculate the derivative of $y$ with respect to $x$, we simply need to take the partial derivative of $F$ with respect to $x$ and the partial derivative of $F$ with respect to $y$, and take their quotient. Neat! So, we can solve this problem quickly now by writing

$y'=-\frac{3x^2-6y}{3y^2-6x}=-\frac{x^2-2y}{y^2-2x}.$