Higher Partial Derivatives

Differentiate again, in either variable.

Differentiate again

For f(x, y) = x²y, the first partial derivatives are ∂f/∂x = 2xy and ∂f/∂y = x². Each is again a function of x and y: 2xy has a value at every point of the plane, and it changes from point to point.

So a partial derivative can be differentiated again, in x or in y. The results are the second partial derivatives. With two variables and two choices each time, there are four of them.

Twice in the same variable

Differentiate ∂f/∂x = 2xy in x again, holding y constant: the result is 2y. This is written ∂²f/∂x², and it measures how the slope in the x direction changes as you move in the x direction. It plays the part of the second derivative of the slice.

At y = 2 the slice of x²y is z = 2x², whose second derivative is 4. And ∂²f/∂x² = 2y = 4 at y = 2, as it should be.

Twice in y: ∂f/∂y = x² has no y in it, so ∂²f/∂y² = 0. Every slice with x held constant is a straight line, z = x² × y, so its gradient never changes as y changes.

Once in each

Now differentiate ∂f/∂x = 2xy in y, holding x constant: the result is 2x. This is a mixed second partial derivative, written ∂²f/∂y∂x. Read the bottom from the right: first ∂x, then ∂y.

It measures how the slope in the x direction changes as you move in the y direction. At x = 1 the x-slope 2xy is 2 when y = 1, 4 when y = 2 and 6 when y = 3: it rises by 2 for each unit of y, and ∂²f/∂y∂x = 2x = 2 there.

The other mixed derivative takes the other order: differentiate ∂f/∂y = x² in x to get ∂²f/∂x∂y = 2x. The two mixed derivatives agree here, and they agree for almost every function you will meet.

x

The x-slope of x²y, ∂f/∂x = 2xy, plotted upward against x, with y held at 1 and 3 (dashed) and at 2 (gold). Each line has gradient 2y, which is ∂²f/∂x². At x = 1 the lines are at heights 2, 4 and 6, one step of 2 apart for each unit of y, which is ∂²f/∂y∂x = 2x = 2.

All four for one function

Take f(x, y) = x³y². The first partial derivatives are ∂f/∂x = 3x²y² and ∂f/∂y = 2x³y.

Twice in x: ∂²f/∂x² = 6xy². Twice in y: ∂²f/∂y² = 2x³. Mixed: 3x²y² differentiated in y gives 6x²y, and 2x³y differentiated in x gives 6x²y as well.

At (1, 2) the four are 6 × 1 × 4 = 24, then 2 × 1 = 2, then 6 × 1 × 2 = 12 for each mixed one. Second differences with a step of 0.001 at (1, 2) give the same four values to within 0.00001.

The usual mistakes

Stopping after one differentiation. For 3x³, ∂²f/∂x² asks for two: 9x², then 18x.

Reading ∂²f/∂x² as the square of ∂f/∂x. For x²y at (1, 2), ∂f/∂x = 4 and its square is 16, but ∂²f/∂x² = 2y = 4.

Holding the wrong variable constant on the second step. In ∂²f/∂y∂x the second differentiation is in y, so x is the constant then, even though y was the constant on the first step.

A cooling rod

In the application below, the temperature u along a steel rod depends on the distance x along it and the time m. The heat equation compares ∂u/∂m with ∂²u/∂x², and the two turn out to be multiples of the same function.

Worked example: A Steel Rod Cooling With Its Ends in Ice: Checking the Heat Equation, and How Fast Its Middle Cools

