Skip to main content

The Multivariable Chain Rule

A curve supplies inputs to a scalar response. How fast does the response change along the curve? This chapter composes derivative maps and checks matrix sizes and evaluation points.

  • Multivariable chain rule: The derivative of a composition is the composition of derivatives, represented by ordered Jacobian multiplication.

Follow a response around a circle​

Reuse Q(x,y)=x2+xy+y2Q(x,y)=x^2+xy+y^2 and r(t)=(cos⁡t,sin⁡t)Tr(t)=(\cos t,\sin t)^T. Direct substitution gives

Q(r(t))=1+12sin⁡(2t),ddtQ(r(t))=cos⁡(2t).Q(r(t))=1+\tfrac12\sin(2t),\qquad \frac d{dt}Q(r(t))=\cos(2t).

By the chain rule this same derivative is DQ(r(t))r′(t)=∇Q(r(t))Tr′(t)DQ(r(t))r'(t)=\nabla Q(r(t))^Tr'(t). At zero, the gradient is (2,1)T(2,1)^T and velocity is (0,1)T(0,1)^T, giving rate 11.

A parameter curve mapped into the input plane and then into a scalar response
The derivative of the response is the row derivative evaluated on the curve velocity.

Compose the linear approximations​

If g:U⊂Rn→Rmg:U\subset\mathbb R^n\to\mathbb R^m is differentiable at aa and ff is differentiable on an open neighborhood at g(a)g(a), then

D(f∘g)(a)=Df(g(a))Dg(a).D(f\circ g)(a)=Df(g(a))Dg(a).

The left matrix factor has size p×mp\times m if ff has pp outputs; the right factor is m×nm\times n. The result is p×np\times n. Matrix action starts on the right, matching function composition.

To see why, write g(a+h)=g(a)+Bh+r(h)g(a+h)=g(a)+Bh+r(h). A linear bound on BB gives ∥g(a+h)−g(a)∥=O(∥h∥)\|g(a+h)-g(a)\|=O(\|h\|). Insert this increment into the outer approximation. Both the inner remainder and the outer remainder become o(∥h∥)o(\|h\|), leaving the product of derivatives.

Keep a variable-dependence map​

If z=f(x,y)z=f(x,y) with x=x(s,t)x=x(s,t) and y=y(s,t)y=y(s,t), then

∂z∂s=fx xs+fy ys.\frac{\partial z}{\partial s} =f_x\,x_s+f_y\,y_s.

The derivatives of ff are evaluated at the current (x(s,t),y(s,t))(x(s,t),y(s,t)). Partial notation is only meaningful after specifying which variables are held fixed. A dependency diagram can help, but the matrix formula supplies the complete ordering.

Basic practice​

Prepare​

Reuse Q and the unit circle. Keep radians and column-vector conventions.

Record assumed inputs, predictions, and exact calculations separately. If you use software, label rounded outputs; no physical measurement is implied.

Predict​

At t = 0, is the rate determined by the gradient at (1, 1) or at r(0)?

Execute​

  1. Differentiate Q(r(t)) by direct substitution.
  2. Multiply DQ(r(t)) by r′(t) and compare.
  3. Evaluate both routes at t = 0 and t = π/4, checking the intermediate points.

Observe and record​

Case or quantityPredictionExact result or argumentError or software check
Direct formula
Matrix chain rule
t = 0 and π/4

Check after working: Both routes give cos(2t), hence rates 1 and 0. At t = 0 the evaluation point is (1, 0), not the recurring point (1, 1).

Optional extension​

Use the vector map F from the previous chapter as the outer map and calculate D(F ∘ r).

Keep and continue​

Keep the product order and evaluation-point labels. Next, differentiate once more to capture curvature.

Previous: The Jacobian and Total Derivative

Next: The Hessian and Taylor Expansion