BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

Differentials and the chain rule

The total differential df = f_x dx + f_y dy + f_z dz records how changes in x, y, z affect f. It is not a number like Δf, but it can be used in two ways: replace dx, dy, dz by small changes to get the approximation formula, or divide by dt to get the chain rule df/dt = f_x dx/dt + f_y dy/dt + f_z dz/dt. The chain rule gives the product and quotient rules, and extends to new variables: ∂f/∂u = f_x x_u + f_y y_u. Partial derivatives cannot be 'simplified' like fractions.

You need this first

Full reading path (10 pages)
  1. Vectors (8.01)
  2. Vectors and the dot product (18.02)
  3. Determinants and the cross product (18.02)
  4. Planes through three points, and matrices (18.02)
  5. Equations of planes and square systems (18.02)
  6. Parametric equations of lines and the cycloid (18.02)
  7. Velocity, acceleration and Kepler's second law (18.02)
  8. Functions of two variables and partial derivatives (18.02)
  9. Tangent planes, critical points and least squares (18.02)
  10. The second derivative test (18.02)
On this page · 6 sections
  1. Differentials in one variable
  2. The total differential
  3. Why the chain rule holds
  4. Product and quotient rules
  5. The chain rule with new variables
  6. Summary

After partial derivatives and extremes, the next step is to describe how a function of several variables changes in every way at once. The tool is the differential (transcript, p. 1).

Differentials in one variable#

In one variable, y=f(x)y = f(x) gives dy=f′(x) dxdy = f'(x)\,dx, relating small changes in yy and xx; this is implicit differentiation (transcript, p. 1). It finds dy/dxdy/dx and also its reciprocal. For y=sin⁡−1xy = \sin^{-1}x: x=sin⁡yx = \sin y, so dx=cos⁡y dydx = \cos y\,dy, and (p. 1; notes, p. 1):

Derivative of the inverse sine
dydx=1cos⁡y=11−x2\frac{dy}{dx} = \frac{1}{\cos y} = \frac{1}{\sqrt{1 - x^2}}
In words

d y over d x equals 1 over the quantity cos y, equals 1 over the square root of 1 minus x squared, end of root

(18.01 did the same in implicit differentiation.)

The total differential#

For a function of several variables, the total differential collects all the contributions that can make ff change (transcript, p. 1; notes, p. 1):

Total differential
df=fx dx+fy dy+fz dz=∂f∂xdx+∂f∂ydy+∂f∂zdzdf = f_x\,dx + f_y\,dy + f_z\,dz = \frac{\partial f}{\partial x}dx + \frac{\partial f}{\partial y}dy + \frac{\partial f}{\partial z}dz
In words

d f equals f sub x d x plus f sub y d y plus f sub z d z equals partial f over partial x, times d x plus partial f over partial y, times d y plus partial f over partial z, times d z

Differentials are a new kind of object: not numbers, not vectors, not matrices, with their own rules. In particular dfdf is not the same as Δf\Delta f: Δf\Delta f is a number once Δx\Delta x, Δy\Delta y, Δz\Delta z are, while dfdf can only be expressed in terms of other differentials (p. 1; notes, p. 1). (Auroux warns that the course textbook mixes dd and Δ\Delta in a few formulas, and says not to, p. 1.) A differential records how changes in xx, yy, zz affect ff, and it can be used in two ways (p. 1; notes, p. 1):

  1. As a placeholder for small changes: replacing dxdx, dydy, dzdz by Δx\Delta x, Δy\Delta y, Δz\Delta z gives the approximation formula, the tangent plane, Δf≈fx Δx+fy Δy+fz Δz\Delta f \approx f_x\,\Delta x + f_y\,\Delta y + f_z\,\Delta z. Note == for differentials but ≈\approx for the numbers.
  2. Divided by dtdt: if xx, yy, zz depend on a parameter tt, so does ff, and its rate of change is the chain rule (p. 1; notes, p. 1):
Chain rule
dfdt=fx dxdt+fy dydt+fz dzdt\frac{df}{dt} = f_x\,\frac{dx}{dt} + f_y\,\frac{dy}{dt} + f_z\,\frac{dz}{dt}
In words

d f over d t equals f sub x d x over d t plus f sub y d y over d t plus f sub z d z over d t

Source: 18.02 lecture summaries, Week 5 (Prof. Auroux), Lecture 11, p. 1, Lecture 11, p. 1

Why the chain rule holds#

