Skip to main content

CLP-3 Multivariable Calculus

Section 2.3 Higher Order Derivatives

You have already observed, in your first Calculus course, that if \(f(x)\) is a function of \(x\text{,}\) then its derivative, \(\diff{f}{x}(x)\text{,}\) is also a function of \(x\text{,}\) and can be differentiated to give the second order derivative \(\difftwo{f}{x}(x)\text{,}\) which can in turn be differentiated yet again to give the third order derivative, \(f^{(3)}(x)\text{,}\) and so on.
We can do the same for functions of more than one variable. If \(f(x,y)\) is a function of \(x\) and \(y\text{,}\) then both of its partial derivatives, \(\pdiff{f}{x}(x,y)\) and \(\pdiff{f}{y}(x,y)\) are also functions of \(x\) and \(y\text{.}\) They can both be differentiated with respect to \(x\) and they can both be differentiated with respect to \(y\text{.}\) So there are four possible second order derivatives. Here they are, together with various alternate notations.
\begin{alignat*}{2} \pdiff{}{x}\left(\pdiff{f}{x}\right)(x,y) &=\frac{\partial^2 f}{\partial x^2}(x,y) &= f_{xx}(x,y)\\ \pdiff{}{y}\left(\pdiff{f}{x}\right)(x,y) &=\frac{\partial^2\ f}{\partial y\partial x}(x,y) &= f_{xy}(x,y)\\ \pdiff{}{x}\left(\pdiff{f}{y}\right)(x,y) &=\frac{\partial^2\ f}{\partial x\partial y}(x,y) &= f_{yx}(x,y)\\ \pdiff{}{y}\left(\pdiff{f}{y}\right)(x,y) &=\frac{\partial^2 f}{\partial y^2}(x,y) &= f_{yy}(x,y) \end{alignat*}
In \(\frac{\partial^2\ f}{\partial y\,\partial x} =\frac{\partial^2}{\partial y\,\partial x}f\text{,}\) the derivative closest to \(f\text{,}\) in this case \(\pdiff{}{x}\text{,}\) is applied first.
In \(f_{xy}\text{,}\) the derivative with respect to the variable closest to \(f\text{,}\) in this case \(x\text{,}\) is applied first.
Let \(f(x,y) = e^{my}\cos(nx)\text{.}\) Then
\begin{align*} f_x &= -n e^{my}\sin(nx) & f_y &= m e^{my}\cos(nx)\\ f_{xx} &= -n^2 e^{my}\cos(nx) & f_{yx} &= -m n e^{my}\sin(nx)\\ f_{xy} &= -m n e^{my}\sin(nx) & f_{yy} &= m^2 e^{my}\cos(nx) \end{align*}
Let \(f(x,y) = e^{\al x+\be y}\text{.}\) Then
\begin{align*} f_x &= \al e^{\al x+\be y} & f_y &= \be e^{\al x+\be y}\\ f_{xx} &= \al^2 e^{\al x+\be y} & f_{yx} &= \be \al e^{\al x+\be y}\\ f_{xy} &= \al \be e^{\al x+\be y} & f_{yy} &= \be^2 e^{\al x+\be y} \end{align*}
More generally, for any integers \(m,n\ge 0\text{,}\)
\begin{equation*} \frac{\partial^{m+n} f}{\partial x^m\, \partial y^n} = \al^m\be^n e^{\al x+\be y} \end{equation*}
If \(f(x_1,x_2,x_3,x_4) = x_1^4\, x_2^3\, x_3^2\, x_4\text{,}\) then
\begin{align*} \frac{\partial^4\ f} {\partial x_1\, \partial x_2\,\partial x_3\,\partial x_4} &= \frac{\partial^3 \ } {\partial x_1\, \partial x_2\,\partial x_3} \left( x_1^4\, x_2^3\, x_3^2\right)\\ &= \frac{\partial^2 \ } {\partial x_1\, \partial x_2} \left( 2\ x_1^4\, x_2^3\, x_3\right)\\ &= \pdiff{}{x_1} \left( 6\ x_1^4\, x_2^2\, x_3\right)\\ &= 24\ x_1^3\, x_2^2\, x_3 \end{align*}
and
\begin{align*} \frac{\partial^4\ f} {\partial x_4\, \partial x_3\,\partial x_2\,\partial x_1} &= \frac{\partial^3 \ } {\partial x_4\, \partial x_3\,\partial x_2} \left( 4 x_1^3\, x_2^3\, x_3^2\,x_4\right)\\ &= \frac{\partial^2 \ } {\partial x_4\, \partial x_3} \left( 12\ x_1^3\, x_2^2\, x_3^2\,x_4\right)\\ &= \pdiff{}{x_4} \left( 24\ x_1^3\, x_2^2\, x_3\,x_4\right)\\ &= 24\ x_1^3\, x_2^2\, x_3 \end{align*}
Notice that in Example 2.3.1,
\begin{equation*} f_{xy}= f_{yx} = -m n e^{my}\sin(nx) \end{equation*}
and in Example 2.3.2
\begin{equation*} f_{xy}= f_{yx} = \al \be e^{\al x+\be y} \end{equation*}
and in Example 2.3.3
\begin{equation*} \frac{\partial^4\ f} {\partial x_1\, \partial x_2\,\partial x_3\,\partial x_4} = \frac{\partial^4\ f} {\partial x_4\, \partial x_3\,\partial x_2\,\partial x_1} = 24\ x_1^3\, x_2^2\, x_3 \end{equation*}
In all of these examples, it didn't matter what order we took the derivatives in. The following theorem 1  shows that this was no accident.

