Partial Derivatives

A partial derivative measures how a function of several variables changes when one input changes and the others stay fixed. To find ∂f/∂x, treat y as a constant and differentiate with respect to x. To find ∂f/∂y, treat x as a constant. Each partial derivative is the slope of the surface in one direction.

Before this lesson: Functions of Several Variables, Limits of Multivariable Functions, Power Rule and Chain Rule

What a partial derivative means

The graph of z = f(x, y) is a surface. If you freeze y at a value b, the surface is cut by the plane y = b, and what is left is an ordinary curve z = f(x, b). Its slope at x = a is the partial derivative with respect to x, written f_x(a, b).

Freezing x instead cuts the surface in the other direction. The slope of that curve is f_y(a, b). So a function of two variables has two first-order slopes at each point, one for each input.

For example, take f(x, y) = 9 − x² − 2y² at the point (1, 1), where f = 6. The slice y = 1 is z = 7 − x², with slope −2 at x = 1. The slice x = 1 is z = 8 − 2y², with slope −4 at y = 1. So f_x(1, 1) = -2 and f_y(1, 1) = -4: the surface drops faster in the y direction.

Two graphs. Left: the slice y = 1 of f(x, y) = 9 − x² − 2y², the parabola z = 7 − x², with an orange tangent line at the point (1, 6) labeled slope f sub x (1, 1) = −2. Right: the slice x = 1, the parabola z = 8 − 2y², with an orange tangent line at (1, 6) labeled slope f sub y (1, 1) = −4.
Each partial derivative is the slope of one slice of the surface: −2 in the x direction and −4 in the y direction at (1, 1).

Partial derivative rules and notation

The partial derivatives are defined by limits, just like the ordinary derivative. Only one input moves by h.

f_x(a, b) = \lim_{h \to 0} \dfrac{f(a + h, b) - f(a, b)}{h}, \qquad f_y(a, b) = \lim_{h \to 0} \dfrac{f(a, b + h) - f(a, b)}{h}
  • Notation: f_x = \dfrac{\partial f}{\partial x} = \dfrac{\partial z}{\partial x}. The symbol ∂ is a curly d, read “partial.”
  • How to compute: treat every other variable as a constant and use the usual rules (power, product, quotient and chain rules).
  • Second partial derivatives: f_{xx}, f_{yy} and the mixed partials f_{xy} (x first, then y) and f_{yx} (y first, then x). In ∂ notation, f_{xy} = \dfrac{\partial^2 f}{\partial y \, \partial x}.
  • Clairaut’s theorem: if f_{xy} and f_{yx} are continuous near a point, they are equal there.
  • Three or more variables: the same idea works. For f(x, y, z), f_z holds x and y fixed.

Partial derivatives examples

Example 1: A polynomial

Find f_x and f_y for f(x, y) = x³ + 4x²y − 5y² + 7, then evaluate both at (1, 2).

f_x = 3x^2 + 4y(2x) - 0 + 0

Differentiate with respect to x, holding y constant: 4y is a constant factor, and −5y² and 7 are constants.

= 3x^2 + 8xy

Multiply 4y(2x).

f_y = 0 + 4x^2(1) - 5(2y) + 0

Differentiate with respect to y, holding x constant: x³ and 7 are constants, and 4x² is a constant factor.

= 4x^2 - 10y

Multiply.

f_x(1, 2) = 3(1)^2 + 8(1)(2)

Substitute x = 1 and y = 2.

= 3 + 16

Multiply.

= 19

Add.

f_y(1, 2) = 4(1)^2 - 10(2)

Substitute x = 1 and y = 2.

= 4 - 20

Multiply.

= -16

Subtract.

Answer: f_x = 3x^2 + 8xy and f_y = 4x^2 - 10y. At (1, 2), f rises at a rate of 19 per unit in the x direction and falls at a rate of 16 per unit in the y direction.

Example 2: Product and chain rules

Find f_x and f_y for f(x, y) = x e^(xy).

f_x = (1)e^{xy} + x \cdot \dfrac{\partial}{\partial x}\left(e^{xy}\right)

