1.9 Composite Functions and Chain Rule Differentiation

Let \(z = f(x,y)\), where \(x = g(r,s)\) and \(y = h(r,s)\), so that \(z\) is a function of \(r\) and \(s\). The chain rule expresses the derivatives of \(z\) with respect to the new variables through those with respect to the old.

Theorem 1.9.1 (Chain rule). Suppose \(f\) is differentiable at \((x,y)\), where \(x = g(r,s)\) and \(y = h(r,s)\), and \(g\) and \(h\) have partial derivatives at \((r,s)\). Then \[\frac {\partial z}{\partial r} =\frac {\partial z}{\partial x} \frac {\partial x}{\partial r} + \frac {\partial z}{\partial y} \frac {\partial y}{\partial r},\qquad \frac {\partial z}{\partial s} =\frac {\partial z}{\partial x} \frac {\partial x}{\partial s} + \frac {\partial z}{\partial y} \frac {\partial y}{\partial s}.\]

Proof. Hold \(s\) fixed and change \(r\) by \(\Delta r\), producing changes \(\Delta x\) and \(\Delta y\). By Definition 1.3.1, \[\Delta z = f_x\,\Delta x + f_y\,\Delta y + \varepsilon \sqrt {\Delta x^2 + \Delta y^2},\] with \(\varepsilon \to 0\) as \((\Delta x,\Delta y)\to (0,0)\). Divide by \(\Delta r\): \[\frac {\Delta z}{\Delta r} = f_x\frac {\Delta x}{\Delta r} + f_y\frac {\Delta y}{\Delta r} \pm \varepsilon \sqrt {\left (\frac {\Delta x}{\Delta r}\right )^2 + \left (\frac {\Delta y}{\Delta r}\right )^2}.\] As \(\Delta r\to 0\), \(\frac {\Delta x}{\Delta r}\to x_r\) and \(\frac {\Delta y}{\Delta r}\to y_r\), so \(\Delta x\) and \(\Delta y\) tend to \(0\), the square root stays bounded, and \(\varepsilon \to 0\). The last term vanishes in the limit, which gives the first formula; the second is the same with \(s\) in place of \(r\). □

In general, if \(u = F(x_1,x_2,\dots , x_n)\) is differentiable and each \(x_i = f_i (r_1,r_2,\dots , r_k)\), then for each \(j\) \[\frac {\partial u}{\partial r_j}=\frac {\partial u}{\partial x_1}\frac {\partial x_1}{\partial r_j}+ \frac {\partial u}{\partial x_2}\frac {\partial x_2}{\partial r_j}+\cdots + \frac {\partial u}{\partial x_n}\frac {\partial x_n}{\partial r_j} ,\] one term for each intermediate variable. In particular, if \(x_1,x_2,\dots , x_n\) depend on a single variable \(s\), then \[\frac {du}{ds} = \frac {\partial u}{\partial x_1}\frac {dx_1}{ds}+ \frac {\partial u}{\partial x_2}\frac {dx_2}{ds} +\cdots +\frac {\partial u}{\partial x_n}\frac {dx_n}{ds}.\] These results transform derivatives from one set of variables to another, and they are the reason the gradient is so useful: the derivative of \(f\) along any curve \(\mathbf r(t)\) is \(\nabla f\cdot \mathbf r'(t)\).

Example 1.9.2. If \(f(x) = \sin x\) and \(x = t^2\), then \(F(t) = f(x(t)) = \sin (t^2)\), and \[\frac {dF}{d t} = \frac {d f}{dx} \frac {d x}{dt} = \cos x \cdot 2t = 2t\cos (t^2).\] This is the one-variable chain rule, the case of a single intermediate variable.

Example 1.9.3. Let \(r(x,y) =x^2y - e^{2y}\), where \(x = 3t^2\) and \(y = \sin t\), and let \(R(t) = r(x(t),y(t))\). Find \(\frac {dR}{dt}\).

Solution. \begin {align*} \frac {dR}{dt} & = \frac {\partial r}{\partial x} \frac {dx}{dt} + \frac {\partial r}{\partial y} \frac {dy}{dt} = 2xy\cdot 6t + (x^2 - 2e^{2y}) \cos t\\ & = 2(3t^2)(\sin t)(6t) + (9t^4 - 2e^{2\sin t}) \cos t\\ & = 36t^3\sin t + ( 9t^4 - 2e^{2\sin t})\cos t . \end {align*}

Example 1.9.4. Let \(f(u,v) = uv^2\), where \(u = 3x-y\) and \(v = x^2y\), and let \(F(x,y) = f(u(x,y), v(x,y))\). Find \(F_x\) and \(F_y\).

Solution. With \(f_u = v^2\) and \(f_v = 2uv\), \begin {align*} \frac {\partial F}{\partial x} & = \frac {\partial f}{\partial u} \frac {\partial u}{\partial x} + \frac {\partial f}{\partial v} \frac {\partial v}{\partial x} = 3v^2 + 2uv\cdot 2xy\\ & = 3x^4y^2 + 4xy(3x - y)x^2y = 15x^4y^2 - 4x^3y^3,\\[1ex] \frac {\partial F}{\partial y} & = \frac {\partial f}{\partial u} \frac {\partial u}{\partial y} +\frac {\partial f}{\partial v} \frac {\partial v}{\partial y} = -v^2 + 2uv\cdot x^2\\ & = -x^4y^2 + 2(3x -y)x^4y = 6x^5y - 3x^4y^2 . \end {align*}

As a check, \(F = (3x - y)x^4y^2 = 3x^5y^2 - x^4y^3\), whose partial derivatives are the same.

Example 1.9.5. If \(z = f(x,y)\) and \(x = r\cos \theta \), \(y = r\sin \theta \), show that \[\left (\frac {\partial z}{\partial x}\right )^2 + \left (\frac {\partial z}{\partial y}\right )^2 = \left (\frac {\partial z}{\partial r}\right )^2 + \frac {1}{r^2}\left (\frac {\partial z}{\partial \theta }\right )^2 .\]

Solution. By Theorem 1.9.1, \[z_r = z_x\cos \theta + z_y\sin \theta ,\qquad z_\theta = -z_x r\sin \theta + z_yr\cos \theta .\] Squaring, \[z_r^2 + \frac {z_\theta ^2}{r^2} = (z_x\cos \theta + z_y\sin \theta )^2 + (-z_x \sin \theta + z_y\cos \theta )^2 = z_x^2 + z_y^2,\] since the cross terms cancel and \(\cos ^2\theta + \sin ^2\theta = 1\). Both sides are \(|\nabla z|^2\), computed in two coordinate systems.

Example 1.9.6. The radius of a right circular cone is increasing at \(1.8\) cm/s while its height is decreasing at \(2.5\) cm/s. At what rate is the volume changing when the radius is \(120\) cm and the height \(140\) cm?

Solution. \(V = \frac {\pi }{3}r^2h\), so by the chain rule \[\frac {dV}{dt} = \frac {\partial V}{\partial r}\frac {dr}{dt} + \frac {\partial V}{\partial h}\frac {dh}{dt} = \frac {2\pi }{3}rh\frac {dr}{dt} + \frac {\pi }{3}r^2\frac {dh}{dt}.\] With the given values, \[\frac {dV}{dt} = \frac {2\pi }{3}(120)(140)(1.8) + \frac {\pi }{3}(14400)(-2.5) = 20160\pi - 12000\pi = 8160\pi \approx 25\,600\ \text {cm}^3/\text {s}.\] The volume is increasing.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.