Subsection 2.3.1 Optional — The Proof of Theorem 2.3.4

Subsubsection 2.3.1.1 Outline

Here is an outline of the proof of Theorem 2.3.4. The (numbered) details are in the subsection below. Fix real numbers \(x_0\) and \(y_0\) and define
\begin{equation*} F(h,k) =\frac{1}{hk}\big[f(x_0+h,y_0+k)-f(x_0,y_0+k)-f(x_0+h,y_0)+f(x_0,y_0)\big] \end{equation*}
We define \(F(h,k)\) in this way because both partial derivatives \(\frac{\partial^2 f}{\partial x\partial y}(x_0,y_0)\) and \(\frac{\partial^2 f}{\partial y\partial x}(x_0,y_0)\) are limits of \(F(h,k)\) as \(h,k\rightarrow 0\text{.}\) Precisely, we show in item (1) in the details below that
\begin{align*} \pdiff{}{y} \pdiff{f}{x}(x_0,y_0) &= \lim_{k\rightarrow 0}\lim_{h\rightarrow 0}F(h,k)\\ \pdiff{}{x} \pdiff{f}{y}(x_0,y_0) &= \lim_{h\rightarrow 0}\lim_{k\rightarrow 0}F(h,k) \end{align*}
Note that the two right hand sides here are identical except for the order in which the limits are taken.
Now, by the mean value theorem (four times),
\begin{align*} F(h,k)\ &\eqf{(2)}\ \frac{1}{h} \left[\pdiff{f}{y}(x_0+h,y_0+\theta_1k) -\pdiff{f}{y}(x_0,y_0+\theta_1k)\right]\cr \ &\eqf{(3)}\ \pdiff{}{x} \pdiff{f}{y}(x_0+\theta_2 h,y_0+\theta_1k)\cr F(h,k)\ &\eqf{(4)}\ \frac{1}{k} \left[\pdiff{f}{x}(x_0+\theta_3h,y_0+k) -\pdiff{f}{x}(x_0+\theta_3h,y_0)\right]\cr \ &\eqf{(5)}\ \pdiff{}{y} \pdiff{f}{x}(x_0+\theta_3 h,y_0+\theta_4k)\cr \end{align*}
for some numbers \(0 \lt \theta_1,\theta_2,\theta_3,\theta_4 \lt 1\text{.}\) All of the numbers \(\theta_1,\theta_2,\theta_3,\theta_4\) depend on \(x_0,y_0,h,k\text{.}\) Hence
\begin{equation*} \pdiff{}{x} \pdiff{f}{y}(x_0+\theta_2 h,y_0+\theta_1k) =\pdiff{}{y} \pdiff{f}{x}(x_0+\theta_3 h,y_0+\theta_4k) \end{equation*}
for all \(h\) and \(k\text{.}\) Taking the limit \((h,k)\rightarrow(0,0)\) and using the assumed continuity of both partial derivatives at \((x_0,y_0)\) gives
\begin{equation*} \lim_{(h,k)\rightarrow (0,0)} F(h,k) =\pdiff{}{x} \pdiff{f}{y}(x_0,y_0) =\pdiff{}{y} \pdiff{f}{x}(x_0,y_0) \end{equation*}
as desired. To complete the proof we just have to justify the details (1), (2), (3), (4) and (5).