Use the product rule in x; y is a constant.

= e^{xy} + x \cdot e^{xy} \cdot y

The x-derivative of the inner function xy is y (see derivatives of exponential functions).

= (1 + xy)e^{xy}

Factor out e^(xy).

f_y = x \cdot \dfrac{\partial}{\partial y}\left(e^{xy}\right)

In y, the first factor x is a constant.

= x \cdot e^{xy} \cdot x

The y-derivative of the inner function xy is x.

= x^2e^{xy}

Multiply x · x.

Answer: f_x = (1 + xy)e^{xy} and f_y = x^2e^{xy}. Notice that x is a variable in one partial and a constant in the other.

Example 3: Three variables

Find all three first partial derivatives of f(x, y, z) = x²z + y ln z, and evaluate them at (3, 4, 1).

f_x = 2xz

Hold y and z constant; y ln z is a constant.

f_y = \ln z

Hold x and z constant; x²z is a constant.

f_z = x^2 + y \cdot \dfrac{1}{z}

Hold x and y constant; the derivative of ln z is 1/z (see derivatives of logarithmic functions).

= x^2 + \dfrac{y}{z}

Multiply.

f_x(3, 4, 1) = 2(3)(1)

Substitute.

= 6

Multiply.

f_y(3, 4, 1) = \ln 1

Substitute z = 1.

= 0

ln 1 = 0.

f_z(3, 4, 1) = 3^2 + \dfrac{4}{1}

Substitute.

= 9 + 4

Square and divide.

= 13

Add.

Answer: f_x = 6, f_y = 0 and f_z = 13 at (3, 4, 1). Near that point, f is most sensitive to changes in z.

Example 4: Second partial derivatives

Find all four second partial derivatives of f(x, y) = x³y² − 4xy³, and check that the mixed partials agree.

f_x = 3x^2y^2 - 4y^3

Differentiate with respect to x.

f_y = 2x^3y - 12xy^2

Differentiate with respect to y.

f_{xx} = 6xy^2

Differentiate f_x with respect to x.

f_{xy} = 6x^2y - 12y^2

Differentiate f_x with respect to y.

f_{yx} = 6x^2y - 12y^2

Differentiate f_y with respect to x.

f_{yy} = 2x^3 - 24xy

Differentiate f_y with respect to y.

Answer: f_{xx} = 6xy^2, f_{yy} = 2x^3 - 24xy, and f_{xy} = f_{yx} = 6x^2y - 12y^2, as Clairaut’s theorem predicts for a polynomial.

Example 5: Volume of a can (word problem)

A can is a cylinder with volume V = πr²h, where r is the radius and h the height in centimeters. At r = 3 cm and h = 10 cm, how fast does the volume change as each dimension grows? Which one matters more?

V_r = 2\pi rh

Hold h constant and differentiate with respect to r.

V_r(3, 10) = 2\pi(3)(10)

Substitute r = 3 and h = 10.

= 60\pi

Multiply.

\approx 188.5

Use π ≈ 3.14159.

V_h = \pi r^2

Hold r constant and differentiate with respect to h.

V_h(3, 10) = \pi(3)^2

Substitute r = 3.

= 9\pi

Square 3.

\approx 28.3

Use π ≈ 3.14159.

Answer: the volume grows about 188.5 cm³ per centimeter of radius and about 28.3 cm³ per centimeter of height. At this size, the radius matters about 6.7 times as much, because 60π ÷ 9π ≈ 6.7.

Common mistakes

MistakeExample of the errorFix
Treating the other variable as a variable\dfrac{\partial}{\partial x}(x^2y) = 2xy + x^2y is a constant, so the answer is 2xy.
Differentiating a constant term\dfrac{\partial}{\partial x}(5y^2) = 10y5y² has no x, so its x-partial is 0.
Forgetting the chain rule factor\dfrac{\partial}{\partial y}\left(e^{xy}\right) = e^{xy}Multiply by the y-derivative of xy: the answer is xe^(xy).
Substituting before differentiatingFor f = x²y, plugging in x = 1 first gives y, so “f_x(1, 2) = 0“Differentiate first (f_x = 2xy), then substitute: f_x(1, 2) = 4.
Mixing up the order in mixed partialsReading f_{xy} as “y first, then x”f_{xy} means x first, then y. For most functions in this course the two orders give the same answer anyway.

