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{.}\)
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.
At any given point \(x_0\text{,}\) \(f'(x_0)\) gives the instantaneous rate of change of the function at that point.
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.
Example 4.1.2.
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.
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.
Example 4.1.4.
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
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
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{.}\)
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)
The partial derivative of \(f\) with respect to \(y\) at the point \((x_0,y_0)\) is given by the limit (if it exists)
Example 4.1.8.
Using the definition, calculate the partial derivatives of \(f(x,y) = 5 - \dfrac{x^2+y^2}{2}\) at the point \((2,1)\text{.}\)
\(\dfrac{\partial f}{\partial x}(2,1) = -2\) and \(\dfrac{\partial f}{\partial y}(2,1) = -1\)
Firstly, calculate the partial derivative of \(f\) with respect to \(x\) at \((2,1)\text{.}\)
Next, calculate the partial derivative of \(f\) with respect to \(y\) at \((2,1)\text{.}\)
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.
Example 4.1.9.
Using the definition, calculate the partial derivatives of \(f(x,y) = xy-1\text{.}\)
\(\dfrac{\partial f}{\partial x}(x,y) = y\) and \(\dfrac{\partial f}{\partial y}(x,y) = x\)
Calculating the partial derivative with respect to \(x\text{:}\)
Now, calculating the partial derivative with respect to \(y\text{:}\)
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{.}\)
Example 4.1.10.
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.
\(\dfrac{\partial f}{\partial x}(2,1) = -2\) and \(\dfrac{\partial f}{\partial y}(2,1) = -1\)
This function can be written as:
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,
Thus,
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,
Thus,
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{.}\)
Example 4.1.11.
Find \(f_x\) and \(f_y\) when \(f(x,y) = x^2y\text{.}\)
\(f_x(x,y) = 2xy\) and \(f_y(x,y) = x^2\text{.}\)
To find \(f_x (x,y)\text{,}\) think of \(y\) as a constant. Thus,
To find \(f_y (x,y)\text{,}\) think of \(x\) as a constant. So,
Example 4.1.12.
Find \(f_x\) and \(f_y\) when \(f(x,y) = \sin^{-1}\left(\dfrac{x}{y}\right) - 5x^2\text{.}\)
\(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}}.\)
To find \(f_x (x,y)\text{,}\) think of \(y\) as a constant. Thus, using the chain rule:
To find \(f_y (x,y)\text{,}\) think of \(x\) as a constant. Again, using the chain rule:
Example 4.1.13.
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{.}\)
\(z_x = \dfrac{-z}{x+3y^2 z^2}\) and \(z_y =\dfrac{-2yz^3}{x+3y^2 z^2}\)
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,
Similarly, differentiating both sides of the defining equation with respect to \(y\text{,}\)
Partial derivatives can be found for functions of more than two variables.
Example 4.1.14.
Find the partial derivatives for the function of three variables
\(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)\)
Write the function as
To find \(f_x\) treat \(y\) and \(z\) as constants and think of \(f\) as a function of \(x\) only. Thus,
To find \(f_y\) treat \(x\) and \(z\) as constants and think of \(f\) as a function of \(y\) only. Thus,
Finally, to find \(f_z\) treat \(x\) and \(y\) as constants and think of \(f\) as a function of \(z\) only. Thus,
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.