First argument: dx=x′(t) dtdx = x'(t)\,dt, dy=y′(t) dtdy = y'(t)\,dt, dz=z′(t) dtdz = z'(t)\,dt; substituting into dfdf gives df=(fxx′(t)+fyy′(t)+fzz′(t)) dtdf = (f_x x'(t) + f_y y'(t) + f_z z'(t))\,dt, and the coefficient of dtdt is df/dtdf/dt (transcript, p. 2; notes, p. 1). But that uses differentials before we trust them (p. 2).

Better: start from the approximation formula, which we trust, for the changes in a short time Δt\Delta t, and divide by the number Δt\Delta t (p. 2; notes, p. 1):

Dividing the approximation by Δt
ΔfΔt≈fx ΔxΔt+fy ΔyΔt+fz ΔzΔt\frac{\Delta f}{\Delta t} \approx f_x\,\frac{\Delta x}{\Delta t} + f_y\,\frac{\Delta y}{\Delta t} + f_z\,\frac{\Delta z}{\Delta t}
In words

capital delta f over the quantity capital delta t, is approximately f sub x capital delta x over the quantity capital delta t, plus f sub y capital delta y over the quantity capital delta t, plus f sub z capital delta z over the quantity capital delta t

As Δt→0\Delta t \to 0 each ratio tends to a derivative and the approximation becomes exact (p. 2).

Check on an example. The lecture takes w=x2y+zw = x^2 y + z with x=tx = t, y=ety = e^t, z=sin⁡tz = \sin t (p. 2; notes, p. 1). The chain rule gives dw/dt=2xy⋅1+x2⋅et+1⋅cos⁡t=2tet+t2et+cos⁡tdw/dt = 2xy \cdot 1 + x^2 \cdot e^t + 1 \cdot \cos t = 2te^t + t^2e^t + \cos t. Substituting first, w=t2et+sin⁡tw = t^2e^t + \sin t, and the one-variable product rule gives the same (p. 2). Here both ways are equally long; when ff is complicated, or only its partial derivatives are known, the chain rule is the way (p. 2).

Product and quotient rules#

The chain rule explains the rules of single-variable calculus (transcript, p. 2; notes, p. 1). Take f=uvf = uv as a function of two variables, with uu and vv functions of tt. Since fu=vf_u = v and fv=uf_v = u (p. 2):

Product rule from the chain rule
d(uv)dt=fu dudt+fv dvdt=v dudt+u dvdt\frac{d(uv)}{dt} = f_u\,\frac{du}{dt} + f_v\,\frac{dv}{dt} = v\,\frac{du}{dt} + u\,\frac{dv}{dt}
In words

d(u v) over d t equals f sub u d u over d t plus f sub v d v over d t equals v d u over d t plus u d v over d t

Likewise g=u/vg = u/v has gu=1/vg_u = 1/v and gv=−u/v2g_v = -u/v^2, so ddtuv=1vdudt−uv2dvdt\frac{d}{dt}\frac uv = \frac1v\frac{du}{dt} - \frac{u}{v^2}\frac{dv}{dt}, which over the common denominator v2v^2 is the usual quotient rule (pp. 2–3; notes, p. 1).

The chain rule with new variables#

Now let w=f(x,y)w = f(x, y) where xx and yy are themselves functions of two variables uu and vv, as when switching between rectangular and polar coordinates. To find ∂w/∂u\partial w/\partial u without substituting (possibly messy) formulas, we need fxf_x, fyf_y and the partials xux_u, xvx_v, yuy_u, yvy_v (transcript, p. 3; notes, p. 1). Differentials do it (p. 3; notes, p. 1):

Substituting differentials
dw=fx dx+fy dy=fx(xu du+xv dv)+fy(yu du+yv dv)=(fxxu+fyyu) du+(fxxv+fyyv) dvdw = f_x\,dx + f_y\,dy = f_x(x_u\,du + x_v\,dv) + f_y(y_u\,du + y_v\,dv) = (f_x x_u + f_y y_u)\,du + (f_x x_v + f_y y_v)\,dv
In words

d w equals f sub x d x plus f sub y d y equals f sub x the quantity x sub u d u plus x sub v d v, all plus f sub y the quantity y sub u d u plus y sub v d v, equals the quantity f sub x x sub u plus f sub y y sub u, d u plus the quantity f sub x x sub v plus f sub y y sub v, d v

The coefficient of dudu is the rate of change with uu when vv is held fixed, so (p. 3; notes, p. 1):

Chain rule in two new variables
∂f∂u=∂f∂x∂x∂u+∂f∂y∂y∂u,∂f∂v=∂f∂x∂x∂v+∂f∂y∂y∂v\frac{\partial f}{\partial u} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial u} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial u}, \qquad \frac{\partial f}{\partial v} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial v} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial v}
In words

