]> Derivatives of higher order

### Home | Table of Contents | A-Z Index | Help

Previous topic: page 2 Partial Derivatives

Next topic: page 4 Change of Variables

# Derivatives of Higher Order

## Differentiation of derivatives

A partial derivative of a function with respect to one of its variables, represents by itself a function of many variables. As such, it can be differentiated again with respect to the same or to a different variable, obtaining a second derivative.

If the original function is of n variables, there are n possible first derivatives. Each one of these first derivatives, can be in principle differentiated by n different variables, yielding n² derivatives of the second order. One can continue and differentiate the second order derivatives, and obtain n³ third order derivatives. Obviously the number of derivatives rises exponentially with the order of differentiation. In fact, as we'll see, the situation is not so catastrophic.

Let's have a closer look at the function of two variables

 $z=f\left(x,y\right)$ (3.1.3.1)

The second derivatives with respect to x should be:

 $\frac{\partial }{\partial x}\left(\frac{\partial f}{\partial x}\right)=\frac{{\partial }^{2}f}{\partial {x}^{2}}\text{ }\text{and}\text{ }\frac{\partial }{\partial x}\left(\frac{\partial f}{\partial y}\right)=\frac{{\partial }^{2}f}{\partial x\partial y}$ (3.1.3.2)

Similarly the second derivatives with respect to y should be:

 $\frac{\partial }{\partial y}\left(\frac{\partial f}{\partial x}\right)=\frac{{\partial }^{2}f}{\partial y\partial x}\text{ }\text{and}\text{ }\frac{\partial }{\partial y}\left(\frac{\partial f}{\partial y}\right)=\frac{{\partial }^{2}f}{\partial {y}^{2}}$ (3.1.3.3)

By definition we have

 $\begin{array}{l}\frac{{\partial }^{2}f}{\partial x\partial y}=\underset{\Delta x\to 0}{\mathrm{lim}}\frac{\frac{\partial f}{\partial y}\left(x+\Delta x,y\right)-\frac{\partial f}{\partial y}\left(x,y\right)}{\Delta x}=\\ =\left\{\underset{\Delta x\to 0}{\mathrm{lim}}\underset{\Delta y\to 0}{\mathrm{lim}}\left[\begin{array}{l}\frac{\frac{f\left(x+\Delta x,y+\Delta y\right)-f\left(x+\Delta x,y\right)}{\Delta y}}{\Delta x}-\\ -\frac{\frac{f\left(x,y+\Delta y\right)-f\left(x,y\right)}{\Delta y}}{\Delta x}\end{array}\right]=\\ =\left\{\underset{\Delta x\to 0}{\mathrm{lim}}\underset{\Delta y\to 0}{\mathrm{lim}}\left[\begin{array}{l}\frac{\frac{f\left(x+\Delta x,y+\Delta y\right)-f\left(x,y+\Delta y\right)}{\Delta x}}{\Delta y}-\\ -\frac{\frac{f\left(x+\Delta x,y\right)-f\left(x,y\right)}{\Delta x}}{\Delta y}\end{array}\right]\end{array}\right\}$ (3.1.3.4)

By assuming that one can change the order of the limit, one obtains finally

 $\frac{{\partial }^{2}f}{\partial x\partial y}=\underset{\Delta y\to 0}{\mathrm{lim}}\frac{\frac{\partial f}{\partial x}\left(x,y+\Delta y\right)-\frac{\partial f}{\partial x}\left(x,y\right)}{\Delta y}=\frac{{\partial }^{2}f}{\partial y\partial x}$ (3.1.3.5)

It can be proven that if both

 $\frac{{\partial }^{2}f}{\partial x\partial y}\text{ }\text{and}\text{ }\frac{{\partial }^{2}f}{\partial y\partial x}$ (3.1.3.6)

are continuous, then the order of differentiation is immaterial. The same rule applies for any derivatives with respect to any number of mixed variables. As an example for the derivatives of the third order:

 $\frac{{\partial }^{3}f}{\partial {x}^{2}\partial y}=\frac{{\partial }^{3}f}{\partial x\partial y\partial x}=\frac{{\partial }^{2}f}{\partial y\partial {x}^{2}}$ (3.1.3.7)

This rule reduces drastically the number of derivatives, e.g. in the case of two variables, the number of derivatives of order k is (k+1) instead of 2k.

The example of a function of three variables (3.1.2.3) was used for obtaining the first derivatives. It is reproduced here:

 $\begin{array}{l}\left\{\begin{array}{l}\text{for}\text{ }f\left(x,y,z\right)=\mathrm{ln}y\text{\hspace{0.17em}}\mathrm{exp}x+az\left(y+b\right)\\ \text{with}\text{ }a,b=\text{constants}\end{array}\\ \frac{\partial f}{\partial x}=\mathrm{ln}y\text{\hspace{0.17em}}\mathrm{exp}x\\ \frac{\partial f}{\partial y}=\frac{\mathrm{exp}x}{y}+az\\ \frac{\partial f}{\partial z}=a\left(y+b\right)\end{array}\right\}$ (3.1.3.8)

and will be used for obtaining the derivatives of the second order:

 $\begin{array}{l}\frac{{\partial }^{2}f}{\partial {x}^{2}}=\mathrm{ln}y\text{​}\mathrm{exp}x\\ \frac{{\partial }^{2}f}{\partial y\partial x}=\frac{\mathrm{exp}x}{y}=\frac{{\partial }^{2}f}{\partial x\partial y}\\ \frac{{\partial }^{2}f}{\partial z\partial x}=0=\frac{{\partial }^{2}f}{\partial x\partial z}\\ \frac{{\partial }^{2}f}{\partial {y}^{2}}=-\frac{\mathrm{exp}x}{{y}^{2}}\\ \frac{{\partial }^{2}f}{\partial z\partial y}=a=\frac{{\partial }^{2}f}{\partial y\partial z}\\ \frac{{\partial }^{2}f}{\partial {z}^{2}}=0\end{array}\right\}$ (3.1.3.9)

