Learning Outcomes
- Calculate the partial derivatives of a function of two variables.
- Calculate the partial derivatives of a function of more than two variables.
Derivatives of a Function of Two Variables
When studying derivatives of functions of one variable, we found that one interpretation of the derivative is an instantaneous rate of change of yy as a function of xx. Leibniz notation for the derivative is dy/dxdy/dx, which implies that yy is the dependent variable and xx is the independent variable. For a function z=f(x, y)z=f(x, y) of two variables, xx and yy are the independent variables and zz is the dependent variable. This raises two questions right away: How do we adapt Leibniz notation for functions of two variables? Also, what is an interpretation of the derivative? The answer lies in partial derivatives.
Definition
Let f(x, y)f(x, y) be a function fo two variables. Then the partial derivative of ff with respect to xx, written as ∂f/∂x∂f/∂x, or fxfx, is defined as
The partial derivative of ff with respect to yy, written as ∂f/∂y∂f/∂y, or fyfy, is defined as
This definition shows two differences already. First, the notation changes, in the sense that we still use a version of Leibniz notation, but the dd in the original notation is replaced with the symbol ∂∂. (This rounded “dd” is usually called “partial,” so ∂f/∂x∂f/∂x is spoken as the “partial of ff with respect to xx.”) This is the first hint that we are dealing with partial derivatives. Second, we now have two different derivatives we can take, since there are two different independent variables. Depending on which variable we choose, we can come up with different partial derivatives altogether, and often do.
Example: Calculating Partial Derivatives from the Definition
Use the definition of the partial derivative as a limit to calculate ∂f/∂x∂f/∂x and ∂f/∂y∂f/∂y for the function
f(x, y)=x2−3xy+2y2−4x+5y−12f(x, y)=x2−3xy+2y2−4x+5y−12.
TRY IT
Use the definition of the partial derivative as a limit to calculate ∂f/∂x∂f/∂x and ∂f/∂y∂f/∂y for the function
f(x, y)=4x2+2xy−y2+3x−2y+5.f(x, y)=4x2+2xy−y2+3x−2y+5.
The idea to keep in mind when calculating partial derivatives is to treat all independent variables, other than the variable with respect to which we are differentiating, as constants. Then proceed to differentiate as with a function of a single variable. To see why this is true, first fix yy and define g(x)=f(x, y)g(x)=f(x, y) as a function of xx. Then
g′(x)=limh→0g(x+h)−g(x)h=limh→0f(x+h, y)−f(x, y)h=∂f∂x.g′(x)=limh→0g(x+h)−g(x)h=limh→0f(x+h, y)−f(x, y)h=∂f∂x.
The same is true for calculating the partial derivative of ff with respect to yy. This time, fix xx and define h(y)=f(x, y)h(y)=f(x, y) as a function of y.y. Then
h′(x)=limk→0h(x+h)−h(x)k=limk→0f(x, y+k)−f(x, y)k=∂f∂y.h′(x)=limk→0h(x+h)−h(x)k=limk→0f(x, y+k)−f(x, y)k=∂f∂y.
All differentiation rules from the Introduction to Derivatives apply.
Example: Calculating Partial Derivatives
Calculate ∂f/∂x∂f/∂x and ∂f/∂y∂f/∂y for the following functions by holding the opposite variable constant then differentiating:
- f(x, y)=x2−3xy+2y2−4x+5y−12f(x, y)=x2−3xy+2y2−4x+5y−12.
- g(x, y)=sin(x2y−2x+4)g(x, y)=sin(x2y−2x+4)
TRY IT
Calculate ∂f/∂x and ∂f/∂y for the function f(x, y)=tan(x3−3x2y2+2y4) by holding the opposite variable constant, then differentiating.
Watch the following video to see the worked solution to the above Try It
Try It
How can we interpret these partial derivatives? Recall that the graph of a function of two variables is a surface in R3. If we remove the limit from the definition of the partial derivative with respect to x, the difference quotient remains:
f(x+h, y)−f(x, y)h.
This resembles the difference quotient for the derivative of a function of one variable, except for the presence of the y variable. variable. Figure 1 illustrates a surface described by an arbitrary function z=f(x, y).