Subsubsection 2.3.1.2 The Details

  1. By definition,
    \begin{align*} &\pdiff{}{y} \pdiff{f}{x}(x_0,y_0) =\lim_{k\rightarrow 0}\frac{1}{k} \left[\pdiff{f}{x}(x_0,y_0+k) -\pdiff{f}{x}(x_0,y_0)\right]\cr &=\lim_{k\rightarrow 0}\frac{1}{k} \left[\lim_{h\rightarrow 0}\frac{f(x_0+h,y_0+k)-f(x_0,y_0+k)}{h} -\lim_{h\rightarrow 0}\frac{f(x_0+h,y_0)-f(x_0,y_0)}{h}\right]\cr &=\lim_{k\rightarrow 0}\lim_{h\rightarrow 0} \frac{f(x_0+h,y_0+k)-f(x_0,y_0+k)-f(x_0+h,y_0)+f(x_0,y_0)}{hk}\cr &= \lim_{k\rightarrow 0}\lim_{h\rightarrow 0}F(h,k) \end{align*}
    Similarly,
    \begin{align*} &\pdiff{}{x} \pdiff{f}{y}(x_0,y_0) =\lim_{h\rightarrow 0}\frac{1}{h} \left[\pdiff{f}{y}(x_0+h,y_0) -\pdiff{f}{y}(x_0,y_0)\right]\cr &=\lim_{h\rightarrow 0}\frac{1}{h} \left[\lim_{k\rightarrow 0}\frac{f(x_0+h,y_0+k)-f(x_0+h,y_0)}{k} -\lim_{k\rightarrow 0}\frac{f(x_0,y_0+k)-f(x_0,y_0)}{k}\right]\cr &=\lim_{h\rightarrow 0}\lim_{k\rightarrow 0} \frac{f(x_0+h,y_0+k)-f(x_0+h,y_0)-f(x_0,y_0+k)+f(x_0,y_0)}{hk}\cr &= \lim_{h\rightarrow 0}\lim_{k\rightarrow 0}F(h,k) \end{align*}
  2. The mean value theorem (Theorem 2.13.4 in the CLP-1 text) says that, for any differentiable function \(\varphi(x)\text{,}\)
    • the slope of the line joining the points \(\big(x_0,\varphi(x_0)\big)\) and \(\big(x_0+k,\varphi(x_0+k)\big)\) on the graph of \(\varphi\)
    is the same as
    • the slope of the tangent to the graph at some point between \(x_0\) and \(x_0+k\text{.}\)
    That is, there is some \(0 \lt \theta_1 \lt 1\) such that
    \begin{equation*} \frac{\varphi(x_0+k)-\varphi(x_0)}{k}=\frac{d\varphi}{dx}(x_0+\theta_1 k) \end{equation*}
    Applying this with \(x\) replaced by \(y\) and \(\varphi\) replaced by \(G(y)=f(x_0+h,y)-f(x_0,y)\) gives
    \begin{align*} \frac{G(y_0+k)-G(y_0)}{k} &=\diff{G}{y}(y_0+\theta_1 k) \qquad\text{for some } 0 \lt \theta_1 \lt 1\\ &=\pdiff{f}{y}(x_0+h,y_0+\theta_1k) -\pdiff{f}{y}(x_0,y_0+\theta_1k) \end{align*}
    Hence, for some \(0 \lt \theta_1 \lt 1\text{,}\)
    \begin{align*} F(h,k)\ &=\ \frac{1}{h} \left[\frac{G(y_0+k)-G(y_0)}{k}\right]\\ &=\frac{1}{h} \left[\pdiff{f}{y}(x_0+h,y_0+\theta_1k) -\pdiff{f}{y}(x_0,y_0+\theta_1k)\right] \end{align*}
  3. Define \(H(x)=\pdiff{f}{y}(x,y_0+\theta_1k)\text{.}\) By the mean value theorem,
    \begin{align*} F(h,k)\ &=\ \frac{1}{h}\left[H(x_0+h)-H(x_0)\right]\\ &=\ \diff{H}{x}(x_0+\theta_2 h) \qquad\text{for some } 0 \lt \theta_2 \lt 1\\ &=\pdiff{}{x} \pdiff{f}{y}(x_0+\theta_2 h,y_0+\theta_1k) \end{align*}
  4. Define \(A(x)=f(x,y_0+k)-f(x,y_0)\text{.}\) By the mean value theorem,
    \begin{align*} F(h,k)\ &=\ \frac{1}{k} \left[\frac{A(x_0+h)-A(x_0)}{h}\right]\\ &=\ \frac{1}{k}\diff{A}{x}(x_0+\theta_3 h) \qquad\text{for some } 0 \lt \theta_3 \lt 1\\ &=\frac{1}{k} \left[\pdiff{f}{x}(x_0+\theta_3h,y_0+k) -\pdiff{f}{x}(x_0+\theta_3h,y_0)\right] \end{align*}
  5. Define \(B(y)=\pdiff{f}{x}(x_0+\theta_3h,y)\text{.}\) By the mean value theorem
    \begin{align*} F(h,k)\ &=\ \frac{1}{k}\left[B(y_0+k)-B(y_0)\right]\\ &=\ \diff{B}{y}(y_0+\theta_4 k) \qquad\text{for some } 0 \lt \theta_4 \lt 1\\ &=\pdiff{}{y} \pdiff{f}{x}(x_0+\theta_3 h,y_0+\theta_4k) \end{align*}
