Skip to main content

Section 4.1 Partial Differentiation

Firstly, let’s recall some of the important things that we know about the derivative of the function of one variable, \(f(x)\text{.}\)

  1. At any given point \(x_0\text{,}\) \(f'(x_0)\) gives the slope of the tangent to the graph of the function at that point.

    Figure 4.1.1.

  2. At any given point \(x_0\text{,}\) \(f'(x_0)\) gives the instantaneous rate of change of the function at that point.

  3. The derivative \(f'(x)\) is itself a function of one variable, when it exists.

For a function of two variables, \(f(x,y)\text{,}\) the rate at which the function is changing at any point as we vary the independent variables depends upon the direction in which we vary those variables.

Consider the function \(f(x,y) = x^2-y^2\text{.}\) The graph of this function is shown below. At \((x,y)=(0,0)\text{,}\) \(f=0\text{.}\) As we can see by looking at the graph, as we move away from the origin along the positive \(x\)-axis the value of \(f\) is increasing, i.e. the rate of change of the function will be positive. However, if we move away from the origin along the positive \(y\)-axis the value of \(f\) is decreasing, i.e. the rate of change of the function will be negative.

Figure 4.1.3.

As a first step to analyzing more formally how a function of two variables can change with respect to its independent variables we will first consider the cases where we vary only one variable at a time.

Consider the function \(f(x,y) = 5 - \dfrac{x^2+y^2}{2}\) at the point \((2,1)\text{.}\)

Firstly, let’s look at the instantaneous rate of change of \(f\) in the direction of the positive \(x\)-axis. As shown in the diagram below, if we hold \(y\) constant at and vary \(x\) we are actually moving along the curve

\begin{equation*} z=\frac{9}{2}-\frac{1}{2}x^2\text{.} \end{equation*}
Figure 4.1.5.

Along this curve \(\dfrac{dz}{dx}=-x\) and at \(x=2\) we have \(\dfrac{dz}{dx}=-2\text{.}\) Thus, the instantaneous rate of change of \(f\) in the direction of the positive \(x\)-axis at the point \((2,1)\) is \(-2\text{.}\)

Now consider the instantaneous rate of change of \(f\) in the direction of the positive \(y\)-axis. As shown in the diagram below, if we hold \(x\) constant at \(x=2\) and vary \(y\) we are actually moving along the curve

\begin{equation*} z=3-\frac{1}{2}y^2\text{.} \end{equation*}

Along this curve \(\dfrac{dz}{dy}=-y\) and at \(y=1\) we have \(\dfrac{dz}{dy}=-1\text{.}\) Thus, the instantaneous rate of change of \(f\) in the direction of the positive \(y\)-axis at the point \((2,1)\) is \(-1\text{.}\)

Figure 4.1.6.

The above example provided an illustration of calculating what are called partial derivatives. Formally partial derivatives are defined as follows.

Definition 4.1.7. Partial Derivative.

Consider the function of two variables, \(f(x,y)\)

The partial derivative of \(f\) with respect to \(x\) at the point \((x_0,y_0)\) is given by the limit (if it exists)

\begin{equation*} \frac{\partial f}{\partial x} (x_0,y_0) = \lim_{h \to 0} \left[ \frac{f(x_0+h,y_0)-f(x_0,y_0)}{h} \right]\text{.} \end{equation*}

The partial derivative of \(f\) with respect to \(y\) at the point \((x_0,y_0)\) is given by the limit (if it exists)

\begin{equation*} \frac{\partial f}{\partial y} (x_0,y_0) = \lim_{h \to 0} \left[ \frac{f(x_0,y_0+h)-f(x_0,y_0)}{h} \right]\text{.} \end{equation*}

Using the definition, calculate the partial derivatives of \(f(x,y) = 5 - \dfrac{x^2+y^2}{2}\) at the point \((2,1)\text{.}\)

Answer.

\(\dfrac{\partial f}{\partial x}(2,1) = -2\) and \(\dfrac{\partial f}{\partial y}(2,1) = -1\)

Solution.

Firstly, calculate the partial derivative of \(f\) with respect to \(x\) at \((2,1)\text{.}\)

\begin{align*} \frac{\partial f}{\partial x}(2,1) \amp = \lim_{h \to 0} \left[ \frac{f(2+h,1)-f(2,1)}{h} \right]\\ \amp = \lim_{h \to 0} \left[\frac{1}{h} \left( \left( 5 - \frac{(2+h)^2 + 1^2}{2} \right) - \left( 5 - \frac{2^2+1^2}{2} \right) \right) \right]\\ \amp = \lim_{h \to 0} \left[\frac{1}{h} \left( -\frac{1}{2}(4+4h+h^2+1) +\frac{1}{2}(4+1) \right) \right]\\ \amp = \lim_{h \to 0} \left[ \frac{1}{h} \left(-2h-\frac{1}{2}h^2 \right) \right]\\ \amp = -2 \end{align*}

Next, calculate the partial derivative of \(f\) with respect to \(y\) at \((2,1)\text{.}\)

\begin{align*} \frac{\partial f}{\partial y}(2,1) \amp = \lim_{h \to 0} \left[ \frac{f(2,1+h)-f(2,1)}{h} \right]\\ \amp = \lim_{h \to 0} \left[\frac{1}{h} \left( \left( 5 - \frac{2^2 + (1+h)^2}{2} \right) - \left( 5 - \frac{2^2+1^2}{2} \right) \right) \right]\\ \amp = \lim_{h \to 0} \left[\frac{1}{h} \left( -\frac{1}{2}(4+1+2h+h^2) +\frac{1}{2}(4+1) \right) \right]\\ \amp = \lim_{h \to 0} \left[ \frac{1}{h} \left(-h-\frac{1}{2}h^2 \right) \right]\\ \amp = -1 \end{align*}

If we calculate the partial derivatives of a function at the general point \((x,y)\) (as opposed to some specific point \((x_0,y_0)\)) we will obtain (instead of two specific values) two new functions of two variables.

Using the definition, calculate the partial derivatives of \(f(x,y) = xy-1\text{.}\)

Answer.

\(\dfrac{\partial f}{\partial x}(x,y) = y\) and \(\dfrac{\partial f}{\partial y}(x,y) = x\)

Solution.

Calculating the partial derivative with respect to \(x\text{:}\)

\begin{align*} \frac{\partial f}{\partial x}(x,y) \amp = \lim_{h \to 0} \left[ \frac{f(x+h,y)-f(x,y)}{h} \right]\\ \amp = \lim_{h \to 0} \left[ \frac{\left( (x+h)y-1 \right)-(xy-1)}{h} \right]\\ \amp = \lim_{h \to 0} \left[ \frac{hy}{h} \right]\\ \amp = y \end{align*}

Now, calculating the partial derivative with respect to \(y\text{:}\)

\begin{align*} \frac{\partial f}{\partial y}(x,y) \amp = \lim_{h \to 0} \left[ \frac{f(x,y+h)-f(x,y)}{h} \right]\\ \amp = \lim_{h \to 0} \left[ \frac{\left( x(y+h)-1 \right)-(xy-1)}{h} \right]\\ \amp = \lim_{h \to 0} \left[ \frac{hx}{h} \right]\\ \amp = x \end{align*}

As can be seen in the above example, to calculate the partial derivative of \(f\) with respect to \(x\) at the general point \((x,y)\) all we have to do is treat \(y\) as a constant and differentiate \(f(x,y)\) with respect to \(x\) (using all of the familiar rules of differentiation for functions of one variable). Similarly, to calculate the partial derivative of \(f\) with respect to \(y\) at the general point \((x,y)\) treat \(x\) as a constant and differentiate \(f(x,y)\) with respect to \(y\text{.}\)

Find the partial derivatives of the function \(f(x,y) = 5 - \frac{x^2+y^2}{2}\) at the point \((2,1)\) using the above method.

Answer.

\(\dfrac{\partial f}{\partial x}(2,1) = -2\) and \(\dfrac{\partial f}{\partial y}(2,1) = -1\)

Solution.

This function can be written as:

\begin{equation*} f(x,y) = 5 - \frac{1}{2}x^2 - \frac{1}{2}y^2. \end{equation*}

Now, thinking of \(y\) as a constant (so that \(\frac{1}{2}y^2\) is also constant) and treating the function as a function of \(x\) only,

\begin{equation*} \dfrac{\partial f}{\partial x}(x,y) = 0 - 2 \times \frac{1}{2}x - 0 = -x. \end{equation*}

Thus,

\begin{equation*} \dfrac{\partial f}{\partial x}(2,1) = -2. \end{equation*}

Next, think of \(x\) as a constant (so that \(\frac{1}{2}x^2\) is also constant) and treating the function as a function of \(y\) only,

\begin{equation*} \dfrac{\partial f}{\partial y}(x,y) = 0-0-2\times \frac{1}{2} y = -y. \end{equation*}

Thus,

\begin{equation*} \dfrac{\partial f}{\partial y}(2,1) = -1. \end{equation*}

A shorter notation for the partial derivative of \(f\) with respect to \(x\) is \(f_x\text{.}\) Similarly the partial derivative with respect to \(y\) is written as \(f_y\text{.}\)

Find \(f_x\) and \(f_y\) when \(f(x,y) = x^2y\text{.}\)

Answer.

\(f_x(x,y) = 2xy\) and \(f_y(x,y) = x^2\text{.}\)

Solution.

To find \(f_x (x,y)\text{,}\) think of \(y\) as a constant. Thus,

\begin{equation*} f_x(x,y) = 2xy\text{.} \end{equation*}

To find \(f_y (x,y)\text{,}\) think of \(x\) as a constant. So,

\begin{equation*} f_y(x,y) = x^2\text{.} \end{equation*}

Find \(f_x\) and \(f_y\) when \(f(x,y) = \sin^{-1}\left(\dfrac{x}{y}\right) - 5x^2\text{.}\)

Answer.

\(f_x(x,y) =\dfrac{1}{\sqrt{y^2 - x^2}} - 10x\) and \(f_y(x,y)= \dfrac{-x}{y\sqrt{y^2-x^2}}.\)

Solution.

To find \(f_x (x,y)\text{,}\) think of \(y\) as a constant. Thus, using the chain rule:

\begin{align*} f_x(x,y) \amp = \frac{1}{\sqrt{1 - \left(\dfrac{x}{y}\right)^2 }} \cdot \frac{1}{y} - 10x\\ \amp = \frac{1}{\sqrt{y^2 - x^2}} - 10x\text{.} \end{align*}

To find \(f_y (x,y)\text{,}\) think of \(x\) as a constant. Again, using the chain rule:

\begin{align*} f_y(x,y) \amp = \frac{1}{\sqrt{1 - \left(\dfrac{x}{y}\right)^2 }} \cdot \left( \frac{-x}{y^2} \right) - 0\\ \amp = \frac{-x}{y\sqrt{y^2-x^2}}. \end{align*}

The equation \(xz + y^2z^3 = 2\) can be thought of as implicitly defining \(z\) as a function of \(x\) and \(y\text{.}\) Find \(z_x\) and \(z_y\text{.}\)

Answer.

\(z_x = \dfrac{-z}{x+3y^2 z^2}\) and \(z_y =\dfrac{-2yz^3}{x+3y^2 z^2}\)

Solution.

To find \(z_x\) differentiate both sides of the defining equation with respect to \(x\text{,}\) remembering that \(z\) is some unknown function of \(x\text{.}\) Also, remember to treat \(y\) as a constant. Then, using the product rule and the chain rule,

\begin{align*} \frac{\partial}{\partial x} \left(xz + y^2z^3 \right) \amp = \frac{\partial}{\partial x} (2)\\ xz_x + z + 3y^2 z^2 z_x \amp = 0\\ z_x (x+3y^2 z^2) \amp = -z\\ z_x \amp = \frac{-z}{x+3y^2 z^2} \end{align*}

Similarly, differentiating both sides of the defining equation with respect to \(y\text{,}\)

\begin{align*} \frac{\partial}{\partial y} \left(xz + y^2z^3 \right) \amp = \frac{\partial}{\partial y} (2)\\ xz_y + 2yz^3 + 3y^2 z^2 z_y \amp = 0\\ z_y (x+3y^2 z^2) \amp = -2yz^3\\ z_y \amp = \frac{-2yz^3}{x+3y^2 z^2} \end{align*}

Partial derivatives can be found for functions of more than two variables.

Find the partial derivatives for the function of three variables

\begin{equation*} f(x,y,z) = (2x+3y-z^2)e^{xz}\text{.} \end{equation*}
Answer.

\(f_x(x,y,z) = e^{xz} (2xz + 3yz - z^3 + 2)\text{,}\) \(f_y(x,y,z) = 3e^{xz}\) and \(f_z(x,y,z) = e^{xz} (2x^2 + 3xy - xz^2 - 2z)\)

Solution.

Write the function as

\begin{equation*} f(x,y,z) = 2xe^{xz} + 3ye^{xz} - z^2 e^{xz}\text{.} \end{equation*}

To find \(f_x\) treat \(y\) and \(z\) as constants and think of \(f\) as a function of \(x\) only. Thus,

\begin{align*} f_x(x,y,z) \amp = (2xz e^{xz} + 2e^{xz} ) + 3yze^{xz} - z^3 e^{xz}\\ \amp = e^{xz} (2xz + 3yz - z^3 + 2) \end{align*}

To find \(f_y\) treat \(x\) and \(z\) as constants and think of \(f\) as a function of \(y\) only. Thus,

\begin{align*} f_y(x,y,z) \amp = 0 + 3e^{xz} - 0\\ \amp = 3e^{xz} \end{align*}

Finally, to find \(f_z\) treat \(x\) and \(y\) as constants and think of \(f\) as a function of \(z\) only. Thus,

\begin{align*} f_z(x,y,z) \amp = 2x^2 e^{xz} + 3xye^{xz} - (xz^2e^{xz} + 2ze^{xz} )\\ \amp = e^{xz} (2x^2 + 3xy - xz^2 - 2z) \end{align*}

Exercises Example Tasks

1.

Find both partial derivatives of the function \(f(x,y)=4-xy-y^2\) at the point \((3,2)\text{.}\)

2.

Find \(\dfrac{\partial f}{\partial x}\) and \(\dfrac{\partial f}{\partial y}\) when \(f(x,y) = \ln(x^2-4xy^3)\text{.}\)

3.

If \(L(x,y) = \dfrac{e^{xy}}{(1-x)(1-y)}\text{,}\) find \(L_x(2,3)\text{.}\)

4.

Find \(f_x(x,y)\) and \(f_y(x,y)\) when \(f(x,y) = x^y\text{.}\)

5.

In the following contour plot the contours are for evenly spaced values of \(k\) from \(-2\) at the point \(X\) to \(2\) at the point \(Y\text{.}\) Find the sign of \(f_x(x,y)\) and \(f_y(x,y)\) at the points \(A\text{,}\) \(B\) and \(C\) given the following contour plot for the function \(f(x,y)\text{.}\) Explain your thinking.

Figure 4.1.15.