Introduction
A function \(f(x,y)\) describes how an output depends on two inputs. If those inputs change together over time, according to \(x=x(t)\) and \(y=y(t)\), then the output also changes with \(t\). The chain rule tells us how to calculate that rate of change from the partial derivatives of \(f\) and the rates of the two coordinates.
The key idea is that a changing output can respond to changes in either input. The rate contributed by each input is its partial derivative, evaluated at the current point, multiplied by that input’s rate of change. These contributions are then added.
The Chain Rule Along a Path
Let \(f\) be a function of two variables, and let \(x(t)\) and \(y(t)\) specify a path in the plane. The function obtained by evaluating \(f\) along the path is \(g(t)=f(x(t),y(t))\). It is a function of one variable, so its derivative measures the instantaneous rate at which the output changes as \(t\) changes.
At a parameter value \(t_0\), the point on the path is \((x(t_0),y(t_0))\). If \(f\) is differentiable at that point and both coordinate functions are differentiable at \(t_0\), then the chain rule gives:
Here \(f_x\) and \(f_y\) are the partial derivatives of \(f\) with respect to its first and second inputs. Each is evaluated at the current point \((x(t),y(t))\), not at an unrelated point. The coordinate rates \(x'(t)\) and \(y'(t)\) are evaluated at the same parameter value.
The formula combines two effects. The quantity \(f_x x'\) is the part of the output’s rate attributable to the changing \(x\)-coordinate; \(f_y y'\) is the part attributable to the changing \(y\)-coordinate. A coordinate that is instantaneously stationary has rate zero, so it contributes zero at that instant. A coordinate decreasing as \(t\) increases has a negative rate, which must retain its sign in the calculation.
Why the Formula Works
The reason for the chain rule is that differentiability gives a first-order approximation to the change in \(f\). Along a differentiable path, the changes in the coordinates are themselves approximately their rates multiplied by the change in \(t\). Substituting those coordinate changes into the first-order approximation produces the formula.
Fix \(t_0\) and let \(h\) be a small change in the parameter. Put \(\Delta x=x(t_0+h)-x(t_0)\) and \(\Delta y=y(t_0+h)-y(t_0)\). Differentiability of the coordinate functions gives \(\Delta x=x'(t_0)h+o(h)\) and \(\Delta y=y'(t_0)h+o(h)\).
At \((x(t_0),y(t_0))\), differentiability means that the output change is \(f_x\Delta x+f_y\Delta y+o(\sqrt{(\Delta x)^2+(\Delta y)^2})\), where the partial derivatives are evaluated at that point.
Because \(\Delta x\) and \(\Delta y\) are \(O(h)\), the remainder in the previous step is \(o(h)\). The output change is therefore \((f_xx'(t_0)+f_yy'(t_0))h+o(h)\).
Divide the output change by \(h\) and let \(h\) tend to zero. The \(o(h)/h\) term tends to zero, leaving \(g'(t_0)=f_xx'(t_0)+f_yy'(t_0)\).
This proves the rule at an arbitrary parameter value \(t_0\) satisfying the stated differentiability conditions. Since \(t_0\) was arbitrary, the same calculation applies at each point where those conditions hold.
Worked Examples
Worked Example: A Polynomial Along a Polynomial Path
Let \(f(x,y)=x^2y+3y^2\), with \(x(t)=t+1\) and \(y(t)=t^2\). Find the rate of change of \(f(x(t),y(t))\) at \(t=1\), then check it by direct differentiation.
First calculate the partial derivatives:
At \(t=1\), the path has \(x(1)=2\) and \(y(1)=1\). The coordinate rates are \(x'(t)=1\) and \(y'(t)=2t\), so \(x'(1)=1\) and \(y'(1)=2\). The partial derivatives at the path point are \(f_x(2,1)=2(2)(1)=4\) and \(f_y(2,1)=2^2+6(1)=10\). Thus:
For a direct check, substitute the path into \(f\):
Differentiate: \(\frac{d}{dt}(4t^4+2t^3+t^2)=16t^3+6t^2+2\). At \(t=1\), this is \(16+6+2=24\), as given by the chain rule.
Worked Example: A Trigonometric Path
Let \(f(x,y)=e^{xy}\), with \(x(t)=\cos t\) and \(y(t)=\sin t\). Find the rate of change along the path as a formula in \(t\), and evaluate it at \(t=\frac{\pi}{4}\).
The partial derivatives are \(f_x(x,y)=ye^{xy}\) and \(f_y(x,y)=xe^{xy}\). The coordinate rates are \(x'(t)=-\sin t\) and \(y'(t)=\cos t\). Applying the chain rule gives:
At \(t=\frac{\pi}{4}\), \(\cos t=\sin t=\frac{\sqrt{2}}{2}\), so \(\cos^2t-\sin^2t=\frac12-\frac12=0\). The rate is therefore \(e^{1/2}(0)=0\).
To check, substitution first gives \(f(x(t),y(t))=e^{\cos t\sin t}=e^{\frac12\sin(2t)}\). Differentiating directly gives \(e^{\frac12\sin(2t)}\cos(2t)\), which equals \(e^{\cos t\sin t}(\cos^2t-\sin^2t)\) because \(\cos(2t)=\cos^2t-\sin^2t\). At \(t=\frac{\pi}{4}\), \(\cos(2t)=\cos(\frac{\pi}{2})=0\), confirming the result.
Worked Example: A Logarithmic Function Along a Straight Path
Let \(f(x,y)=\ln(x^2+y^2)\), \(x(t)=3+2t\), and \(y(t)=4-t\). Find the rate of change at \(t=0\).
The function is defined wherever \(x^2+y^2>0\). At the path point \((3,4)\), this condition holds. The partial derivatives are:
At \(t=0\), \(x=3\), \(y=4\), \(x'=2\), and \(y'=-1\). Since \(x^2+y^2=3^2+4^2=25\), the partial derivatives there are \(f_x(3,4)=6/25\) and \(f_y(3,4)=8/25\). Therefore:
For a direct check, the expression inside the logarithm along the path is \((3+2t)^2+(4-t)^2=9+12t+4t^2+16-8t+t^2=25+4t+5t^2\). Hence the composite function is \(\ln(25+4t+5t^2)\), whose derivative is \(\frac{4+10t}{25+4t+5t^2}\). At \(t=0\), it equals \(\frac{4}{25}\), agreeing with the chain-rule calculation.
A Common Mistake: Forgetting the Coordinate Rates
The partial derivatives alone do not give the rate along a particular path. They describe how \(f\) changes with one input when the other input is held fixed. Along a path, both inputs can change, and the amount each contributes depends on its own rate.
Worked Example: Correcting an Unweighted Sum
Take \(f(x,y)=x^2+y^2\), with \(x(t)=2t\) and \(y(t)=3t\). At \(t=1\), the point is \((2,3)\), where \(f_x=2x=4\) and \(f_y=2y=6\). A common incorrect calculation is to add these partial derivatives and claim the rate is \(4+6=10\). This ignores that \(x\) changes at rate \(2\) and \(y\) at rate \(3\).
The correct calculation is:
Indeed, direct substitution gives \(f(2t,3t)=4t^2+9t^2=13t^2\), whose derivative is \(26t\), equal to \(26\) at \(t=1\). The coordinate rates are essential weights; the partial derivatives should not simply be added.
Reading the Result Along a Path
The formula also explains how the path affects the output rate. The same function and the same point can produce different rates if the path has different coordinate rates there. For instance, a path that moves quickly in the \(x\)-direction gives more weight to \(f_x\) than a path that moves slowly in that direction.
Keep the order of operations clear: locate the point on the path, evaluate both partial derivatives there, find both coordinate rates at that parameter value, and multiply corresponding quantities before adding. If a coordinate rate is negative, retain the negative sign. If it is zero, its contribution is zero.
Check Your Understanding
Use the chain rule along a parametrized path. When possible, check your result by direct substitution and differentiation.
- For \(f(x,y)=xy\), \(x(t)=t^2\), and \(y(t)=t+1\), find \(\frac{d}{dt}f(x(t),y(t))\) and evaluate it at \(t=1\).
- For \(f(x,y)=x^2+y^2\), \(x(t)=\cos t\), and \(y(t)=\sin t\), find the rate along the path. What is its value for every \(t\)?
- State the differentiability conditions needed to apply the chain rule at a particular parameter value.
- For \(f(x,y)=x+y\), \(x(t)=5-t\), and \(y(t)=t^2\), find the rate at \(t=2\). Which coordinate is decreasing there?
- Explain why adding \(f_x\) and \(f_y\) without multiplying by the coordinate rates can give an incorrect result.