Partial Derivatives (Multivariable Calculus)

Learn partial derivatives, total derivatives, gradients, and Jacobians (change of variables) with worked examples for physics.

  • University Physics Year 1
On this page

In physics, most quantities depend on more than one variable: V(x,y,z), T(x,y,z,t), ρ(r,θ,φ), and so on. Multivariable calculus is the toolset that lets you differentiate and integrate these functions correctly.

Why this matters + quick links

Multivariable calculus shows up constantly in UY1 physics:


1) Partial derivatives (hold the other variables constant)

If f = f(x,y), the partial derivative with respect to x is:

((∂ f)/(∂ x))(x,y) = lim _(h → 0)(f(x + h,y)-f(x,y))/h.

Interpretation: you are looking at how f changes with x while keeping y fixed.

Notation you’ll actually see in physics

You’ll often see subscripts to make “what is held constant” explicit:

((∂ f)/(∂ x))_y

means “differentiate with respect to x, holding y constant”.

Thermodynamics is full of this style:

((∂ P)/(∂ T))_V, ((∂ V)/(∂ P))_T, ((∂ S)/(∂ T))_P, etc.
Pitfall: the subscript matters

((∂ P)/(∂ T))_V and ((∂ P)/(∂ T))_S are different physical processes. Always write the “held constant” variable when it matters.

Worked example

Let

f(x,y) = x²y + sin(xy).

Then

(∂ f)/(∂ x) = 2xy + y cos(xy), (∂ f)/(∂ y) = x² + x cos(xy).
Mixed partials (when order doesn’t matter)

Under mild conditions (continuous second partial derivatives),

(∂² f)/(∂ x ∂ y) = (∂² f)/(∂ y ∂ x).

This is often used implicitly in physics derivations.

Worked example (a physics-style partial derivative)

Ideal gas written as a function P = P(V,T):

P(V,T) = nRT/V.

Then:

((∂ P)/(∂ T))_V = nR/V, ((∂ P)/(∂ V))_T = -nRT/V².
Quick checks (sign + units)
  • Sign: at fixed T, increasing V decreases P (so the derivative is negative).
  • Units: ((∂ P)/(∂ T))_V has units Pa/K, and nR/V does too.

2) Total derivative (chain rule in multivariable form)

If f = f(x,y) but x = x(t) and y = y(t), then f is indirectly a function of t. The chain rule becomes:

df/dt = ((∂ f)/(∂ x))dx/dt + ((∂ f)/(∂ y))dy/dt.

Worked example

Let f(x,y) = x²y, with x = t² and y = e^t. Then:

(∂ f)/(∂ x) = 2xy, (∂ f)/(∂ y) = x².

So

df/dt = 2xy · dx/dt + x² · dy/dt = 2xy · 2t + x² · e^t.

Substitute x = t² and y = e^t:

df/dt = (4t³ + t⁴)e^t.

A key physics variant: total derivative of a field along a moving particle

If T = T(x,y,z,t) is a temperature field, and a particle moves with position vector r(t), then the temperature experienced by the particle is T(vector r(t),t) and:

dT/dt = (∂ T)/(∂ t) + (dx/dt)(∂ T)/(∂ x) + (dy/dt)(∂ T)/(∂ y) + (dz/dt)(∂ T)/(∂ z).

In vector form:

dT/dt = (∂ T)/(∂ t) + vector v · vector ∇T, vector v = (d vector r)/dt.

Worked example (chain rule along a path)

Let

T(x,y,t) = x²y + t,

and a particle follows x = t and y = 2t.

Compute partial derivatives:

(∂ T)/(∂ t) = 1, (∂ T)/(∂ x) = 2xy, (∂ T)/(∂ y) = x².

With dx/dt = 1 and dy/dt = 2:

dT/dt = 1 + (2xy)(1) + x²(2).

Substitute x = t, y = 2t:

dT/dt = 1 + 4t² + 2t² = 1 + 6t².

3) Gradient (how a scalar field changes in space)

For a scalar field f(x,y,z), the gradient is:

vector ∇f = ((∂ f)/(∂ x),(∂ f)/(∂ y),(∂ f)/(∂ z)).

This appears directly in electromagnetism and potential theory, for example:

vector E = - vector ∇V.

This is exactly what the UY1 “potential gradient” pages mean when they say the field points in the direction of decreasing potential: UY1: Potential Gradient.

If you want the “directional rate of change” of f along a unit vector u hat, use the directional derivative:

D_(u hat)f = u hat · vector ∇f.

Worked example (gradient + directional derivative)

Let a temperature field be:

T(x,y) = x² + 2y².

Compute the gradient:

vector ∇T = ((∂ T)/(∂ x),(∂ T)/(∂ y)) = (2x,4y).

At the point (1,1):

vector ∇T(1,1) = (2,4).

Now take the unit direction u hat = (1/(square root of 2))(1,1). The directional derivative is:

D_(u hat)T = u hat · vector ∇T = (1/(square root of 2))(1,1) · (2,4) = 6/(square root of 2) = 3 square root of 2 .

Interpretation: near (1,1), T increases fastest in the direction of vector ∇T, and along u hat it increases at a rate 3 square root of 2 per unit distance.

Total differential (useful in thermodynamics)

If f = f(x,y), small changes satisfy:

df = (∂ f)/(∂ x) dx + (∂ f)/(∂ y) dy.

This is how you “propagate” small changes when multiple variables vary at once.


4) Jacobians (change of variables in integrals)

When you change coordinates, the area/volume element usually picks up a factor called a Jacobian.

In 2D, if you change variables from (u,v) to (x,y), the Jacobian determinant is:

J = |∂(x,y)/∂(u,v)| = | (∂ x)/(∂ u), (∂ x)/(∂ v); (∂ y)/(∂ u), (∂ y)/(∂ v) | .

Then:

dx dy = |J| du dv.

Example: polar coordinates in 2D,

x = r cos θ, y = r sin θ,

give the area element:

dA = r dr dθ.

Common 3D volume elements (you’ll use these a lot)

  • Cylindrical (r,θ,z):
    dV = r dr dθ dz
  • Spherical (r,θ,φ):
    dV = r² sin θ dr dθ dφ
Pitfall: missing the Jacobian factor

Forgetting the r (cylindrical) or the r² sin θ (spherical) is one of the most common integration errors in E&M and gravitation. A fast check is to integrate 1 over the region and see if you recover the known area/volume.

Worked example (polar integral over a disk)

Compute

∬_(x² + y² ≤ a²)(x² + y²) dA.

In polar, x² + y² = r² and dA = r dr dθ, so:

∫₀^2π∫₀^a r² · r dr dθ = ∫₀^2π[r⁴/4]₀^a dθ = a⁴/4 · 2π = (π a⁴)/2.

Worked example (Jacobian sanity check via area)

Compute the area of a disk x² + y² ≤ a² in polar coordinates:

∬_disk 1 dA = ∫₀^2π∫₀^a 1 · r dr dθ = ∫₀^2π[r²/2]₀^a dθ = π a².

If you forget the Jacobian factor r, you do not get the right area.


  • Vector Analysis

    ∇ operator ideas (grad/div/curl) and identities.

  • Vector calculus (integral theorems)

    Line/surface/volume integrals, Gauss’ theorem, Stokes’ theorem.

  • Euler–Lagrange equation

    Uses partial derivatives heavily in variational calculus.


Back to Mathematics for Undergraduate Physics