Related methods

Estimating a partial derivative from a table

When f is only known from data, estimate a partial derivative with a difference quotient that moves one input. A metal plate has temperatures f(x, y) in °C at points x cm and y cm from a corner:

Point(1.9, 3)(2, 3)(2.1, 3)
Temperature (°C)41.242.042.6

Hold y = 3 and use the two outside points: f_x(2, 3) \approx \dfrac{42.6 - 41.2}{2.1 - 1.9} = \dfrac{1.4}{0.2} = 7. The temperature rises about 7 °C per centimeter in the x direction.

Where partial derivatives lead

Partial derivatives are the building blocks of the rest of this unit. They give the tangent plane and linear approximation, the multivariable chain rule, the gradient and directional derivatives, and the second derivative test for maximums and minimums.

Practice problems

  1. Find f_x and f_y for f(x, y) = 5x² − 3xy + y³.
  2. Find f_x and f_y for f(x, y) = x⁴y³ + 2y.
  3. Find f_x and f_y for f(x, y) = sin(3x + 2y).
  4. Find f_x and f_y for f(x, y) = x/(x + y).
  5. Find f_x(1, 2) and f_y(1, 2) for f(x, y) = ln(x² + y²).
  6. Find f_x(2, -1) and f_y(2, -1) for f(x, y) = x²y + 3y.
  7. Find g_x, g_y and g_z for g(x, y, z) = xy²z³.
  8. Find all four second partial derivatives of f(x, y) = x²y³.
  9. For f(x, y) = e^(2x) cos y, find f_{xy} and f_{yx} and check that they are equal.
  10. The temperature on a metal plate is T(x, y) = 100 − x² − 3y² degrees Celsius, with x and y in centimeters. Find T_x(2, 1) and T_y(2, 1) and explain what they mean.
Show answers

1.

f_x = 10x - 3y

Hold y constant: 5x² gives 10x, −3xy gives −3y, and y³ is a constant.

f_y = -3x + 3y^2

Hold x constant: 5x² is a constant, −3xy gives −3x, and y³ gives 3y².

Answer: f_x = 10x - 3y, f_y = -3x + 3y^2

2.

f_x = 4x^3y^3

Hold y constant: y³ is a constant factor, and 2y is a constant.

f_y = 3x^4y^2 + 2

Hold x constant: x⁴ is a constant factor.

Answer: f_x = 4x^3y^3, f_y = 3x^4y^2 + 2

3.

f_x = \cos(3x + 2y) \cdot 3

Chain rule: the x-derivative of 3x + 2y is 3 (see derivatives of trig functions).

= 3\cos(3x + 2y)

Rewrite with the constant first.

f_y = \cos(3x + 2y) \cdot 2

Chain rule: the y-derivative of 3x + 2y is 2.

= 2\cos(3x + 2y)

Rewrite with the constant first.

Answer: f_x = 3\cos(3x + 2y), f_y = 2\cos(3x + 2y)

4.

f_x = \dfrac{(1)(x + y) - x(1)}{(x + y)^2}

Use the quotient rule in x; y is a constant.

= \dfrac{y}{(x + y)^2}

Simplify the numerator: x + y − x = y.

f_y = \dfrac{(0)(x + y) - x(1)}{(x + y)^2}

Quotient rule in y; the numerator x is a constant.

= \dfrac{-x}{(x + y)^2}

Simplify the numerator.

Answer: f_x = \dfrac{y}{(x + y)^2}, f_y = \dfrac{-x}{(x + y)^2}

5.

f_x = \dfrac{2x}{x^2 + y^2}

Chain rule: the derivative of ln u is u′/u, and the x-derivative of x² + y² is 2x.

