Skip to content

Partial derivatives, explained with worked examples

5 min read

Short answer

A partial derivative measures how a function of several variables changes when you move one variable and hold the others fixed. To compute ∂f/∂x\partial f/\partial x, treat every other variable as a constant and differentiate with respect to xx as usual.

Slice of the surface z equals x squared times y at y equals 2, with a tangent of slope 4 at x equals 1x = 1slope 4z = x²y with y fixed at 2 → z = 2x²∂f/∂x at (1, 2) = 4
For f(x, y) = x²y, freezing y = 2 slices the surface into the curve z = 2x². Its slope at x = 1 is 4, which is ∂f/∂x there.

The picture: slice, then take the slope

The graph of f(x,y)f(x,y) is a surface. Fix y=y0y=y_0 and you cut the surface with a vertical plane, leaving an ordinary curve in xx. The slope of that curve is ∂f/∂x\partial f/\partial x. Fix x=x0x=x_0 instead and you get ∂f/∂y\partial f/\partial y. Together they describe the tilt of the surface along the two axes, which is exactly what the gradient collects into one vector.

The method

  1. Choose the variable you are differentiating by.
  2. Treat all other variables as constants (numbers).
  3. Differentiate with the usual single-variable rules.

Notation: fxf_x, ∂f/∂x\partial f/\partial x and ∂xf\partial_x f all mean the same thing. Second partials differentiate again; the mixed ones fxyf_{xy} and fyxf_{yx} are equal whenever they are continuous (Clairaut's theorem), which is a handy check.

Worked example

Let f(x,y)=x2y+3y2f(x,y)=x^2y+3y^2. Find fxf_x, fyf_y and their values at (1,2)(1,2).

fxf_x: treat yy as a constant. ∂∂x(x2y)=2xy\dfrac{\partial}{\partial x}(x^2y)=2xy and 3y23y^2 is constant, so fx=2xyf_x=2xy.

fyf_y: treat xx as a constant. ∂∂y(x2y)=x2\dfrac{\partial}{\partial y}(x^2y)=x^2 and ∂∂y(3y2)=6y\dfrac{\partial}{\partial y}(3y^2)=6y, so fy=x2+6yf_y=x^2+6y.

At (1,2)(1,2): fx=2⋅1⋅2=4f_x=2\cdot1\cdot2=4 and fy=1+12=13f_y=1+12=13. Moving in the xx-direction the surface rises at slope 4; moving in yy it rises at slope 13.

Try it yourself

For f(x,y)=x3−2xy2+yf(x,y)=x^3-2xy^2+y, find fxf_x, fyf_y at (2,1)(2,1), and confirm fxy=fyxf_{xy}=f_{yx}.

Show the answer

fx=3x2−2y2f_x=3x^2-2y^2 and fy=−4xy+1f_y=-4xy+1. At (2,1)(2,1): fx=12−2=10f_x=12-2=10 and fy=−8+1=−7f_y=-8+1=-7. Mixed partials: fxy=∂y(3x2−2y2)=−4yf_{xy}=\partial_y(3x^2-2y^2)=-4y and fyx=∂x(−4xy+1)=−4yf_{yx}=\partial_x(-4xy+1)=-4y. They match.

Keep going with practice

Partial derivatives open Vidi's Multivariable & Vector Calculus course, with interactive 3D surfaces where you can see the slices.