partial f over partial u equals partial f over partial x, times partial x over partial u plus partial f over partial y, times partial y over partial u, partial f over partial v equals partial f over partial x, times partial x over partial v plus partial f over partial y, times partial y over partial v

The structure is easy to remember: ff depends on xx and yy, which depend on uu. Changing uu changes xx at the rate ∂x/∂u\partial x/\partial u, which changes ff at ∂f/∂x\partial f/\partial x times that; yy changes at the same time, and the two effects add (p. 3). More variables just mean more terms, and repeated substitutions can be done one chain rule at a time (pp. 3–4).

Do not "simplify". Cancelling the ∂x\partial x's and ∂y\partial y's would give ∂f/∂u=∂f/∂u+∂f/∂u\partial f/\partial u = \partial f/\partial u + \partial f/\partial u, which is absurd. Partial derivatives are not fractions, because each holds different variables fixed; the curly ∂\partial is there to warn against this (p. 3; notes, p. 1). And "∂f\partial f" alone means nothing; only ∂f/∂(a variable)\partial f/\partial(\text{a variable}) does, while dfdf is the total change (p. 4).

Polar coordinates. With x=rcos⁡θx = r\cos\theta, y=rsin⁡θy = r\sin\theta, a function of xx and yy becomes a function of rr and θ\theta, and (p. 4; notes, p. 1):

The r-derivative in polar coordinates
fr=fx xr+fy yr=cos⁡θ fx+sin⁡θ fyf_r = f_x\,x_r + f_y\,y_r = \cos\theta\,f_x + \sin\theta\,f_y
In words

f sub r equals f sub x x sub r plus f sub y y sub r equals cos theta f sub x plus sine theta f sub y

and fθf_\theta the same way. (Next lecture: the gradient, a vector whose components are the partial derivatives, p. 4.)

Worked example

A chain rule along a circle, and a polar check

(a) Let w=xy2w = xy^2 with x=cos⁡tx = \cos t, y=sin⁡ty = \sin t. Find dw/dtdw/dt at t=π/4t = \pi/4 by the chain rule and by substitution. (b) For f=x2+y2f = x^2 + y^2, find frf_r from the polar formula and check it directly.

(a) Chain rule

wx=y2w_x = y^2, wy=2xyw_y = 2xy, dx/dt=−sin⁡tdx/dt = -\sin t, dy/dt=cos⁡tdy/dt = \cos t. At t=π/4t = \pi/4, x=y=2/2≈0.7071x = y = \sqrt2/2 \approx 0.7071, so dw/dt=y2(−sin⁡t)+2xycos⁡t=0.5(−0.7071)+2(0.5)(0.7071)=−0.3536+0.7071≈0.354dw/dt = y^2(-\sin t) + 2xy\cos t = 0.5(-0.7071) + 2(0.5)(0.7071) = -0.3536 + 0.7071 \approx 0.354.

(a) Substitution

w=cos⁡tsin⁡2tw = \cos t\sin^2 t, so dw/dt=−sin⁡3t+2sin⁡tcos⁡2tdw/dt = -\sin^3 t + 2\sin t\cos^2 t. At t=π/4t = \pi/4: −0.3536+0.7071≈0.354-0.3536 + 0.7071 \approx 0.354. The same.

(b) Polar coordinates

fx=2xf_x = 2x, fy=2yf_y = 2y, so fr=cos⁡θ⋅2rcos⁡θ+sin⁡θ⋅2rsin⁡θ=2rf_r = \cos\theta \cdot 2r\cos\theta + \sin\theta \cdot 2r\sin\theta = 2r. Directly, f=r2f = r^2 in polar coordinates, and df/dr=2rdf/dr = 2r.

Summary#

  • The total differential df=fx dx+fy dy+fz dzdf = f_x\,dx + f_y\,dy + f_z\,dz is not a number; df≠Δfdf \ne \Delta f.
  • Replacing dx,dy,dzdx, dy, dz by small changes gives the approximation Δf≈fxΔx+fyΔy+fzΔz\Delta f \approx f_x\Delta x + f_y\Delta y + f_z\Delta z; dividing by dtdt gives the chain rule df/dt=fx dx/dt+fy dy/dt+fz dz/dtdf/dt = f_x\,dx/dt + f_y\,dy/dt + f_z\,dz/dt.
  • The chain rule gives the product and quotient rules.
  • With new variables: ∂f/∂u=fxxu+fyyu\partial f/\partial u = f_x x_u + f_y y_u (and likewise for vv); in polar coordinates fr=cos⁡θfx+sin⁡θfyf_r = \cos\theta f_x + \sin\theta f_y.
  • Partial derivatives cannot be cancelled like fractions.