The results of the calculations are, as expected, in agreement with the rule of the order of differentiation.

The main law of thermodinamics (3.1.2.12/14) will be used as a physical example. As a reminder, from the definition of the total differential, we obtained:

 $\begin{array}{l}T\text{\hspace{0.28em}}\left(\text{temperature}\right)={\left(\frac{\partial U}{\partial S}\right)}_{V}\\ p\text{\hspace{0.28em}}\left(\text{pressure}\right)=-{\left(\frac{\partial U}{\partial V}\right)}_{S}\end{array}\right\}$ (3.1.3.10)

Since the order of differentiation of the function U(S,V) is immaterial, we obtain from (3.1.3.10):

 ${\left(\frac{\partial T}{\partial V}\right)}_{S}=-{\left(\frac{\partial p}{\partial S}\right)}_{V}$ (3.1.3.11)

which is one of the four Maxwell equations of thermodynamics.

## Notation

If the function and the variables have physical dimensions, then the notation presented here of a partial derivative of any order, which is inherited by the notation of the regular derivatives, exhibits its physical dimensions. As an example let's look at the dimensions of the expression (3.1.3.7):

 $\left[\frac{{\partial }^{3}f}{\partial {x}^{2}\partial y}\right]=\frac{\left[f\right]}{{\left[x\right]}^{2}\left[y\right]}$ (3.1.3.12)

where the square brackets mean the physical dimension (of what is inside the brackets).

Another notation of partial derivatives, which is commonly used, is to write the variables with respect to whom the function is differentiated, as indices of the function. For example

 $\begin{array}{l}\frac{{\partial }^{2}f}{\partial x\text{​}\partial y}=\frac{{\partial }^{2}f}{\partial y\text{​}\partial x}\\ {f}_{xy}={f}_{yx}\end{array}\right\}\text{\hspace{0.28em}}\text{are}\text{\hspace{0.28em}}\text{equivalent}$ (3.1.3.13)

and so are

 $\frac{{\partial }^{3}f}{\partial {x}^{2}\partial y}\text{ }\text{with}\text{ }{f}_{xxy}$ (3.1.3.14)

Although this notation is a legitimate shorthand, in the case of a change of variables, it could become ambiguous. For that reason it will be used here only in limited cases.

## Second approximation

