4.4.7Multivariable Calculus

Chain rule for multivariable functions — all cases

1,704 words8 min readdifficulty · medium6 backlinks

WHY does the multivariable chain rule even exist?

In single-variable calculus, y=f(x)y=f(x), x=g(t)x=g(t) gives dydt=dydxdxdt\dfrac{dy}{dt}=\dfrac{dy}{dx}\dfrac{dx}{dt} — one chain, one path.

But in multivariable land, an output z=f(x,y)z=f(x,y) has two doors (xx and yy). If both xx and yy depend on tt, then changing tt pushes zz through two doors at once. We must sum both pushes.


Derivation from first principles

WHAT we start from: differentiability of ff means near a point, Δz=fxΔx+fyΔy+ε1Δx+ε2Δy,\Delta z = \frac{\partial f}{\partial x}\Delta x + \frac{\partial f}{\partial y}\Delta y + \varepsilon_1\Delta x + \varepsilon_2\Delta y, where ε1,ε20\varepsilon_1,\varepsilon_2 \to 0 as (Δx,Δy)(0,0)(\Delta x,\Delta y)\to(0,0).

HOW we get the rule (case: x=x(t),y=y(t)x=x(t), y=y(t)): divide everything by Δt\Delta t: ΔzΔt=fxΔxΔt+fyΔyΔt+ε1ΔxΔt+ε2ΔyΔt.\frac{\Delta z}{\Delta t} = \frac{\partial f}{\partial x}\frac{\Delta x}{\Delta t} + \frac{\partial f}{\partial y}\frac{\Delta y}{\Delta t} + \varepsilon_1\frac{\Delta x}{\Delta t} + \varepsilon_2\frac{\Delta y}{\Delta t}.

Why this step? We want a rate with respect to tt, so we measure each change per unit Δt\Delta t.

Take Δt0\Delta t \to 0. Then Δx,Δy0\Delta x,\Delta y \to 0 (continuity), so ε1,ε20\varepsilon_1,\varepsilon_2\to 0, and the last two terms vanish:


The complete catalogue of cases

Figure — Chain rule for multivariable functions — all cases

Case 2 — two independent variables: z=f(x,y)z=f(x,y), x=x(s,t)x=x(s,t), y=y(s,t)y=y(s,t)

Case 3 — general (the formula that contains all others)

Let u=f(x1,,xn)u=f(x_1,\dots,x_n) with each xi=xi(t1,,tm)x_i = x_i(t_1,\dots,t_m).


Worked examples


Steel-man your mistakes


Recall Feynman: explain it to a 12-year-old

Imagine a factory making cookies (the output). The number of cookies depends on flour and sugar. But flour and sugar both come from the same farm, and the farm's harvest depends on rain. If rain goes up, MORE flour AND MORE sugar arrive — both raise cookie count. To find how rain changes cookies, you follow both supply roads (rain→flour→cookies, rain→sugar→cookies), multiply the "how much each road delivers" along the way, and add the two roads' totals. That's the chain rule: trace every road from the deep cause to the final result, multiply along a road, add across roads.


Connections


Flashcards

Multivariable chain rule for z=f(x,y)z=f(x,y) with x=x(t),y=y(t)x=x(t),y=y(t)
dzdt=zxdxdt+zydydt\dfrac{dz}{dt}=\dfrac{\partial z}{\partial x}\dfrac{dx}{dt}+\dfrac{\partial z}{\partial y}\dfrac{dy}{dt}
Why do we ADD the terms in the chain rule?
Because the total differential dz=zxdx+zydydz=z_x\,dx+z_y\,dy makes independent inputs contribute independently (linearly), so effects add.
When do you use dd vs \partial in chain rule?
dd when the function ultimately depends on one variable; \partial when multiple ultimate variables remain.
Path/tree method in one line
Multiply derivatives along each path, then add over all paths from output to the variable.
General chain rule for u=f(x1..xn)u=f(x_1..x_n), xi=xi(tj)x_i=x_i(t_j)
utj=i=1nuxixitj\dfrac{\partial u}{\partial t_j}=\sum_{i=1}^n \dfrac{\partial u}{\partial x_i}\dfrac{\partial x_i}{\partial t_j}
Matrix form of the general chain rule
Jacobian product: Jux=JuJxJ_{u\circ x}=J_u\,J_x.
w=f(x,y,t)w=f(x,y,t) with x,yx,y depending on tt: dwdt=?\dfrac{dw}{dt}=?
fxx+fyy+ftf_x\,x'+f_y\,y'+f_t (include the explicit tt term).
z/r\partial z/\partial r for x=rcosθ,y=rsinθx=r\cos\theta,\,y=r\sin\theta
zxcosθ+zysinθz_x\cos\theta+z_y\sin\theta.

Concept Map

divide by dt

gives

inputs add independently

Case 1: one variable

Case 2: two variables

link-by-link

then

formalised by

companions remain

only final variable

analogue of

Total differential dz

Multivariable chain rule

Differentiability of f

Sum over all paths

dz/dt uses d notation

partial z/partial s and t

Multiply rates along each path

Add products over paths

Dependency tree method

Use partial notation

Use d notation

Single-variable chain rule

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, single-variable mein toh simple tha: yy depends on xx, aur xx depends on tt, toh ek hi chain — dy/dt=(dy/dx)(dx/dt)dy/dt = (dy/dx)(dx/dt). Lekin multivariable mein output zz ke do darwaze hote hain, xx aur yy. Agar xx aur yy dono tt par depend karte hain, toh tt ko hilane se zz par do raaste se effect aata hai. Isliye hum dono raaston ka effect add karte hain: dz/dt=zx(dx/dt)+zy(dy/dt)dz/dt = z_x\,(dx/dt) + z_y\,(dy/dt).

Yaad rakhne ka sabse easy tareeka: ek tree banao. Upar output (zz), neeche branches (x,yx,y), aur sabse neeche ultimate variable (tt ya s,ts,t). Output se variable tak jitne bhi raaste hain, har raaste par links ko multiply karo, aur fir saare raaste add kar do. Bas yahi pura chain rule hai — chahe Case 1 ho ya general nn-variable wala.

dd aur \partial ka confusion mat rakhna: agar final mein function sirf ek hi variable par depend karta hai toh dd lagao; agar do ya zyada variable bachte hain toh \partial. Aur ek classic trap: agar w=f(x,y,t)w=f(x,y,t) hai aur x,yx,y bhi tt par depend karte hain, toh tt tak teen raaste hain — do x,yx,y ke through aur ek seedha (explicit tt), isliye extra +f/t+\,\partial f/\partial t term bhi add hoga. Yeh chiz exam mein bahut students bhool jaate hain.

Kyun important hai? Polar coordinates, physics ke transformations, optimization, neural networks ka backpropagation — sab jagah yahi rule chalta hai. Backprop literally Jacobian matrices ka multiplication hai, jo general chain rule ka hi matrix-form hai. Toh "paths add, links multiply" — yeh ek line zindagi bhar kaam aayegi.

Go deeper — visual, from zero

Test yourself — Multivariable Calculus

Connections