When the two variables x,y of W(x,y) are themselves each functions of a single variable t (with the same domain), the composite W(x(t),y(t)) ultimately depends only on t — so it should be treatable as an ordinary one-variable function, and its derivative dtdW should be computable. This is not a coincidence:
Theorem 8.2 (Function of Function Rule). Suppose W(x,y) has partial derivatives ∂x∂W,∂y∂W. If x,y are both differentiable functions of a single variable t, then W is a differentiable function of t, and
dtdW=∂x∂Wdtdx+∂y∂Wdtdy.(16)
The tree diagram is the standard visual aid: W branches down to x and y (labelled by ∂W/∂x and ∂W/∂y), and each of x,y branches further down to t (labelled dx/dt and dy/dt); multiplying along each full branch and summing over the branches reproduces (16) exactly.
Verifying the theorem directly. For F(x,y)=x2−2y2+2xy with x(t)=cost,y(t)=sint: substituting first gives F=cos2t−2sin2t+2costsint, a function of t alone, whose derivative (by direct differentiation, using dtd(2costsint)=2(cos2t−sin2t)) works out to −6costsint+2(cos2t−sin2t). Computing instead via (16): Fx=2x+2y,Fy=−4y+2x, dx/dt=−sint,dy/dt=cost, so
∂x∂Fdtdx+∂y∂Fdtdy=(2x+2y)(−sint)+(2x−4y)(cost)=2(cost+sint)(−sint)+2(cost−2sint)(cost),
which simplifies to the same −6costsint+2(cos2t−sin2t) — confirming (16). Both routes always agree, so computing both is a genuine self-check; whichever route is algebraically shorter for a given problem is the one to use in practice.
Two-parameter version. Sometimes x=x(s,t) and y=y(s,t) both depend on two parameters s,t∈R, making W ultimately a function of s,t as well:
Theorem 8.3 (Chain Rule, two parameters). If W(x,y) has partial derivatives, and x=x(s,t),y=y(s,t) both have partial derivatives with respect to s and t, then
∂s∂W=∂x∂W∂s∂x+∂y∂W∂s∂y,∂t∂W=∂x∂W∂t∂x+∂y∂W∂t∂y.(17,18) …