This completes the proof of Theorem 2.3.4.

Subsection 2.3.2 Optional — An Example of \(\frac{\partial^2\ f}{\partial x\partial y}(x_0,y_0) \ne\frac{\partial^2\ f}{\partial y\partial x}(x_0,y_0)\)

In Theorem 2.3.4, we showed that \(\frac{\partial^2 f }{\partial x\partial y}(x_0,y_0) =\frac{\partial^2 f }{\partial y\partial x}(x_0,y_0)\) if the partial derivatives \(\frac{\partial^2 f }{\partial x\partial y}\) and \(\frac{\partial^2 f }{\partial y\partial x}\) exist and are continuous at \((x_0,y_0)\text{.}\) Here is an example which shows that if the partial derivatives \(\frac{\partial^2 f }{\partial x\partial y}\) and \(\frac{\partial^2 f }{\partial y\partial x}\) are not continuous at \((x_0,y_0)\text{,}\) then it is possible that \(\frac{\partial^2 f }{\partial x\partial y}(x_0,y_0) \ne\frac{\partial^2 f }{\partial y\partial x}(x_0,y_0)\text{.}\)
Define
\begin{equation*} f(x,y)=\begin{cases} xy\frac{x^2-y^2}{x^2+y^2} & \text{if } (x,y)\ne (0,0) \\ 0 & \text{if } (x,y)=(0,0) \end{cases} \end{equation*}
This function is continuous everywhere. Note that \(f(x,0)=0\) for all \(x\) and \(f(0,y)=0\) for all \(y\text{.}\) We now compute the first order partial derivatives. For \((x,y)\ne (0,0)\text{,}\)
\begin{align*} \pdiff{f}{x}(x,y) &= {\color{blue}{y\frac{x^2-y^2}{x^2+y^2}}} +xy\frac{2x}{x^2+y^2} - xy\frac{2x(x^2-y^2)}{{(x^2+y^2)}^2}\\ &\ = {\color{blue}{y\frac{x^2-y^2}{x^2+y^2}}} + xy\frac{4xy^2}{{(x^2+y^2)}^2}\\ \pdiff{f}{y}(x,y) &= {\color{blue}{x\frac{x^2-y^2}{x^2+y^2}}} -xy\frac{2y}{x^2+y^2} - xy\frac{2y(x^2-y^2)}{{(x^2+y^2)}^2}\\ &\ = {\color{blue}{x\frac{x^2-y^2}{x^2+y^2}}} - xy\frac{4yx^2}{{(x^2+y^2)}^2} \end{align*}
For \((x,y)= (0,0)\text{,}\)
\begin{alignat*}{2} \pdiff{f}{x}(0,0) &= \left[\diff{}{x}f(x,0)\right]_{x=0} &= \left[\diff{}{x} 0\right]_{x=0} &=0\\ \pdiff{f}{y}(0,0) &= \left[\diff{}{y}f(0,y)\right]_{y=0} &= \left[\diff{}{y} 0\right]_{y=0} &=0 \end{alignat*}
By way of summary, the two first order partial derivatives are
\begin{align*} f_x(x,y)&=\begin{cases} y\frac{x^2-y^2}{x^2+y^2} + \frac{4x^2y^3}{{(x^2+y^2)}^2} & \text{if } (x,y)\ne (0,0)\\ 0 & \text{if } (x,y)=(0,0) \end{cases}\\ f_y(x,y)&=\begin{cases} x\frac{x^2-y^2}{x^2+y^2} - \frac{4x^3y^2}{{(x^2+y^2)}^2} & \text{if } (x,y)\ne (0,0)\\ 0 & \text{if } (x,y)=(0,0) \end{cases} \end{align*}
Both \(\pdiff{f}{x}(x,y)\) and \(\pdiff{f}{y}(x,y)\) are continuous. Finally, we compute
\begin{align*} \frac{\partial^2\ f}{\partial x\partial y}(0,0) &=\left[\diff{}{x} f_y(x,0)\right]_{x=0} =\lim_{h\rightarrow 0}\frac{1}{h}\left[f_y(h,0)-f_y(0,0)\right]\\ &=\lim_{h\rightarrow 0}\frac{1}{h}\left[h\frac{h^2-0^2}{h^2+0^2}-0\right] =1\\ \frac{\partial^2\ f}{\partial y\partial x}(0,0) &=\left[\diff{}{y} f_x(0,y)\right]_{y=0} =\lim_{k\rightarrow 0}\frac{1}{k}\left[f_x(0,k)-f_x(0,0)\right]\\ &=\lim_{k\rightarrow 0}\frac{1}{k}\left[k\frac{0^2-k^2}{0^2+k^2}-0\right] =-1 \end{align*}