We already know (3.1.2.30-32) to calculate the first approximation of a function of many variables around a point. As in the case of a function of a single variable, one can add to this first approximation a term formed by the second derivatives, in order to obtain a second approximation. For simplicity we'll study the case of a function of two variables, and expand it afterwards for the more general case.

For a function of two variables (3.1.3.1), the first approximation around the point (x, y)0 can be written as:

 $\begin{array}{l}{z}_{1}\left(x,y\right)={z}_{0}+{\left[\left(x-{x}_{0}\right)\frac{\partial }{\partial x}+\left(y-{y}_{0}\right)\frac{\partial }{\partial y}\right]}_{0}z\\ \text{where}\left\{\begin{array}{l}{z}_{0}=z\left({x}_{0},{y}_{0}\right)\\ {\left[\left(x-{x}_{0}\right)\frac{\partial }{\partial x}+\left(y-{y}_{0}\right)\frac{\partial }{\partial y}\right]}_{0}z=\\ =\left(x-{x}_{0}\right){\left(\frac{\partial z}{\partial x}\right)}_{0}+\left(y-{y}_{0}\right){\left(\frac{\partial z}{\partial y}\right)}_{0}\end{array}\end{array}\right\}$ (3.1.3.15)

The second approximation includes an additional term of a squared expression containing symbolic operators. Its meaning could be understood by the following:

 $\begin{array}{l}{z}_{2}\left(x,y\right)={z}_{1}\left(x,y\right)+\frac{1}{2}{\left[\left(x-{x}_{0}\right)\frac{\partial }{\partial x}+\left(y-{y}_{0}\right)\frac{\partial }{\partial y}\right]}_{0}^{2}z=\\ ={z}_{1}\left(x,y\right)+\frac{1}{2}{\left[\begin{array}{l}{\left(x-{x}_{0}\right)}^{2}\frac{{\partial }^{2}}{\partial {x}^{2}}+\\ +2\left(x-{x}_{0}\right)\left(y-{y}_{0}\right)\frac{{\partial }^{2}}{\partial x\partial y}+\\ +{\left(y-{y}_{0}\right)}^{2}\frac{{\partial }^{2}}{\partial {y}^{2}}\end{array}\right]}_{0}z=\\ ={z}_{1}\left(x,y\right)+\frac{1}{2}\left[\begin{array}{l}{\left(x-{x}_{0}\right)}^{2}{\left(\frac{{\partial }^{2}z}{\partial {x}^{2}}\right)}_{0}+\\ +2\left(x-{x}_{0}\right)\left(y-{y}_{0}\right){\left(\frac{{\partial }^{2}z}{\partial x\partial y}\right)}_{0}+\\ +{\left(y-{y}_{0}\right)}^{2}{\left(\frac{{\partial }^{2}z}{\partial {y}^{2}}\right)}_{0}\end{array}\right]\end{array}\right\}$ (3.1.3.16)

Simple calculation shows that this is indeed the second approximation, since the second derivatives of the approximation and the function are identical

 $\begin{array}{l}\frac{{\partial }^{2}{z}_{2}}{\partial {x}^{2}}={\left(\frac{{\partial }^{2}z}{\partial {x}^{2}}\right)}_{0}\\ \frac{{\partial }^{2}{z}_{2}}{\partial x\partial y}={\left(\frac{{\partial }^{2}z}{\partial x\partial y}\right)}_{0}\\ \frac{{\partial }^{2}{z}_{2}}{\partial {y}^{2}}={\left(\frac{{\partial }^{2}z}{\partial {y}^{2}}\right)}_{0}\end{array}\right\}$ (3.1.3.17)

without affecting the contributions of the first approximation.

For a quadratic function, the second approximation is identical to the function itself. The following examples of quadratic functions, studied previously, are shown here as a reminder.

1. A hyperbolic paraboloid (3.1.1.11):

 $z=\frac{xy}{2}$ (3.1.3.18)

2. An elliptic paraboloid (3.1.2.40):

 $z=3\left[1-{\left(\frac{x}{4}\right)}^{2}-{\left(\frac{y}{3}\right)}^{2}\right]$ (3.1.3.19)

