Partial Derivatives

Definition

Given a function of two or more variables $f(x_1,x_2,\ldots, x_n)$, the partial derivative of $f$ with respect to $x_1$ gives the rate of change of $f$ with respect to $x_1$. It is computed by taking the first derivative of $f$ with respect to $x_1$ whilst holding all other variables $x_2,\ldots,x_n$ fixed, i.e. treating them as constants. The process of finding a partial derivative is known as partial differentiation.

The partial derivative of a function $f(x,y)$ with respect to $x$ is denoted $\dfrac{\partial f}{\partial x}$ and is defined by:

\[\dfrac{\partial f}{\partial x}=\lim_{h\to0}\left[\dfrac{f(x+h,y)-f(x,y)}{h}\right].\]

Similarly, the partial derivative of a function $f(x,y)$ with respect to $y$ is denoted $\dfrac{\partial f}{\partial y}$ and is defined by:

\[\dfrac{\partial f}{\partial y}=\lim_{h\to0}\left[\dfrac{f(x,y+h)-f(x,y)}{h}\right].\]

It is often not convenient to compute this limit to find a partial derivative. The partial derivatives of many functions can be found using standard derivatives in conjuction with the rules for finding full derivatives, such as the chain rule, product rule and quotient rule, all of which apply to partial differentiation.

Notation

The partial derivative is denoted by the symbol $\partial$, which replaces the roman letter $\mathrm{d}$ used to denote a full derivative.

Given a function $f(x,y)$, the first and second partial derivatives of $f$ with respect to $x$ can be denoted by:

\[\dfrac{\partial f}{\partial x} \text{ and } \dfrac{\partial^2f}{\partial x^2},\]

and the first and second partial derivatives of $f$ with respect to $y$ can be denoted by:

\[\dfrac{\partial f}{\partial y} \text{ and } \dfrac{\partial^2f}{\partial y^2}.\]

Partial derivatives can also be denoted by a subscript, where the subscript specifies which variable to differentiate with respect to.

Given a function $f(x,y)$, the first and second partial derivatives of $f$ with respect to $x$ can be denoted by:

\[f_x \text{ and } f_{xx},\]

and the first and second partial derivatives of $f$ with respect to $y$ can be denoted by:

\[f_y \text{ and } f_{yy}.\]

Either of these notations can be used to denote the mixed second order partial derivative.

Given a function $f(x,y)$, the mixed second order partial derivatives of $f$ can be denoted in the following ways:

\[\dfrac{\partial}{\partial x}\left(\dfrac{\partial f}{\partial y}\right)=\dfrac{\partial^2f}{\partial x \partial y}=f_{yx},\]

\[\dfrac{\partial}{\partial y}\left(\dfrac{\partial f}{\partial x}\right)=\dfrac{\partial^2f}{\partial y\partial x}=f_{xy}.\]

Brackets with subscripts are commonly used to indicate which variables are held constant.

Given a function $f(x,y,z)$, the partial derivative of $f$ with respect to $x$, where $y,z$ are held constant, can be denoted by:

\[\left(\dfrac{\partial f}{\partial x}\right)_{y,z}\]

Second Order and Mixed Derivatives

Consider a function of two variables, $f(x,y)$. The first partial derivatives of this function, $\dfrac{\partial f}{\partial x}$ and $\dfrac{\partial f}{\partial y}$, are both functions of $x$ and $y$ and can therefore be differentiated with respect to either of these variables. Hence there are four possible second order derivatives of $f$:

\begin{align} \dfrac{\partial}{\partial x}\left(\dfrac{\partial f}{\partial x}\right) &= \dfrac{\partial^2f}{\partial x^2}=(f_x)_x=f_{xx} \\ \\ \dfrac{\partial}{\partial y}\left(\dfrac{\partial f}{\partial x}\right) &= \dfrac{\partial^2f}{\partial y\partial x}=(f_x)_y=f_{xy} \\ \\ \dfrac{\partial}{\partial x}\left(\dfrac{\partial f}{\partial y}\right) &= \dfrac{\partial^2f}{\partial x\partial y}=(f_y)_x=f_{yx} \\ \\ \dfrac{\partial}{\partial y}\left(\dfrac{\partial f}{\partial y}\right) &= \dfrac{\partial^2f}{\partial y^2}=(f_y)_y=f_{yy} \end{align}

The second order derivatives $f_{xy}$ and $f_{yx}$ are known as mixed partial derivatives, as they involve taking derivatives with respect to more than one variable. The order in which the derivatives are taken is indicated by the notation:

  • $\dfrac{\partial^2f}{\partial y\partial x}=f_{xy}$ denotes that the derivative is first taken with respect to $x$, and then with respect to $y$,
  • $\dfrac{\partial^2f}{\partial x\partial y}=f_{yx}$ denotes that the derivative is first taken with respect to $y$, and then with respect to $x$.
