Chain Rule and Implicit Differentiation

Suppose we have a function of two variables, $f(x,y)=\mathrm{e}^{x^2} \sin y$.


\begin{maximasession}
f(x,y) := exp(x^2) * sin(y);
\maximaoutput*
\i1. f(x,y) :=...
...\\
\o1. f\left(x , y\right)\mathbin{:=}\exp x^2 \sin y \\
\end{maximasession}

We saw earlier what the partial derivatives of $f$ were with respect to $x$ and $y$. But suppose $x$ and $y$ are functions of some other variables, for instance,


\begin{maximasession}[x,y]: [s^2 * t, s * t^2];
\maximaoutput*
\i2. [x,y] : [s^2 * t, s * t^2]; \\
\o2. \left[ s^2 t , s t^2 \right] \\
\end{maximasession}

Then what are the partial derivatives of $f$ with respect to $s$ and $t$? Happily for us, Maxima does the chain rule automatically.


\begin{maximasession}
diff(f(x,y), s);
\par
diff(f(x,y), t);
\maximaoutput*
\i3....
...2\right)+2 s t e^{s^4 t^2} \cos \left(s t^2\right) \\
\end{maximasession}

That was easy. But be warned that the derivative with respect to $x$ does not work anymore.


\begin{maximasession}
diff(f(x,y), x);
\maximaoutput*
\i5. diff(f(x,y), x); \\
...
...ound M
- an error. To debug this try debugmode(true); \\
\end{maximasession}

We could fix this by using different letters, u and v:


\begin{maximasession}
diff(f(u,v), u);
\maximaoutput*
\i6. diff(f(u,v), u); \\
\o6. 2 u e^{u^2} \sin v \\
\end{maximasession}

But that is cheating. A better way to fix it is to kill the relationship between x and s, t.


\begin{maximasession}
kill(x, y);
diff(f(x,y), x);
\par
\maximaoutput*
\i7. kill...
...\\
\i8. diff(f(x,y), x); \\
\o8. 2 x e^{x^2} \sin y \\
\end{maximasession}

Implicit differentiation is relatively easy, given what we have already done. For example, let's find the first partial derivatives of $z$ when $xyz + x^2y^3z^4= x + xz$.


\begin{maximasession}
F: x*y*z + x^2*y^3*z^4 - x - x*z;
Fx: diff(F, x);
Fy: diff...
...2 y^2 z^4-x z}\over{4 x^2 y^3 z^3+x y-x}} \right] \\
\end{maximasession}



G. Jay Kerns 2009-12-01