Skip to content
Tutorials Center
My learning

Topics

Lesson 11 of 39 · Partial Derivatives

Higher-Order Partial Derivatives

Compute second-order partial derivatives, understand mixed partials and Clairaut's theorem, and verify the Laplace and wave equations with sympy.

A partial derivative of a function of two variables is again a function of two variables, so you can differentiate it again. This produces higher-order partial derivatives, which describe curvature of surfaces and appear in physics equations such as the heat, wave and Laplace equations.

Second-order partials

For f(x, y) there are four second partial derivatives:

Text
f_xx = ∂/∂x (f_x) = ∂²f/∂x²
f_yy = ∂/∂y (f_y) = ∂²f/∂y²
f_xy = (f_x)_y = ∂²f/∂y∂x      (differentiate in x first, then y)
f_yx = (f_y)_x = ∂²f/∂x∂y      (differentiate in y first, then x)

Notation for mixed partials varies between books. In the subscript notation f_xy means "first x, then y". In the fraction notation ∂²f/∂y∂x means the same: read from right to left. To avoid confusion, say which variable is differentiated first.

Worked example: f(x, y) = x³y² + 4xy.

Text
f_x  = 3x²y² + 4y        f_y  = 2x³y + 4x
f_xx = 6xy²              f_yy = 2x³
f_xy = 6x²y + 4          f_yx = 6x²y + 4

The two mixed partials are equal. That is not an accident.

Clairaut's theorem

If f_xy and f_yx are both continuous on a disk around (a, b), then f_xy(a, b) = f_yx(a, b). Nearly every function you meet in practice (polynomials, exponentials, trig functions and their combinations) satisfies this, so the order of differentiation does not matter. It saves work: when finding a third derivative such as f_xyy, you may choose the easiest order.

Python Confirm Clairaut's theorem with sympy

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A counterexample, so you remember the conditions

Define f(x, y) = xy (x² - y²) / (x² + y²) for (x, y) ≠ (0, 0) and f(0, 0) = 0. A careful computation from the definition gives f_xy(0, 0) = -1 but f_yx(0, 0) = 1. The second partials are not continuous at the origin, so Clairaut's theorem does not apply. You can see this numerically with difference quotients.

Python Mixed partials that disagree

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Meaning of second partials

  • f_xx is the concavity of the slice in the x direction: positive means curving up like a bowl, negative like a cap.
  • f_yy does the same in the y direction.
  • f_xy measures how the x-slope changes as you move in y: how the surface twists.

These four numbers will return in the second-derivative test for maxima and minima.

Partial differential equations

A partial differential equation (PDE) relates partial derivatives of an unknown function. Two classic examples:

  • Laplace's equation: u_xx + u_yy = 0. It describes steady-state temperature and electric potential. For instance u = x² - y² and u = e^x sin y satisfy it.
  • Wave equation: u_tt = c² u_xx. Any function u = g(x - c t) + h(x + c t) solves it.

Worked check: u = e^x sin y. u_xx = e^x sin y, u_yy = -e^x sin y, and the sum is 0.

Python Verify solutions of Laplace and wave equations

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Second partials

f_xx Bend in x
f_yy Bend in y
f_xy Twist
1 / 2

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. For f(x, y) = x²y³, f_xy equals

    f_x = 2xy³; then differentiating in y gives 6xy².
  2. 2. Clairaut's theorem says f_xy = f_yx when

    Continuity of the mixed second partials near the point is the key hypothesis.
  3. 3. Which function satisfies Laplace's equation u_xx + u_yy = 0?

    For x² - y², u_xx = 2 and u_yy = -2, which sum to 0.
  4. 4. If f_xx > 0 at a point, the slice in the x direction there is

    A positive second derivative means the slice curves upward.

Summary

  • Differentiating partials again gives f_xx, f_yy, f_xy, f_yx.
  • Under continuity, mixed partials are equal (Clairaut); counterexamples exist when it fails.
  • Second partials measure bending and twisting of a surface.
  • PDEs such as Laplace's and the wave equation are statements about second partials; sympy can verify candidate solutions.

Next: Tangent Planes and Linear Approximation