Symbols on this page

Show the 51 symbols used here
Δ\Delta capital delta.
A change or difference in a quantity, e.g. Δx = x₂ − x₁. Say it: “capital delta”.
θ\theta theta.
An angle. Say it: “theta” (sounds like “thay-ta or thee-ta”).
π\pi pi.
The ratio of a circle's circumference to its diameter, π ≈ 3.14159. Say it: “pi”.
ρ\rho rho.
Density: mass (or energy divided by c²) per unit volume. ρ_c is the critical density, ρ̄ the mean density. Unit: kg/m³ (on some pages an energy density in natural units: GeV⁴, eV/cm³). Say it: “rho”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
∝\propto proportional to.
Is proportional to: doubling one doubles the other. Say it: “is proportional to”.
≠\neq not equal.
Is not equal to. Say it: “is not equal to”.
→\to arrow.
Goes to (tends to), or becomes. Say it: “goes to”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
∂\partial partial.
Partial derivative: the rate of change with one variable, holding the others fixed. Say it: “partial”.
sin⁡\sin sine.
Sine of an angle. Say it: “sine”.
cos⁡\cos cosine.
Cosine of an angle. Say it: “cos”.
aa a.
In the cosmology note, the scale factor of the universe. Say it: “a”.
HH H.
In the cosmology note, the Hubble expansion rate ȧ/a. Unit: 1/s. Say it: “H”.
zz z.
The third variable of the function. Say it: “z”.
cc c.
In the cosmology note, the speed of light. Unit: m/s. Say it: “c”.
xx x.
A variable of the function (in the first example, x = sin y). Say it: “x”.
yy y.
A variable of the function (in the first example, y = arcsin x). Say it: “y”.
tt t.
A parameter (time) on which x, y, z depend. Unit: s. Say it: “t”.
dd d.
The d of a differential (dx, df) or of a derivative (df/dt). Say it: “d”.
ee e.
The base of natural logarithms, about 2.718. Say it: “e”.
ff f.
A function of several variables, such as f(x, y, z). Say it: “f”.
gg g.
The quotient g = u/v, as a function of u and v. Say it: “g”.
vv v.
A second new variable; in the product and quotient rules, a function of t. Say it: “v”.
rr r.
The polar distance from the origin. Say it: “r”.
pp p.
In the cosmology note, pressure. Unit: Pa. Say it: “p”.
f′f' f prime.
The derivative of a function of one variable. Say it: “f prime”.
y′y' y prime.
The derivative dy/dt. Say it: “y prime”.
uu u.
A new variable that x and y depend on; in the product and quotient rules, a function of t. Say it: “u”.
ww w.
The value of the function, w = f(x, y) or f(x, y, z). Say it: “w”.
x′x' x prime.
The derivative dx/dt. Say it: “x prime”.
a˙\dot{a} a dot.
The rate of change of a with time, ȧ = da/dt: how fast the scale factor grows. Say it: “a dot”.
ρ˙\dot{\rho} rho dot.
The rate of change of the mass density with time, ρ̇ = dρ/dt. Unit: kg/(m³·s). Say it: “rho dot”.
z′z' z prime.
The derivative dz/dt. Say it: “z prime”.
fxf_{x} f sub x.
The partial derivative ∂f/∂x. Say it: “f sub x”.
fyf_{y} f sub y.
The partial derivative ∂f/∂y. Say it: “f sub y”.
wxw_{x} w sub x.
The partial derivative ∂w/∂x. Say it: “w sub x”.
wyw_{y} w sub y.
The partial derivative ∂w/∂y. Say it: “w sub y”.
fzf_{z} f sub z.
The partial derivative ∂f/∂z. Say it: “f sub z”.
fuf_{u} f sub u.
The partial derivative of f with respect to u (here f = uv, so f_u = v). Say it: “f sub u”.
fvf_{v} f sub v.
The partial derivative of f with respect to v (here f = uv, so f_v = u). Say it: “f sub v”.
xux_{u} x sub u.
The partial derivative ∂x/∂u. Say it: “x sub u”.
xvx_{v} x sub v.
The partial derivative ∂x/∂v. Say it: “x sub v”.
yuy_{u} y sub u.
The partial derivative ∂y/∂u. Say it: “y sub u”.
yvy_{v} y sub v.
The partial derivative ∂y/∂v. Say it: “y sub v”.
frf_{r} f sub r.
The partial derivative of f with respect to the polar distance r, with θ fixed. Say it: “f sub r”.
xrx_{r} x sub r.
The partial derivative ∂x/∂r = cos θ. Say it: “x sub r”.
yry_{r} y sub r.
The partial derivative ∂y/∂r = sin θ. Say it: “y sub r”.
gug_{u} g sub u.
The partial derivative of g = u/v with respect to u, 1/v. Say it: “g sub u”.
gvg_{v} g sub v.
The partial derivative of g = u/v with respect to v, −u/v². Say it: “g sub v”.
fθf_{\theta} f sub theta.
The partial derivative of f with respect to the polar angle θ, with r fixed. Say it: “f sub theta”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 28 words used here

