Back to the on-screen lesson ·

Partial derivatives

Differentiating a function of several variables one variable at a time: the limit definition, the slope of a trace, the four second partials, and Clairaut's theorem on the two mixed ones.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to compute first and second partial derivatives of a function of two or three variables, read a partial derivative as the slope of a trace of the surface, evaluate one correctly at a point, and say what Clairaut's theorem guarantees about the two mixed partials and what it needs in order to guarantee it.

2. What you already have

Every differentiation rule from a first calculus course — power, product, quotient, chain — and the limits of the last lesson, which is where the definition below comes from. Nothing about the rules changes here. What changes is that there is more than one direction to differentiate in, so which derivative you mean has to be said out loud.

3. The words this lesson will use

A partial derivative is the derivative with respect to one variable while every other is held fixed, written $f_x$ or $\partial f/\partial x$. A trace is the curve you get by slicing the surface $z = f(x, y)$ with a plane $y = b$ or $x = a$; a partial derivative is the slope of a trace. A second partial differentiates twice, and a mixed partial does it once with respect to each variable. Clairaut's theorem is the statement that the two mixed partials agree when they are continuous.

4. Freeze everything but one variable

For a function of two variables, there are two derivatives at each point, defined by the same limit as always with the other variable nailed down:

$$f_x(a, b) = \lim_{h \to 0} \frac{f(a + h, b) - f(a, b)}{h}, \qquad f_y(a, b) = \lim_{h \to 0} \frac{f(a, b + h) - f(a, b)}{h}.$$

In $f_x$ only the first slot moves; $b$ never changes. So $f_x$ is an ordinary one-variable derivative of the one-variable function $x \mapsto f(x, b)$, and every rule you already know applies unchanged.

Notation. $f_x$, $\partial f/\partial x$ and $\partial z/\partial x$ all mean the same thing. The curly $\partial$ exists only to say there are other variables and they are being held still; it is not a different kind of derivative.

What it means. Slice the surface $z = f(x, y)$ with the vertical plane $y = b$. The cut is a curve, and $f_x(a, b)$ is its slope at $x = a$. Slicing with $x = a$ instead gives the curve whose slope is $f_y(a, b)$. Two slices, two slopes, one point.

Higher partials. Differentiating twice gives four second derivatives:

$$f_{xx} = (f_x)_x, \quad f_{xy} = (f_x)_y, \quad f_{yx} = (f_y)_x, \quad f_{yy} = (f_y)_y.$$

The subscripts read left to right in the order the derivatives were taken. (The $\partial$ notation reads the other way, $\partial^2 f/\partial y\,\partial x$ being $f_{xy}$, which is worth knowing before you meet it in a textbook.)

Clairaut's theorem. If $f_{xy}$ and $f_{yx}$ are both continuous near a point, they are equal there. So for polynomials, exponentials, sines and anything built from them by the usual operations, the order does not matter — and computing both is a free check on the algebra.

More variables. Nothing changes. For $f(x, y, z)$ there are three first partials, and $f_z$ holds both $x$ and $y$ fixed.

Another way: picture

Stand on a hillside at a point. Face due east and the ground under your feet has some slope: that is $f_x$. Face due north without moving and it has a different slope: that is $f_y$. The hill has not changed and neither have you; only the direction you chose to measure in has, and that is why one number could never have described the slope of a surface.

Another way: steps

To compute a partial derivative:

  1. Decide which variable moves; every other is now a constant.
  2. Differentiate with the ordinary rules, treating those constants exactly as you would treat a $7$.
  3. A term with no moving variable in it differentiates to zero.
  4. Substitute the point — after differentiating, never before.
  5. For a second partial, start again from step 1 on the result, with whichever variable the next subscript names.

5. Why substituting early destroys the answer

Take $f(x, y) = x^2y$ and ask for $f_x$ at $(3, 5)$.

Done properly: $f_x = 2xy$, and at $(3, 5)$ that is $30$.

Done by substituting first: put $x = 3$ into $f$ to get $9y$, then differentiate with respect to $x$ — and $9y$ has no $x$ in it, so the answer is $0$. The two answers are not close; one of them is not an answer at all.

The reason is that differentiating asks how the value changes as $x$ moves, and substituting $x = 3$ has already stopped it moving. The point is where the slope is evaluated, not part of the function being differentiated. This is the single most common wrong answer on a first exercise sheet in this subject, and it is worth writing the general derivative on its own line every time, before any number goes in.

Substituting the other variable early is harmless — $y = 5$ gives $5x^2$, whose derivative is $10x$, which is $30$ at $x = 3$. Harmless, but it hides the general formula, and the general formula is what the next four lessons need.

6. Where this goes wrong

Substituting the point before differentiating. Above. It silently returns zero, which looks like an answer.

Forgetting that a frozen variable survives. $f_x$ of $x^2y$ is $2xy$, not $2x$. The $y$ was a constant for the length of the differentiation, and a constant multiplier stays in the answer.

Reading the subscripts backwards. $f_{xy}$ is $x$ first. With Clairaut's theorem in force it rarely costs anything, and on the day it does — a function whose second partials are not continuous — it costs everything.

