Intuition The big picture
A function's output changes when its inputs change. If those inputs themselves depend on other variables, then a wiggle in a deep variable ripples through every path to the output. The multivariable chain rule is just bookkeeping for all those ripples : add up the contribution along every path, multiplying the rates of change link-by-link along each path .
In single-variable calculus, y = f ( x ) y=f(x) y = f ( x ) , x = g ( t ) x=g(t) x = g ( t ) gives d y d t = d y d x d x d t \dfrac{dy}{dt}=\dfrac{dy}{dx}\dfrac{dx}{dt} d t d y = d x d y d t d x — one chain, one path.
But in multivariable land, an output z = f ( x , y ) z=f(x,y) z = f ( x , y ) has two doors (x x x and y y y ). If both x x x and y y y depend on t t t , then changing t t t pushes z z z through two doors at once . We must sum both pushes.
Intuition Why we ADD, not just multiply
The total differential says a small change in z z z is
d z = ∂ z ∂ x d x + ∂ z ∂ y d y . dz = \frac{\partial z}{\partial x}\,dx + \frac{\partial z}{\partial y}\,dy. d z = ∂ x ∂ z d x + ∂ y ∂ z d y .
This is the linear approximation: independent inputs contribute independently , so their effects add . Divide by d t dt d t → the chain rule appears for free.
WHAT we start from: differentiability of f f f means near a point,
Δ z = ∂ f ∂ x Δ x + ∂ f ∂ y Δ 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, Δ z = ∂ x ∂ f Δ x + ∂ y ∂ f Δ y + ε 1 Δ x + ε 2 Δ y ,
where ε 1 , ε 2 → 0 \varepsilon_1,\varepsilon_2 \to 0 ε 1 , ε 2 → 0 as ( Δ x , Δ y ) → ( 0 , 0 ) (\Delta x,\Delta y)\to(0,0) ( Δ x , Δ y ) → ( 0 , 0 ) .
HOW we get the rule (case: x = x ( t ) , y = y ( t ) x=x(t), y=y(t) x = x ( t ) , y = y ( t ) ): divide everything by Δ t \Delta t Δ t :
Δ z Δ t = ∂ f ∂ x Δ x Δ t + ∂ f ∂ y Δ 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}. Δ t Δ z = ∂ x ∂ f Δ t Δ x + ∂ y ∂ f Δ t Δ y + ε 1 Δ t Δ x + ε 2 Δ t Δ y .
Why this step? We want a rate with respect to t t t , so we measure each change per unit Δ t \Delta t Δ t .
Take Δ t → 0 \Delta t \to 0 Δ t → 0 . Then Δ x , Δ y → 0 \Delta x,\Delta y \to 0 Δ x , Δ y → 0 (continuity), so ε 1 , ε 2 → 0 \varepsilon_1,\varepsilon_2\to 0 ε 1 , ε 2 → 0 , and the last two terms vanish:
Definition The tree/path method (master rule)
Draw a dependency tree : top = output, branches = "depends on". To get ∂ ( output ) ∂ ( variable ) \dfrac{\partial(\text{output})}{\partial(\text{variable})} ∂ ( variable ) ∂ ( output ) :
Find every path from output down to that variable.
Along each path, multiply the derivatives of each link.
Add the products over all paths.
Use ∂ \partial ∂ if the variable still has companions; use d d d if it's the only final variable.
Let u = f ( x 1 , … , x n ) u=f(x_1,\dots,x_n) u = f ( x 1 , … , x n ) with each x i = x i ( t 1 , … , t m ) x_i = x_i(t_1,\dots,t_m) x i = x i ( t 1 , … , t m ) .
Worked example Ex 1 — Case 1
z = x 2 y z = x^2 y z = x 2 y , with x = cos t x=\cos t x = cos t , y = sin t y=\sin t y = sin t . Find d z d t \dfrac{dz}{dt} d t d z .
∂ z ∂ x = 2 x y \dfrac{\partial z}{\partial x}=2xy ∂ x ∂ z = 2 x y , ∂ z ∂ y = x 2 \dfrac{\partial z}{\partial y}=x^2 ∂ y ∂ z = x 2 . (Why? Treat the other variable as constant.)
d x d t = − sin t \dfrac{dx}{dt}=-\sin t d t d x = − sin t , d y d t = cos t \dfrac{dy}{dt}=\cos t d t d y = cos t .
d z d t = 2 x y ( − sin t ) + x 2 ( cos t ) . \frac{dz}{dt}=2xy(-\sin t)+x^2(\cos t). d t d z = 2 x y ( − sin t ) + x 2 ( cos t ) .
Why this step? Two paths to t t t (via x x x , via y y y ) → sum two products.
Substitute: = 2 cos t sin t ( − sin t ) + cos 2 t cos t = − 2 cos t sin 2 t + cos 3 t . =2\cos t\sin t(-\sin t)+\cos^2 t\cos t = -2\cos t\sin^2 t + \cos^3 t. = 2 cos t sin t ( − sin t ) + cos 2 t cos t = − 2 cos t sin 2 t + cos 3 t .
Worked example Ex 2 — Case 2 (polar coordinates)
z = f ( x , y ) z=f(x,y) z = f ( x , y ) , x = r cos θ x=r\cos\theta x = r cos θ , y = r sin θ y=r\sin\theta y = r sin θ . Find ∂ z ∂ r \dfrac{\partial z}{\partial r} ∂ r ∂ z .
∂ x ∂ r = cos θ \dfrac{\partial x}{\partial r}=\cos\theta ∂ r ∂ x = cos θ , ∂ y ∂ r = sin θ \dfrac{\partial y}{\partial r}=\sin\theta ∂ r ∂ y = sin θ . (Why? Differentiate w.r.t. r r r , holding θ \theta θ fixed.)
∂ z ∂ r = ∂ z ∂ x cos θ + ∂ z ∂ y sin θ . \frac{\partial z}{\partial r}=\frac{\partial z}{\partial x}\cos\theta+\frac{\partial z}{\partial y}\sin\theta. ∂ r ∂ z = ∂ x ∂ z cos θ + ∂ y ∂ z sin θ .
Why this step? This is literally the directional derivative of f f f in the radial direction — chain rule reveals geometry.
Worked example Ex 3 — Verify with a concrete
f f f
Take z = x 2 + y 2 z=x^2+y^2 z = x 2 + y 2 . Then z = r 2 z=r^2 z = r 2 directly, so ∂ z ∂ r = 2 r \dfrac{\partial z}{\partial r}=2r ∂ r ∂ z = 2 r .
Via chain rule: ∂ z ∂ x = 2 x = 2 r cos θ \dfrac{\partial z}{\partial x}=2x=2r\cos\theta ∂ x ∂ z = 2 x = 2 r cos θ , ∂ z ∂ y = 2 y = 2 r sin θ \dfrac{\partial z}{\partial y}=2y=2r\sin\theta ∂ y ∂ z = 2 y = 2 r sin θ .
∂ z ∂ r = 2 r cos θ cos θ + 2 r sin θ sin θ = 2 r ( cos 2 θ + sin 2 θ ) = 2 r . ✓ \frac{\partial z}{\partial r}=2r\cos\theta\cos\theta+2r\sin\theta\sin\theta=2r(\cos^2\theta+\sin^2\theta)=2r.\ \checkmark ∂ r ∂ z = 2 r cos θ cos θ + 2 r sin θ sin θ = 2 r ( cos 2 θ + sin 2 θ ) = 2 r . ✓
Why this matters: matching the direct answer proves the rule is consistent.
d z d t = ∂ z ∂ x d x d t \dfrac{dz}{dt}=\dfrac{\partial z}{\partial x}\dfrac{dx}{dt} d t d z = ∂ x ∂ z d t d x — I forgot the y y y term."
Why it feels right: in 1-D there's only one term, so muscle memory writes one term.
The fix: count the doors (x x x and y y y both depend on t t t ) → one product per door . Always draw the tree first.
d d d and ∂ \partial ∂ randomly.
Why it feels right: they look interchangeable.
The fix: Use d d d only when the function ultimately depends on one variable; use ∂ \partial ∂ when multiple ultimate variables remain. In Case 2, all derivatives w.r.t. s , t s,t s , t are ∂ \partial ∂ .
Common mistake Forgetting "implicit reappearance":
w = f ( x , y , t ) w=f(x,y,t) w = f ( x , y , t ) AND x , y x,y x , y depend on t t t .
Why it feels right: t t t looks like a plain independent variable.
The fix: there's a direct path to t t t plus paths through x , y x,y x , y :
d w d t = ∂ f ∂ x d x d t + ∂ f ∂ y d y d t + ∂ f ∂ t . \frac{dw}{dt}=\frac{\partial f}{\partial x}\frac{dx}{dt}+\frac{\partial f}{\partial y}\frac{dy}{dt}+\frac{\partial f}{\partial t}. d t d w = ∂ x ∂ f d t d x + ∂ y ∂ f d t d y + ∂ t ∂ f .
The last term is the explicit t t t dependence. Tree shows three paths.
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.
"Sum the paths, multiply the links."
Or: P.A.M. → Paths Add, Multiply along. Each branch of the tree is a multiplication; the trunk gathers the sum.
Multivariable chain rule for z = f ( x , y ) z=f(x,y) z = f ( x , y ) with x = x ( t ) , y = y ( t ) x=x(t),y=y(t) x = x ( t ) , y = y ( t ) d z d t = ∂ z ∂ x d x d t + ∂ z ∂ y d y d t \dfrac{dz}{dt}=\dfrac{\partial z}{\partial x}\dfrac{dx}{dt}+\dfrac{\partial z}{\partial y}\dfrac{dy}{dt} d t d z = ∂ x ∂ z d t d x + ∂ y ∂ z d t d y Why do we ADD the terms in the chain rule? Because the total differential
d z = z x d x + z y d y dz=z_x\,dx+z_y\,dy d z = z x d x + z y d y makes independent inputs contribute independently (linearly), so effects add.
When do you use d d d vs ∂ \partial ∂ in chain rule? d d d 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 ( x 1 . . x n ) u=f(x_1..x_n) u = f ( x 1 .. x n ) , x i = x i ( t j ) x_i=x_i(t_j) x i = x i ( t j ) ∂ u ∂ t j = ∑ i = 1 n ∂ u ∂ x i ∂ x i ∂ t j \dfrac{\partial u}{\partial t_j}=\sum_{i=1}^n \dfrac{\partial u}{\partial x_i}\dfrac{\partial x_i}{\partial t_j} ∂ t j ∂ u = ∑ i = 1 n ∂ x i ∂ u ∂ t j ∂ x i Matrix form of the general chain rule Jacobian product:
J u ∘ x = J u J x J_{u\circ x}=J_u\,J_x J u ∘ x = J u J x .
w = f ( x , y , t ) w=f(x,y,t) w = f ( x , y , t ) with x , y x,y x , y depending on t t t : d w d t = ? \dfrac{dw}{dt}=? d t d w = ? f x x ′ + f y y ′ + f t f_x\,x'+f_y\,y'+f_t f x x ′ + f y y ′ + f t (include the explicit
t t t term).
∂ z / ∂ r \partial z/\partial r ∂ z / ∂ r for x = r cos θ , y = r sin θ x=r\cos\theta,\,y=r\sin\theta x = r cos θ , y = r sin θ z x cos θ + z y sin θ z_x\cos\theta+z_y\sin\theta z x cos θ + z y sin θ .
partial z/partial s and t
Multiply rates along each path
Single-variable chain rule
Intuition Hinglish mein samjho
Dekho, single-variable mein toh simple tha: y y y depends on x x x , aur x x x depends on t t t , toh ek hi chain — d y / d t = ( d y / d x ) ( d x / d t ) dy/dt = (dy/dx)(dx/dt) d y / d t = ( d y / d x ) ( d x / d t ) . Lekin multivariable mein output z z z ke do darwaze hote hain, x x x aur y y y . Agar x x x aur y y y dono t t t par depend karte hain, toh t t t ko hilane se z z z par do raaste se effect aata hai. Isliye hum dono raaston ka effect add karte hain: d z / d t = z x ( d x / d t ) + z y ( d y / d t ) dz/dt = z_x\,(dx/dt) + z_y\,(dy/dt) d z / d t = z x ( d x / d t ) + z y ( d y / d t ) .
Yaad rakhne ka sabse easy tareeka: ek tree banao . Upar output (z z z ), neeche branches (x , y x,y x , y ), aur sabse neeche ultimate variable (t t t ya s , t s,t s , 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 n n n -variable wala.
d d d aur ∂ \partial ∂ ka confusion mat rakhna: agar final mein function sirf ek hi variable par depend karta hai toh d d d 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) w = f ( x , y , t ) hai aur x , y x,y x , y bhi t t t par depend karte hain, toh t t t tak teen raaste hain — do x , y x,y x , y ke through aur ek seedha (explicit t t t ), isliye extra + ∂ f / ∂ t +\,\partial f/\partial t + ∂ f / ∂ 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.