# Second partial derivatives

A brief overview of second partial derivative, the symmetry of mixed partial derivatives, and higher order partial derivatives.

## Background:

## Generalizing the second derivative

Consider a function with a two-dimensional input, such as

$f(x, y) = x^2 y^3$.

Its partial derivatives $\dfrac{\partial f}{\partial x}$ and $\dfrac{\partial f}{\partial y}$ take in that same two-dimensional input $(x, y)$:

Therefore, we could also take the partial derivatives

*of the partial derivatives*.These are called

**second partial derivatives**, and the notation is analogous to the $\dfrac{d^2 f}{dx^2}$ notation for the ordinary second derivative in single-variable calculus:Using the $f_x$ notation for the partial derivative (in this case with respect to $x$), you might also see these second partial derivatives written like this:

The second partial derivatives which involve multiple distinct input variables, such as $f_{\redE{y}\blueE{x}}$ and $f_{\blueE{x}\redE{y}}$, are called "

**mixed partial derivatives**"## Example 1: The full tree

**Problem**: Find all the second partial derivatives of $f(x, y) = \sin(x)y^2$

**Solution**: First, find both partial derivatives:

Then for each one, write both partial derivatives:

## Symmetry of second derivatives

Notice, in the example above, the two mixed partial derivatives $\dfrac{\partial^2 f}{\partial x \partial y}$ and $\dfrac{\partial^2 f}{\partial y \partial x}$ are the same. This is not a coincidence; it happens for almost every function you encounter in practice. For example, look at what happens to a general polynomial term $x^n y^k$:

Technically, the symmetry of second derivatives is not always true. There is a theorem, referred to variously as Schwarz's theorem or Clairaut's theorem, which states that symmetry of second derivatives will always hold at a point if the second partial derivatives are

*continuous*around that point. To really get into the meat of this, we'd need some real analysis.You should keep in the back of your mind that exceptions exist, but the symmetry of second derivatives work for just about every "normal" looking function that you will come across.

## Example 2: Higher order derivatives

Why stop at second partial derivatives? We could also take, say, five partial derivatives with respect to various input variables.

**Problem**: If $f(x, y, z) = \sin(xy)e^{x + z}$, what is $f_{zyzyx}$?

**Solution**: The notation $f_{zyzyx}$ is shorthand for $((((f_z)_y)_z)_y)_x$, so we differentiate with respect to $z$, then with respect to $y$, then $z$, then $y$, then $x$. That is, we read

**left to right**.

It's worth pointing out that the order is different in the other notation:

So the order of differentiation is indicated by the order of the terms in the denominator from

**right to left**.Anyway, back to the problem at hand. This is one of those tasks where you just have to roll up your sleeves and slog through it, but to help things let's color the variables $\blueD{x}, \redD{y}, \greenE{z}$ to keep track of where they all are:

This last step uses the extended product rule,

Man! That was a tedious example. But if you could follow all the way through, computing multiple partial derivatives should not be an issue for you. It's one of those things that just requires more bookkeeping than anything else.