Question A steel rod 100 centimeters long has both ends held in ice at 0°C. The temperature at the point x centimeters from one end, m minutes after the rod is set up, is modeled by u(x, m) = 80e−0.01msinπ x100 degrees Celsius. (a) Find ∂ u∂ m and ∂2 u∂ x2, and find the constant k for which u satisfies the heat equation ∂ u∂ m = k∂2 u∂ x2. This k is the thermal diffusivity of the steel, in square centimeters per minute. (b) Find the rate at which the middle of the rod is cooling at the start, and the time at which it is cooling at half that rate. What is its temperature then?

  1. 1.(a) Differentiate with respect to m, holding x constant, so that sinπ x100 is a constant factor: ∂ u∂ m = 80 × (−0.01)e−0.01msinπ x100 = −0.8e−0.01msinπ x100.

    4080255075100x, cm from one endu, deg Cm = 0(a) rate in m: −0.8 e−0.01msin(pi x/100)
    4080255075100x, cm from one endu, deg Cm = 0(a) rate in m: −0.8 e−0.01msin(pi x/100)
    (a) At the start the rod is 80°C at the middle and 0°C at the ends. Differentiating in m with x held constant gives the rate at which each point cools.
  2. 2.Differentiate twice with respect to x, holding m constant. The first derivative is ∂ u∂ x = 80 × π100e−0.01mcosπ x100, and the second is ∂2 u∂ x2 = −80 × π210000e−0.01msinπ x100 = −π2125e−0.01msinπ x100.

    4080255075100x, cm from one endu, deg Cm = 0bends down(a) rate in m: −0.8 e−0.01msin(pi x/100)twice in x: −(pi2/125) × the same factor
    4080255075100x, cm from one endu, deg Cm = 0bends down(a) rate in m: −0.8 e−0.01msin(pi x/100)twice in x: −(pi2/125) × the same factor
    Differentiating twice in x with m held constant measures how the profile bends. It bends downward all along the rod: each point is hotter than the average of the points on either side of it.
  3. 3.Both derivatives are multiples of e−0.01msinπ x100, so the heat equation holds at every point and every time when −0.8 = −π2125k, that is k = 0.8 × 125π2 = 100π2 ≈ 10.1 square centimeters per minute. The second derivative is negative all along the rod, so every point is cooling.

    4080255075100x, cm from one endu, deg Cm = 0bends downk = 10.1(a) rate in m: −0.8 e−0.01msin(pi x/100)twice in x: −(pi2/125) × the same factork = 0.8 × 125 / pi2= 10.1 cm2per min
    4080255075100x, cm from one endu, deg Cm = 0bends downk = 10.1(a) rate in m: −0.8 e−0.01msin(pi x/100)twice in x: −(pi2/125) × the same factork = 0.8 × 125 / pi2= 10.1 cm2per min
    The two derivatives differ only by a constant factor, so the heat equation holds with k = 100π2 ≈ 10.1 square centimeters per minute.
  4. 4.(b) At the middle, x = 50 and sinπ2 = 1, so ∂ u∂ m = −0.8e−0.01m. At the start, m = 0, the middle is cooling at 0.8°C per minute.

    4080255075100x, cm from one endu, deg Cm = 0bends downk = 10.1cooling 0.8 per min(a) rate in m: −0.8 e−0.01msin(pi x/100)twice in x: −(pi2/125) × the same factork = 0.8 × 125 / pi2= 10.1 cm2per min(b) middle, m = 0: cooling 0.8 deg C per min
    4080255075100x, cm from one endu, deg Cm = 0bends downk = 10.1cooling 0.8 per min(a) rate in m: −0.8 e−0.01msin(pi x/100)twice in x: −(pi2/125) × the same factork = 0.8 × 125 / pi2= 10.1 cm2per min(b) middle, m = 0: cooling 0.8 deg C per min
    (b) At the start the middle is cooling at 0.8°C per minute.
  5. 5.It cools at half that rate, 0.4°C per minute, when e−0.01m = 0.5, so −0.01m = ln 0.5 and m = 100ln 2 ≈ 69.3 minutes. The temperature of the middle is then 80 × 0.5 = 40°C. Check: at the middle ∂ u∂ m = −0.01u, and 0.01 × 40 = 0.4°C per minute.

    4080255075100x, cm from one endu, deg Cm = 0bends downk = 10.1cooling 0.8 per minm = 69.340(a) rate in m: −0.8 e−0.01msin(pi x/100)twice in x: −(pi2/125) × the same factork = 0.8 × 125 / pi2= 10.1 cm2per min(b) middle, m = 0: cooling 0.8 deg C per minhalf as fast when e−0.01m= 0.5: m = 69.3
    4080255075100x, cm from one endu, deg Cm = 0bends downk = 10.1cooling 0.8 per minm = 69.340(a) rate in m: −0.8 e−0.01msin(pi x/100)twice in x: −(pi2/125) × the same factork = 0.8 × 125 / pi2= 10.1 cm2per min(b) middle, m = 0: cooling 0.8 deg C per minhalf as fast when e−0.01m= 0.5: m = 69.3
    After 100ln 2 ≈ 69.3 minutes the whole profile has halved: the middle is at 40°C and cooling at 0.4°C per minute.

Answer: (a) ∂ u∂ m = −0.8e−0.01msinπ x100 and ∂2 u∂ x2 = −π2125e−0.01msinπ x100, so the heat equation holds with k = 100π2 ≈ 10.1 square centimeters per minute; (b) 0.8°C per minute at the start, and half that after 100ln 2 ≈ 69.3 minutes, when the middle is at 40°C

Common mistakes

  • Differentiating sinπ x100 as cosπ x100 and dropping the factor π100 that the chain rule brings. It appears once in each of the two differentiations, so the second derivative carries π210000.
  • Assuming the middle keeps cooling at 0.8°C per minute, and so is cooling at half the rate after 50 minutes. The rate is 0.01 times the temperature, so it falls as the rod cools, and the rate halves only after 69.3 minutes.

More partial derivatives problems, worked step by step →

Practice Higher Partial Derivatives in the app