### 2 Second partial derivatives

Performing two successive partial differentiations of $f\left(x,y\right)$ with respect to $x$ (holding $y$ constant) is denoted by $\frac{{\partial}^{2}f}{\partial {x}^{2}}$ (or ${f}_{xx}\left(x,y\right)$ ) and is defined by

$\phantom{\rule{2em}{0ex}}\frac{{\partial}^{2}f}{\partial {x}^{2}}\equiv \frac{\partial}{\partial x}\left(\frac{\partial f}{\partial x}\right)$

For functions of two or more variables as well as $\frac{{\partial}^{2}f}{\partial {x}^{2}}$ other second-order partial derivatives can be obtained. Most obvious is the second derivative of $f\left(x,y\right)$ with respect to $y$ is denoted by $\frac{{\partial}^{2}f}{\partial {y}^{2}}$ (or ${f}_{yy}\left(x,y\right)$ ) which is defined as:

$\phantom{\rule{2em}{0ex}}\frac{{\partial}^{2}f}{\partial {y}^{2}}\equiv \frac{\partial}{\partial y}\left(\frac{\partial f}{\partial y}\right)$

##### Example 5

Find $\frac{{\partial}^{2}f}{\partial {x}^{2}}$ and $\frac{{\partial}^{2}f}{\partial {y}^{2}}$ for $f\left(x,y\right)={x}^{3}+{x}^{2}{y}^{2}+2{y}^{3}+2x+y$ .

##### Solution

$\frac{\partial f}{\partial x}=3{x}^{2}+2x{y}^{2}+0+2+0=3{x}^{2}+2x{y}^{2}+2$

$\frac{{\partial}^{2}f}{\partial {x}^{2}}\equiv \frac{\partial}{\partial x}\left(\frac{\partial f}{\partial x}\right)=6x+2{y}^{2}+0=6x+2{y}^{2}.$

$\frac{\partial f}{\partial y}=0+{x}^{2}\times 2y+6{y}^{2}+0+1=2{x}^{2}y+6{y}^{2}+1$

$\frac{{\partial}^{2}f}{\partial {y}^{2}}=\frac{\partial}{\partial y}\left(\frac{\partial f}{\partial y}\right)=2{x}^{2}+12y$ .

We can use the alternative notation when evaluating derivatives.

##### Example 6

Find ${f}_{xx}\left(-1,1\right)$ and ${f}_{yy}\left(2,-2\right)$ for $f\left(x,y\right)={x}^{3}+{x}^{2}{y}^{2}+2{y}^{3}+2x+y$ .

##### Solution

${f}_{xx}\left(-1,1\right)=6\times \left(-1\right)+2\times {\left(-1\right)}^{2}=-4.$

${f}_{yy}\left(2,-2\right)=2\times {\left(2\right)}^{2}+12\times \left(-2\right)=-16$

#### 2.1 Mixed second derivatives

It is possible to carry out a partial differentiation of
$f\left(x,y\right)$
with respect to
$x$
followed by a partial differentiation with respect to
$y$
(or vice-versa). The results are examples of
**
mixed derivatives
**
. We must be careful with the notation here.

We use $\frac{{\partial}^{2}f}{\partial x\partial y}$ to mean ‘differentiate first with respect to $y$ and then with respect to $x$ ’ and we use $\frac{{\partial}^{2}f}{\partial y\partial x}$ to mean ‘differentiate first with respect to $x$ and then with respect to $y$ ’:

$\phantom{\rule{2em}{0ex}}\text{i.e.}\phantom{\rule{2em}{0ex}}\phantom{\rule{1em}{0ex}}\frac{{\partial}^{2}f}{\partial x\partial y}\equiv \frac{\partial}{\partial x}\left(\frac{\partial f}{\partial y}\right)\phantom{\rule{2em}{0ex}}\text{and}\phantom{\rule{2em}{0ex}}\frac{{\partial}^{2}f}{\partial y\partial x}\equiv \frac{\partial}{\partial y}\left(\frac{\partial f}{\partial x}\right).$

(This explains why the order is opposite of what we expect - the derivative ‘operates on the left’.)

##### Example 7

For $f\left(x,y\right)={x}^{3}+2{x}^{2}{y}^{2}+{y}^{3}$ find $\frac{{\partial}^{2}f}{\partial x\partial y}.$

##### Solution

$\frac{\partial f}{\partial y}=4{x}^{2}y+3{y}^{2};\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\frac{{\partial}^{2}f}{\partial x\partial y}=8xy$

The remaining possibility is to differentiate first with respect to $x$ and then with respect to $y$ i.e. $\frac{\partial}{\partial y}\left(\frac{\partial f}{\partial x}\right)$ .

For the function in Example 7 $\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\frac{\partial f}{\partial x}=3{x}^{2}+4x{y}^{2}$ and $\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\frac{{\partial}^{2}f}{\partial y\partial x}=8xy.$ Notice that for this function

$\phantom{\rule{2em}{0ex}}\frac{{\partial}^{2}f}{\partial x\partial y}\equiv \frac{{\partial}^{2}f}{\partial y\partial x}.$

This equality of mixed derivatives is true for all functions which you are likely to meet in your studies.

To evaluate a mixed derivative we can use the alternative notation. To evaluate $\frac{{\partial}^{2}f}{\partial x\partial y}$ we write ${f}_{yx}\left(x,y\right)$ to indicate that the first differentiation is with respect to $y$ . Similarly, $\frac{{\partial}^{2}f}{\partial y\partial x}$ is denoted by ${f}_{xy}\left(x,y\right)$ .

##### Example 8

Find ${f}_{yx}\left(1,2\right)$ for the function $f\left(x,y\right)={x}^{3}+2{x}^{2}{y}^{2}+{y}^{3}$

##### Solution

$\phantom{\rule{2em}{0ex}}{f}_{x}=3{x}^{2}+4x{y}^{2}$ and $\phantom{\rule{1em}{0ex}}{f}_{yx}=8xy\phantom{\rule{2em}{0ex}}\text{so}\phantom{\rule{1em}{0ex}}{f}_{yx}\left(1,2\right)=8\times 1\times 2=16.$

##### Task!

Find ${f}_{xx}\left(1,2\right),\phantom{\rule{1em}{0ex}}{f}_{yy}\left(-2,-1\right),$ ${f}_{xy}\left(3,3\right)$ for $f\left(x,y\right)\equiv {x}^{3}+3{x}^{2}{y}^{2}+{y}^{2}.$

${f}_{x}=3{x}^{2}+6x{y}^{2};\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{f}_{y}=6{x}^{2}y+2y$

${f}_{xx}=6x+6{y}^{2};\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{f}_{yy}=6{x}^{2}+2;\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{f}_{xy}={f}_{yx}=12xy$

${f}_{xx}\left(1,2\right)=6+24=30;\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{f}_{yy}\left(-2,-1\right)=26;\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}{f}_{xy}\left(3,3\right)=108$