On the other hand, the example of an ellipsoid written in a implicit form as

 $\frac{{x}^{2}}{{a}^{2}}+\frac{{y}^{2}}{{b}^{2}}+\frac{{z}^{2}}{{c}^{2}}-1=0$ (3.1.3.20)

contains only squared terms of the variables, but the function z is not a quadratic function:

 $z\left(x,y\right)=±c\sqrt{1-\frac{{x}^{2}}{{a}^{2}}-\frac{{y}^{2}}{{b}^{2}}}$ (3.1.3.21)

Its second approximation (for z≥0), around the point (x, y)0 = (0, 0), yields the elliptic paraboloid:

 ${z}_{2}\left(x,y\right)=c\left(1-\frac{{x}^{2}}{2{a}^{2}}-\frac{{y}^{2}}{2{b}^{2}}\right)$ (3.1.3.22)

Its proof is given as a task for the student in exercise 3 below. The second approximation (3.1.3.22) is compared graphically to the ellipsoid (3.1.3.20) in Fig. Approximated ellipsoid, showing overlapping shapes, in the vicinity of (x, y)0 = (0, 0).

For a function of n variables

 $y=f\left({x}_{1},....,{x}_{n}\right)$ (3.1.3.23)

The second approximation, around the point

 ${\left({x}_{1},....,{x}_{n}\right)}_{0}=\left({x}_{01},....,{x}_{0n}\right)$ (3.1.3.24)

will be written in the following symbolic form, which we already know how to handle

 $\begin{array}{l}{y}_{2}=\left\{\begin{array}{l}{y}_{0}+{\left[\left({x}_{1}-{x}_{01}\right)\frac{\partial }{\partial {x}_{1}}+....+\left({x}_{n}-{x}_{0n}\right)\frac{\partial }{\partial {x}_{n}}\right]}_{0}y+\\ +\frac{1}{2}{\left[\left({x}_{1}-{x}_{01}\right)\frac{\partial }{\partial {x}_{1}}+....+\left({x}_{n}-{x}_{0n}\right)\frac{\partial }{\partial {x}_{n}}\right]}_{0}^{2}y\end{array}\right\}=\\ ={y}_{0}+{\left[\sum _{m=1}^{n}\left({x}_{m}-{x}_{0m}\right)\frac{\partial }{\partial {x}_{m}}\right]}_{0}y+\frac{1}{2}{\left[\sum _{m=1}^{n}\left({x}_{m}-{x}_{0m}\right)\frac{\partial }{\partial {x}_{m}}\right]}_{0}^{2}y\end{array}\right\}$ (3.1.3.25)

## Taylor series

The use of higher order of approximations for a function of many variables is rarely used, but for sake of completeness, the appropriate expressions are given here. The order of approximation can be extended to any order j by the use of the following expression:

 ${y}_{j}={y}_{0}+\sum _{k=1}^{j}\frac{1}{k!}{\left[\sum _{m=1}^{n}\left({x}_{m}-{x}_{0m}\right)\frac{\partial }{\partial {x}_{m}}\right]}_{0}^{k}y$ (3.1.3.26)

Finally in the case of convergence for the limit of $j\to \infty$ , the Taylor series for a function of n variables is obtained.

## Differentiation under the integral sign

The following integral is a function of x

 $I\left(x\right)=\underset{a}{\overset{b}{\int }}{f}_{1}\left(x\right){f}_{2}\left(u\right)\text{d}u$ (3.1.3.27)

With respect to the integration, x is just a parameter, and the function f1 can be moved outside of the integral. By the same argument, the derivative of I with respect to x can be written as

 $\frac{\text{d}I}{\text{d}x}=\frac{\text{d}{f}_{1}}{\text{d}x}\underset{a}{\overset{b}{\int }}{f}_{2}\left(u\right)\text{d}u=\underset{a}{\overset{b}{\int }}\frac{\text{d}{f}_{1}}{\text{d}x}{f}_{2}\left(u\right)\text{d}u$ (3.1.3.28)

This was a trivial case of a differentiation under the integral sign. What will be the derivative with respect to x of the following integral?

 $I\left(x\right)=\underset{a}{\overset{b}{\int }}f\left(x,u\right)\text{d}u$ (3.1.3.29)

