Linear Algebra
14.118 min read

Example: One Underlying Variable

Let g(u1,u2)=u12+u1u2g(u_1, u_2) = u_1^2 + u_1 u_2 and f(t)=(cos⁡t,sin⁡t)\mathbf{f}(t) = (\cos t, \sin t), so h(t)=g(cos⁡t,sin⁡t)=cos⁡2t+cos⁡tsin⁡th(t) = g(\cos t, \sin t) = \cos^2 t + \cos t \sin t.

By the chain rule: h′(t)=∂g∂u1∣f(t)⋅(−sin⁡t)+∂g∂u2∣f(t)⋅(cos⁡t)h'(t) = \frac{\partial g}{\partial u_1}\bigg|_{\mathbf{f}(t)} \cdot (-\sin t) + \frac{\partial g}{\partial u_2}\bigg|_{\mathbf{f}(t)} \cdot (\cos t).

We have ∂g∂u1=2u1+u2\frac{\partial g}{\partial u_1} = 2u_1 + u_2 and ∂g∂u2=u1\frac{\partial g}{\partial u_2} = u_1. At f(t)=(cos⁡t,sin⁡t)\mathbf{f}(t) = (\cos t, \sin t): ∂g∂u1=2cos⁡t+sin⁡t\frac{\partial g}{\partial u_1} = 2\cos t + \sin t and ∂g∂u2=cos⁡t\frac{\partial g}{\partial u_2} = \cos t. So h′(t)=(2cos⁡t+sin⁡t)(−sin⁡t)+cos⁡t⋅cos⁡t=−2sin⁡tcos⁡t−sin⁡2t+cos⁡2th'(t) = (2\cos t + \sin t)(-\sin t) + \cos t \cdot \cos t = -2\sin t \cos t - \sin^2 t + \cos^2 t.

Formal View

Example 14.1 — Chain Rule: One Underlying Variable
For h(t)=(cos⁡t)2+cos⁡tsin⁡th(t) = (\cos t)^2 + \cos t \sin t, direct differentiation gives: h′(t)=−2cos⁡tsin⁡t+(−sin⁡2t+cos⁡2t)=−2sin⁡tcos⁡t−sin⁡2t+cos⁡2th'(t) = -2\cos t \sin t + (- \sin^2 t + \cos^2 t) = -2\sin t \cos t - \sin^2 t + \cos^2 t. This matches the chain rule result, confirming the formula.

Interactive Visualization

Chain Rule Circuit Diagram

Why This Matters

Working through a complete example solidifies the chain rule formula.

  • Verifying the chain rule formula against direct differentiation
  • Building intuition for when the chain rule is simpler than direct computation
  • Preparing for more complex applications like backpropagation

Quiz

Question 1

Let h(t)=g(t2,et)h(t) = g(t^2, e^t) where g(u,v)=u+vg(u,v) = u + v. Then h′(t)h'(t) is:

Common Mistakes

  • Evaluating partials at tt instead of at (t2,et)(t^2, e^t).
  • Forgetting to multiply each partial by the corresponding derivative of the inner function.