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)=(cost,sint)\mathbf{f}(t) = (\cos t, \sin t), so h(t)=g(cost,sint)=cos2t+costsinth(t) = g(\cos t, \sin t) = \cos^2 t + \cos t \sin t.

By the chain rule: h(t)=gu1f(t)(sint)+gu2f(t)(cost)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 gu1=2u1+u2\frac{\partial g}{\partial u_1} = 2u_1 + u_2 and gu2=u1\frac{\partial g}{\partial u_2} = u_1. At f(t)=(cost,sint)\mathbf{f}(t) = (\cos t, \sin t): gu1=2cost+sint\frac{\partial g}{\partial u_1} = 2\cos t + \sin t and gu2=cost\frac{\partial g}{\partial u_2} = \cos t. So h(t)=(2cost+sint)(sint)+costcost=2sintcostsin2t+cos2th'(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)=(cost)2+costsinth(t) = (\cos t)^2 + \cos t \sin t, direct differentiation gives: h(t)=2costsint+(sin2t+cos2t)=2sintcostsin2t+cos2th'(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.