It can be proven that if $f\left(x,u\right)$ and $\frac{\partial f}{\partial x}$ are continuous in both x and u at (3.1.3.29), then

 $\frac{\text{d}I}{\text{d}x}=\underset{a}{\overset{b}{\int }}\frac{\partial f}{\partial x}\left(x,u\right)\text{d}u$ (3.1.3.30)

The combination of this rule, together with the result that we obtained from the exercise 1 on the previous page, yield the Euler's rule:

 $\frac{\text{d}}{\text{d}x}\underset{v\left(x\right)}{\overset{w\left(x\right)}{\int }}f\left(x,u\right)\text{d}u=\underset{v\left(x\right)}{\overset{w\left(x\right)}{\int }}\frac{\partial f}{\partial x}\left(x,u\right)\text{d}u+f\left(x,w\right)\frac{\text{d}w}{\text{d}x}-f\left(x,v\right)\frac{\text{d}v}{\text{d}x}$ (3.1.3.31)

## Exercises

Exercise 1. Continue the example from the previous page (3.1.2.27) and

1. Calculate $\frac{{\partial }^{2}z}{\partial {x}^{2}}\text{ }\text{and}\text{ }\frac{{\partial }^{2}z}{\partial {y}^{2}}$ as functions of x, y and z .
2. Calculate $\frac{{\partial }^{2}z}{\partial y\partial x}=\frac{\partial }{\partial y}\left(\frac{\partial z}{\partial x}\right)\text{ }\text{and}\text{ }\frac{{\partial }^{2}z}{\partial x\partial y}=\frac{\partial }{\partial x}\left(\frac{\partial z}{\partial y}\right)$ and compare the one with the other!

Exercise 2. The function z $z=\frac{xy}{2}$ represents a hyperbolic paraboloid.

1. Calculate the first and the second derivatives!
2. Obtain the first approximation around (x, y)0 = (x0, y0) !
3. Obtain the second approximation around (x, y)0 = (x0, y0) !
4. Does your result of the second approximation, depend on the choice of (x, y)0 , and why ?

Exercise 3. The following function z represents the half of an ellipsoid

$z=c\sqrt{1-{\left(\frac{x}{a}\right)}^{2}-{\left(\frac{y}{b}\right)}^{2}}$

where a, b and c are positive constants.

1. Calculate the first and the second derivatives of z !
2. Obtain the second approximation ${z}_{2}={z}_{2}\left(x,y\right)$ around the point (x, y) = (0, 0) !
3. Check your final result, by applying the balance of the physical dimensions !

Exercise 4. Any electrostatic potential φ in vacuum fulfills the Laplace equation

$\frac{{\partial }^{2}\varphi }{\partial {x}^{2}}+\frac{{\partial }^{2}\varphi }{\partial {y}^{2}}+\frac{{\partial }^{2}\varphi }{\partial {z}^{2}}=0$

where $\left(x,y,z\right)$ are the Cartesian coordinates in three dimensions. What is the most general form of an electrostatic potential depending only of the distance from the origin r ? r is expressed by the coordinates as

$r=\sqrt{{x}^{2}+{y}^{2}+{z}^{2}}$

Solve this exercise by the following steps:

1. What is $\frac{\partial r}{\partial x}$ in terms of x and r ?
2. By the use of $\varphi =\varphi \left(r\right)$ calculate $\frac{\partial \varphi }{\partial x}$ !
3. Calculate $\frac{{\partial }^{2}\varphi }{\partial {x}^{2}}$ !
4. Use the result of the previous step and the symmetry of r towards the coordinates, in order to get the Laplace equation as a regular differential equation, which can be solved by separation of variables with two consecutive integrations.
5. Solve this equation !

Exercise 5. Prove that

$y=\frac{1}{k}\underset{0}{\overset{x}{\int }}f\left(u\right)\mathrm{sin}\left[k\left(x-u\right)\right]\text{d}u$

is a solution of the differential equation

$\frac{{\text{d}}^{2}y}{\text{d}{x}^{2}}+{k}^{2}y=f\left(x\right)$

where k is a constant!

Previous topic: page 2 Partial Derivatives

Next topic: page 4 Change of Variables