Symmetry of Mixed Derivatives

If a function $f(x,y)$ has continuous partial derivatives, then its mixed partial derivatives $f_{xy}$ and $f_{yx}$ are always equal. That is:

\[f_{xy}=f_{yx},\]

or equivalently,

\[\dfrac{\partial^2f}{\partial y \partial x}=\dfrac{\partial^2f}{\partial x\partial y}.\]

Worked Example

Example 1

Given a function $f=x^2y^3z+3x^3y+\cos{z}$, find

(a) $\dfrac{\partial f}{\partial z}$

(b) $\dfrac{\partial^2f}{\partial x\partial y}$.

Solution

(a) Recall that when computing the partial derivative of a function with respect to one variable, all other variables are held fixed.

Thus to find the partial derivative of the function $f$ with respect to $z$, the other variables $x$ and $y$ are treated as constants.

The derivative of $f$ with respect to $z$ is:

\[\dfrac{\partial f}{\partial z}=\dfrac{\partial}{\partial z}\Bigl[x^2y^3z+3x^3y+\cos{z}\Bigl].\]

Since differentiation is a linear operation, each term can be considered separately.

The partial derivative with respect to $z$ of the first term is:

\[\dfrac{\partial}{\partial z}\Bigl[x^2y^3z\Bigl]=x^2y^3.\]

The partial derivative with respect to $z$ of the second term is:

\[\dfrac{\partial}{\partial z}\Bigl[3x^3y\Bigl]=0,\]

since the derivative of a constant is always $0$, and here $x$ and $y$ are constant with respect to $z$.

The partial derivative with respect to $z$ of the third term is:

\[\dfrac{\partial}{\partial z}\Bigl[\cos{z}\Bigl]=-\sin{z}.\]

Hence, the partial derivative of $f$ with respect to $z$ is:

\begin{align} \dfrac{\partial f}{\partial z} &= \dfrac{\partial}{\partial z}\Bigl[x^2y^3z+3x^3y+\cos{z}\Bigl] \\ &= x^2y^3+0-\sin{z} \\ &=x^2y^3-\sin{z}. \end{align}

(b) Recall that $\dfrac{\partial^2f}{\partial x\partial y}=\dfrac{\partial}{\partial x}\left(\dfrac{\partial f}{\partial y}\right)=\dfrac{\partial}{\partial y}\left(\dfrac{\partial f}{\partial x}\right)=\dfrac{\partial^2f}{\partial y\partial x}$. Hence the function $f$ can first be differentiated with respect to $x$ and then with respect to $y$, or vice versa.

Here, we choose to first differentiate with respect to $y$, treating $x$ and $z$ as constants:

\begin{align} \dfrac{\partial f}{\partial y} &= \dfrac{\partial}{\partial y}\Bigl[x^2y^3z+3x^3y+\cos{z}\Bigl] \\ &= x^2 (3y^2) z+3x^3 \\ &= 3x^2y^2z+3x^3. \end{align}

Note that the third term has vanished; since $z$ is constant with respect to $y$ the derivative with respect to $y$ of $\cos{z}$ is $\dfrac{\partial}{\partial y}\Bigl[\cos{z}\Bigl]=0$.

To find the mixed partial derivative, the expression for $\dfrac{\partial f}{\partial y}$ is then differentiated with respect to $x$, treating $y$ and $z$ as constants:

\begin{align} \dfrac{\partial^2f}{\partial x\partial y} &= \dfrac{\partial}{\partial x}\left(\dfrac{\partial f}{\partial y}\right) \\ &=\dfrac{\partial}{\partial x}\Bigl[3x^2y^2z+3x^3\Bigl] \\ &=3 \cdot 2x \cdot y^2z+3 \cdot 3x^2 \\ &= 6xy^2z+9x^2. \end{align}

Note that first differentiating with respect to $x$ and then to $y$ gives:

\begin{align} \dfrac{\partial^2f}{\partial y\partial x} &= \dfrac{\partial}{\partial y}\left(\dfrac{\partial f}{\partial x}\right) \\ &=\dfrac{\partial}{\partial y}\left(\dfrac{\partial}{\partial x}\Bigl[x^2y^3z+3x^3y+\cos{z}\Bigl]\right) \\ &=\dfrac{\partial}{\partial y}\left(2xy^3z+9x^2y\right) \\ &=6xy^2z+9x^2 \\ &= \dfrac{\partial^2 f}{\partial x\partial y}, \end{align}

which shows that the order of differentiation does not affect the result.

Workbook

This workbook produced by HELM is a good revision aid, containing key points for revision and many worked examples.

Test Yourself

Test yourself: Numbas test on using partial derivatives to find stationary points