f_x(1, 2) = \dfrac{2(1)}{1^2 + 2^2}

Substitute x = 1 and y = 2.

= \dfrac{2}{1 + 4}

Multiply and square.

= \dfrac{2}{5}

Add.

f_y = \dfrac{2y}{x^2 + y^2}

The y-derivative of x² + y² is 2y.

f_y(1, 2) = \dfrac{2(2)}{1^2 + 2^2}

Substitute x = 1 and y = 2.

= \dfrac{4}{1 + 4}

Multiply and square.

= \dfrac{4}{5}

Add.

Answer: f_x(1, 2) = \dfrac{2}{5}, f_y(1, 2) = \dfrac{4}{5}

6.

f_x = 2xy

Hold y constant; 3y is a constant.

f_x(2, -1) = 2(2)(-1)

Substitute x = 2 and y = −1.

= -4

Multiply.

f_y = x^2 + 3

Hold x constant: x² is a constant factor of y.

f_y(2, -1) = 2^2 + 3

Substitute x = 2.

= 4 + 3

Square 2.

= 7

Add.

Answer: f_x(2, -1) = -4, f_y(2, -1) = 7

7.

g_x = y^2z^3

Hold y and z constant.

g_y = 2xyz^3

Hold x and z constant.

g_z = 3xy^2z^2

Hold x and y constant.

Answer: g_x = y^2z^3, g_y = 2xyz^3, g_z = 3xy^2z^2

8.

f_x = 2xy^3

First partial in x.

f_y = 3x^2y^2

First partial in y.

f_{xx} = 2y^3

Differentiate f_x with respect to x.

f_{xy} = 6xy^2

Differentiate f_x with respect to y.

f_{yx} = 6xy^2

Differentiate f_y with respect to x.

f_{yy} = 6x^2y

Differentiate f_y with respect to y.

Answer: f_{xx} = 2y^3, f_{xy} = f_{yx} = 6xy^2, f_{yy} = 6x^2y

9.

f_x = 2e^{2x}\cos y

Hold y constant; chain rule on e^(2x).

f_{xy} = -2e^{2x}\sin y

Differentiate f_x with respect to y; the derivative of cos y is −sin y.

f_y = -e^{2x}\sin y

Hold x constant.

f_{yx} = -2e^{2x}\sin y

Differentiate f_y with respect to x.

Answer: f_{xy} = f_{yx} = -2e^{2x}\sin y

10.

T_x = -2x

Hold y constant.

T_x(2, 1) = -2(2)

Substitute x = 2.

= -4

Multiply.

T_y = -6y

Hold x constant.

T_y(2, 1) = -6(1)

Substitute y = 1.

= -6

Multiply.

Answer: at (2, 1), the temperature drops about 4 °C per centimeter in the x direction and about 6 °C per centimeter in the y direction.

Partial derivatives FAQ

What does a partial derivative tell you?

It tells you how fast a function changes when one input changes and all the others stay fixed. On a graph, it is the slope of the surface in the direction of that input.

How do you find a partial derivative?

Treat every variable except the one you are differentiating with respect to as a constant. Then use the ordinary derivative rules, such as the power, product, quotient and chain rules.

What is the difference between ∂ and d?

The symbol d is used for a function of one variable, as in dy/dx. The curly ∂ signals that the function has several inputs and only one of them is changing.

Are mixed partial derivatives always equal?

Almost always in practice. Clairaut’s theorem says f_{xy} = f_{yx} whenever both are continuous near the point, which is true for polynomials, exponentials, sines and cosines and most functions you meet.

Summary

  • A partial derivative changes one input and holds the others constant.
  • f_x is the slope of the surface in the x direction; f_y is the slope in the y direction.
  • Compute partials with the ordinary rules, treating the other variables as constants.
  • Second partials include the mixed partials f_{xy} and f_{yx}, which are equal for continuous second partials (Clairaut’s theorem).
  • In word problems, a partial derivative is a rate: units of output per unit of one input.

Previous lesson: Limits of Multivariable Functions

Next lesson: Tangent Planes

Back to the Calculus 3 Index