Figure 1. Secant line passing through the points (x,y,f(x,y)) and (x+h,y,f(x+h,y)).
In Figure 1, the value of h is positive. If we graph f(x, y) and f(x+h, y) for an arbitrary point (x, y), then the slope of the secant line passing through these two points is given by
f(x+h, y)−f(x, y)h.
This line is parallel to the x-axis. Therefore, the slope of the secant line represents an average rate of change of the function f as we travel parallel to the x-axis. As h approaches zero, the slope of the secant line approaches the slope of the tangent line.
If we chose to change y instead of x by the same incremental value h, then the secant line is parallel to the y-axisw and so is the tangent line. Therefore, ∂f/∂x represents the slope of the tangent line passing through the point (x, y, f(x, y)) parallel to the x-axis and ∂f/∂y represents the slope of the tangent line passing through the point (x, y, f(x, y)) parallel to the y-axis. If we wish to find the slope of a tangent line passing through the same point in any other direction, then we need what are called directional derivatives, which we discuss in Directional Derivatives and the Gradient.
We now return to the idea of contour maps, which we introduced in Functions of Several Variables. We can use a contour map to estimate partial derivatives of a function g(x, y).
Example: Partial DErivatives from a Contour Map
Use a contour map to estimate ∂g/∂x at the point (√5, 0) for the function
TRY IT
Use a contour map to estimate ∂f/∂y at point (0, √2) for the function
f(x, y)=x2−y2.
Compare this with the exact answer.
Functions of More Than Two Variables
Suppose we have a function of three variables, such as w=f(x, y, z). We can calculate partial derivatives of w with respect to any of the independent variables, simply as extensions of the definitions for partial derivatives of functions of two variables.
Definition
Let f(x, y, z) be a function of three variables. Then, the partial derivative of f with respect to x, written as ∂f/∂x, or fx, is defined to be
The partial derivative of f with respect to y, written as ∂f/∂y, or fy, is defined to be
The partial derivative of f with respect to z, written as ∂f/∂z, or fz, is defined to be
We can calculate a partial derivative of a function of three variables using the same idea we used for a function of two variables. Fore example, if we have a function f of x, y, and z, and we wish to calculate ∂f/∂x, then we create the other two independent variables as if they are constants, then differentiate with respect to x.
Example: Calculating partial derivatives for a Function of Three Variables
Use the limit definition of partial derivatives to calculate ∂f/∂x for the function
Then, find ∂f/∂y and ∂f/∂z by setting the other two variables constant and differentiating accordingly.
TRY IT
Use the limit definition of partial derivatives to calculate ∂f/∂x for the function
f(x, y, z)=2x2−4x2+2y2+5xz2−6x+3z−8.
Then, find ∂f/∂y and ∂f/∂z by setting the other two variables constant and differentiating accordingly.
Example: Calculating Partial Derivatives for a Function of Three Variables
Calculate the three partial derivatives of the following functions.
- f(x, y, z)=x2y−4xz+y2x−3yz
- g(x, y, z)=sin(x2y−z)+cos(x2−yz)
TRY IT
Calculate ∂f/∂x, ∂f/∂y, and ∂f/∂z for the function f(x, y, z)=sec(x2y)−tan(x3yz2).
Watch the following video to see the worked solution to the above Try It
Candela Citations
- CP 4.13. Authored by: Ryan Melton. License: CC BY: Attribution
- CP 4.16. Authored by: Ryan Melton. License: CC BY: Attribution
- Calculus Volume 3. Authored by: Gilbert Strang, Edwin (Jed) Herman. Provided by: OpenStax. Located at: https://openstax.org/books/calculus-volume-3/pages/1-introduction. License: CC BY-NC-SA: Attribution-NonCommercial-ShareAlike. License Terms: Access for free at https://openstax.org/books/calculus-volume-3/pages/1-introduction