Exercises 2.3.3 Exercises

Exercise Group.

Exercises — Stage 1
1.
Let all of the third order partial derivatives of the function \(f(x,y,z)\) exist and be continuous. Show that
\begin{align*} f_{xyz}(x,y,z) &=f_{xzy}(x,y,z) =f_{yxz}(x,y,z) =f_{yzx}(x,y,z)\\ &=f_{zxy}(x,y,z) =f_{zyx}(x,y,z) \end{align*}
2.
Find, if possible, a function \(f(x,y)\) for which \(f_x(x,y)=e^y\) and \(f_y(x,y)=e^x\text{.}\)

Exercise Group.

Exercises — Stage 2
3.
Find the specified partial derivatives.
  1. \(f(x,y) = x^2y^3\text{;}\) \(f_{xx}(x,y)\text{,}\) \(f_{xyy}(x,y)\text{,}\) \(f_{yxy}(x,y)\)
  2. \(f(x,y) = e^{xy^2}\text{;}\) \(f_{xx}(x,y)\text{,}\) \(f_{xy}(x,y)\text{,}\) \(f_{xxy}(x,y)\text{,}\) \(f_{xyy}(x,y)\)
  3. \(\displaystyle f(u,v,w) = \frac{1}{u+2v+3w}\ \text{,}\) \(\displaystyle \frac{\partial^3 f}{\partial u\partial v\partial w}(u,v,w)\ \text{,}\) \(\displaystyle \frac{\partial^3 f}{\partial u\partial v\partial w}(3,2,1)\)
4.
Find all second partial derivatives of \(f(x,y)=\sqrt{x^2+5y^2}\text{.}\)
5.
Find the specified partial derivatives.
  1. \(f(x,y,z) = \arctan\big(e^{\sqrt{xy}}\big)\text{;}\) \(f_{xyz}(x,y,z)\)
  2. \(f(x,y,z) = \arctan\big(e^{\sqrt{xy}}\big) +\arctan\big(e^{\sqrt{xz}}\big) +\arctan\big(e^{\sqrt{yz}}\big)\text{;}\) \(f_{xyz}(x,y,z)\)
  3. \(f(x,y,z) = \arctan\big(e^{\sqrt{xyz}}\big)\text{;}\) \(f_{xx}(1,0,0)\)
6. (✳).
Let \(f(r,\theta)=r^m\cos m\theta\) be a function of \(r\) and \(\theta\text{,}\) where \(m\) is a positive integer.
  1. Find the second order partial derivatives \(f_{rr}\text{,}\) \(f_{r\theta}\text{,}\) \(f_{\theta\theta}\) and evaluate their respective values at \((r,\theta)=(1,0)\text{.}\)
  2. Determine the value of the real number \(\la\) so that \(f(r,\theta)\) satisfies the differential equation
    \begin{equation*} f_{rr}+\frac{\la}{r}f_r+\frac{1}{r^2}f_{\theta\theta}=0 \end{equation*}

Exercise Group.

Exercises — Stage 3
7.
Let \(\al \gt 0\) be a constant. Show that \(\displaystyle u(x,y,z,t) =\frac{1}{t^{3/2}} e^{-(x^2+y^2+z^2)/(4\al t)}\) satisfies the heat equation
\begin{equation*} u_t = \al\big(u_{xx} + u_{yy} + u_{zz} \big) \end{equation*}
for all \(t \gt 0\)
The history of this important theorem is pretty convoluted. See “A note on the history of mixed partial derivatives” by Thomas James Higgins which was published in Scripta Mathematica 7 (1940), 59-62. The Theorem is named for Alexis Clairaut (1713--1765), a French mathematician, astronomer, and geophysicist, and Hermann Schwarz (1843--1921), a German mathematician.