New here

total differential.
The expression that adds up every way a function of several variables can change: each partial derivative times the small change of its variable.

Also used

partial derivative.
The rate of change of a function of several variables with respect to one of them, while all the others are held fixed. Explained in Functions of two variables and partial derivatives.
differential.
A tiny change in a variable, such as dx, or the matching change in a function along its tangent line, dy = f′(x) dx. Explained in Differentials and antiderivatives.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
implicit differentiation.
Finding dy/dx from an equation that links x and y, by differentiating both sides and solving for dy/dx, without first solving for y. Explained in Implicit differentiation and the derivatives of inverse functions.
vector.
A quantity with both a size and a direction, such as a velocity or a force, drawn as an arrow. Explained in Vectors.
matrix.
A rectangular table of numbers, which acts on vectors to give new ones and so describes a linear change of coordinates. Explained in Planes through three points, and matrices.
tangent plane.
The flat plane that just touches a surface at a point and tilts the same way as the surface there. Explained in Tangent planes, critical points and least squares.
rate of change.
How fast one quantity changes compared with another, often time: the change in the first divided by the change in the second. Explained in Rates of change and area under a graph.
chain rule.
The rule for the derivative of a function of a function: multiply the derivative of the outer one by that of the inner one. Explained in Circular motion: polar coordinates, position and velocity.
derivative.
The rate at which a function changes as its input changes: the slope of its graph at a point. Explained in Position and velocity in one dimension.
product rule.
The rule for the derivative of a product of two functions: (fg)′ = f′g + fg′. Explained in Circular motion: tangential acceleration and angular acceleration.
quotient rule.
The rule for the derivative of a fraction of two functions: (u/v)′ = (u′v − uv′)/v².
polar coordinates.
Coordinates in a flat plane that give a point's distance r from the origin and its angle θ from a fixed direction. Explained in Vectors.
gradient.
The vector of a function's partial derivatives; it points the way the function increases fastest, and its length is that fastest rate. Explained in Graphs, straight lines and slope.
scale factor.
The number a(t) that tells how much distances in the universe have stretched: when it doubles, every distance between galaxies doubles. Explained in Towards the universe: an expanding gas cools.
density.
How much of something (mass, charge, energy, particles or probability) there is in each unit of volume, area, length or other variable. Explained in Density and pressure.
matter–radiation equality.
The moment, about 50,000 years after the Big Bang, when matter and radiation had the same energy density; after it matter dominated. Explained in Matter–radiation equality and the pressure of light.
cosmological constant.
A constant term Einstein added to his equations of gravity, equivalent to an energy density of empty space that never changes. Explained in Dark energy and the accelerating universe.
vacuum energy.
Energy that empty space itself carries, the same everywhere and unchanged as the universe expands. Explained in Dark energy and the accelerating universe.
negative pressure.
A pressure that pulls inwards, like tension in a stretched rubber sheet, rather than pushing outwards. Explained in Dark energy and the accelerating universe.

Academic

transcript.
A written record of exactly what was said in a recorded lecture, word for word.
placeholder.
A symbol or word that temporarily stands in for something to be filled in later.
approximation.
Close to, but not exactly, the true value; an approximation is such a value or formula, chosen because it is simpler.
argument.
A chain of reasoning that leads to a conclusion; in maths also the input of a function, such as x in sin x.
likewise.
In the same way; similarly.
messy.
In calculations, long and complicated, with many terms, though not hard in principle.
derive.
To obtain a result by reasoning or calculation from other known results.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

33 more cosmology pages that build on this

Pages that build on this

Practise

Check your understanding

  1. For f(x,y)=x2yf(x, y) = x^2 y, the total differential is…
  2. If w=f(x,y)w = f(x, y) with x=x(t)x = x(t), y=y(t)y = y(t), then dw/dt=dw/dt =
  3. Why can't ∂f∂x∂x∂u\dfrac{\partial f}{\partial x}\dfrac{\partial x}{\partial u} be simplified to ∂f∂u\dfrac{\partial f}{\partial u}?
0 of 3 answered

Flashcards

1 / 3