# The Unapologetic Mathematician

## Higher Partial Derivatives

Let’s say we’ve got a function $f$ that’s differentiable within an open region $S\subseteq\mathbb{R}^n$. In particular, if we pick coordinates on $\mathbb{R}^n$ the function has all partial derivatives $\frac{\partial f}{\partial x^i}$ at each point in $S$. As we move around within $S$ the value of the partial derivative changes, justifying the functional notation $\left[D_{x^i}f\right](x)$. And if we’re lucky, these functions themselves may be differentiable.

In particular, it makes sense to ask about the existence of so-called “second partial derivatives”, defined as $\displaystyle\left[D_{x^i,x^j}f\right](x)=\left[D_{x^i}\left[D_{x^j}f\right]\right](x)$

Or in Leibniz’ notation: $\displaystyle\frac{\partial^2f}{\partial x^i\partial x^j}=\frac{\partial}{\partial x^i}\frac{\partial f}{\partial x^j}=\frac{\partial}{\partial x^i}\frac{\partial}{\partial x^j}f$

If we take the derivative in terms of the same variable twice in a row we sometimes write this as $\displaystyle\frac{\partial}{\partial x^i}\frac{\partial}{\partial x^i}=\frac{\partial^2}{(\partial x^i)^2}$

Yes, there’s some dissonance between superscripts as indices and superscripts as powers. But, again, this is pretty much the received notation in many areas. If it seems like it might be confusing we just write out $\partial x^i$ twice in a row.

These, of course, may be defined within the region $S$, and we can then sensibly ask about third partial derivatives, like $\displaystyle\frac{\partial^3}{\partial x^i\partial x^j\partial x^k}f=\frac{\partial}{\partial x^i}\frac{\partial}{\partial x^j}\frac{\partial}{\partial x^k}f$

and so on.

As an example, let’s consider the function $f(x,y)=x^3 - 3xy^2$. We can easily calculate the two first partial derivatives. \displaystyle\begin{aligned}\frac{\partial f}{\partial x}&=3x^2-3y^2\\\frac{\partial f}{\partial y}&=-6xy\end{aligned}

And then we take each derivative of each of these two \displaystyle\begin{aligned}\frac{\partial^2f}{\partial x^2}&=\frac{\partial}{\partial x}\left(3x^2-3y^2\right)=6x\\\frac{\partial^2f}{\partial y\partial x}&=\frac{\partial}{\partial y}\left(3x^2-3y^2\right)=-6y\\\frac{\partial^2f}{\partial x\partial y}&=\frac{\partial}{\partial x}\left(-6xy\right)=-6y\\\frac{\partial^2f}{\partial y^2}&=\frac{\partial}{\partial y}\left(-6xy\right)=-6x\end{aligned}

where since we’re not using superscripts as indices in these examples its meaning should be clear.

We notice here that the two in the middle — the “mixed” partial derivatives — are the same. This will happen in many cases of interest to us, but not always. As a pathological example, let’s go back and consider the function defined by $\displaystyle f(x,y)=\frac{xy(x^2-y^2)}{x^2+y^2}$

away from the origin, and patched by $f(0,0)=0$. Again, we calculate the first partial derivatives (at least away from the origin): \displaystyle\begin{aligned}\frac{\partial f}{\partial x}&=\frac{y(x^4+4x^2y^2-y^4)}{(x^2+y^2)^2}\\\frac{\partial f}{\partial y}&=\frac{x(x^4-4x^2y^2-y^4)}{(x^2+y^2)^2}\end{aligned}

Each partial derivative is ${0}$ at the origin.

Now we can check that $\left[D_xf\right](0,y)=-y$ for all $y$, and that $\left[D_yf\right](x,0)=-x$ for all $x$. Thus we can calculate \displaystyle\begin{aligned}\frac{\partial^2f}{\partial x\partial y}\biggr\vert_{(0,0)}&=1\\\frac{\partial^2f}{\partial y\partial x}\biggr\vert_{(0,0)}&=-1\end{aligned}

and the mixed partial derivatives are not equal.

October 14, 2009 Posted by | Analysis, Calculus | 5 Comments