Quoting Clairaut without its hypothesis. The theorem needs the mixed partials to be continuous near the point. There are standard functions where they are not and where $f_{xy}(0,0) \ne f_{yx}(0,0)$, and they are the reason the hypothesis is stated rather than assumed. A third coordinate is not a third term bolted onto a two-dimensional formula. The cross product exists only in space, a plane is fixed by a direction rather than by a slope, and a curve in space can bend without ever leaving a surface. Checking a new formula against the plane is worth doing; assuming the plane's formula still governs is how most of the errors in this course begin.

7. A partial derivative is not the rate of change of the function

It is the rate of change of the function in one coordinate direction, and there are infinitely many other directions. A point where $f_x = 0$ and $f_y = 0$ is not a point where nothing is changing; it is a point where nothing is changing along the two axes, and lesson 18 will show that this is enough to pin the behaviour down only because every other direction is a combination of those two.

The habit that keeps this straight is to say the clause out loud: the rate of change of pressure with respect to temperature, at constant volume. Physics and economics write that clause explicitly, often as a subscript on the derivative, because in those subjects the same symbol with a different variable held fixed is a different measurable quantity — and reporting one for the other is a real error with real consequences, not a notational slip.

8. Two first partials and a check

  1. For $f(x, y) = 4x^3y^2 - 7y$, hold $y$ fixed: $f_x = 12x^2y^2$, since $-7y$ has no $x$ in it.

    A term without the moving variable differentiates to zero.

  2. Hold $x$ fixed instead: $f_y = 8x^3y - 7$.

    Now the first term keeps its $x^3$ as a constant.

  3. Differentiating $f_x$ by $y$ gives $24x^2y$; differentiating $f_y$ by $x$ gives $24x^2y$ as well.

    The two mixed partials agree, exactly as Clairaut's theorem promises.

9. A partial derivative that answers a question

  1. A firm's output is $P(L, K) = 100L^{1/2}K^{1/2}$ for labour $L$ and capital $K$. Then $P_L = 50L^{-1/2}K^{1/2}$.

    Hold capital fixed and differentiate in labour.

  2. At $L = 100$, $K = 400$ this is $50 \cdot \tfrac{1}{10} \cdot 20 = 100$.

    Substitute only after differentiating.

  3. So one more unit of labour, with capital unchanged, adds about $100$ units of output. The phrase with capital unchanged is not decoration: it is what the partial derivative means, and a firm that expands both at once is asking a different question.

    A partial derivative always comes with a clause saying what was held still.

10. Your turn: all four second partials of a function of two variables

  1. For $f(x, y) = x^3y - 2xy^4$, first partials: $f_x = 3x^2y - 2y^4$ and $f_y = x^3 - 8xy^3$.

    Freeze one variable at a time.

  2. Differentiating again: $f_{xx} = 6xy$ and $f_{yy} = -24xy^2$.

  3. Your turn: work this step out. Its working is at the end of the packet.

    And the mixed ones: $f_{xy} = 3x^2 - 8y^3$ from $f_x$, and $f_{yx} = 3x^2 - 8y^3$ from $f_y$. They agree, so the four second partials are really three numbers — which is why the matrix of second derivatives in lesson 19 is symmetric, and why its test has the shape it does.

11. Guided practice

For $f(x, y) = 5x^2y + 3y^2$, fill in the three derivatives at the point $(1, 4)$.

Value at the point
The derivative with respect to x
The derivative with respect to y
The mixed second derivative

12. Guided practice

For $f(x, y) = 2x^3y^2$, match each derivative to its expression.

$6x^2y^2$$4x^3y$$12xy^2$$12x^2y$
$f_x$
$f_y$
$f_{xx}$
$f_{xy}$

13. Practice

For $f(x, y, z) = 5xyz + 4z^2$, find $f_z$ at $(4, 4, 2)$.

Answer:

14. Practice

For $f(x, y) = 2x^2y^3 + 2x^4$, find $f_{yx}$ at $(3, 2)$.

Answer:

15. Practice

For $f(x, y) = 4x^2y + 4y^2$, fill in the three derivatives at the point $(2, 3)$.

Value at the point
The derivative with respect to x
The derivative with respect to y
The mixed second derivative

16. Somewhere new

A temperature model $T(x, y)$ is a polynomial, so all its derivatives are continuous. One engineer reports $T_{xy} = 3$ at a point and another reports $T_{yx} = 4$ there. What follows?

17. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

18. Test question

For $f(x, y) = 6x^3y^2$, match each derivative to its expression.

$18x^2y^2$$12x^3y$$36xy^2$$36x^2y$
$f_x$
$f_y$
$f_{xx}$
$f_{xy}$

19. What you can do now

You can freeze every variable but one, differentiate, and only then substitute the point; and you can say why the two mixed second partials agree for the functions you will meet. Next: the tangent plane, which assembles the two partial derivatives into one linear approximation.

Working for the steps left to you

10. Your turn: all four second partials of a function of two variables, step 3