## Section7.9Chain Rule

One advantage of working with differentials is that the chain rule becomes automatic. For example, if you know the temperature $T$ of a metal girder as a function of position $x\text{,}$ and you know your position as a function of time $t\text{,}$ then you can of course obtain temperature as a function of time by substitution. The resulting expression could be differentiated to determine how quickly the temperature at your location is changing as you move along the girder. But you could also use the chain rule, starting from the differential expression

$$dT = \frac{dT}{dx}\,dx\tag{7.9.1}$$

and then “dividing” by $dt$ to obtain

$$\frac{dT}{dt} = \frac{dT}{dx}\,\frac{dx}{dt} .\label{chainrule}\tag{7.9.2}$$

Equation (7.9.2) is the traditional statement of the single-variable chain rule.

Functions of several variables can be handled just as easily. For example, if you know the termperature $T$ as a function of position in space, and you know your position as a function of time, then a similar computation would start with

$$dT = \Partial{T}{x}\,dx + \Partial{T}{y}\,dy + \Partial{T}{z}\,dz\label{dT}\tag{7.9.3}$$

and then “divide” by $dt$ to obtain

$$\frac{dT}{dt} = \Partial{T}{x}\,\frac{dx}{dt} + \Partial{T}{y}\,\frac{dx}{dt} + \Partial{T}{z}\,\frac{dz}{dt} .\tag{7.9.4}$$

Now suppose that your position in space depends on latitude and longitude, rather than on time. So

$$dx = \Partial{x}{\theta}\,d\theta + \Partial{x}{\phi}\,d\phi\label{dx}\tag{7.9.5}$$

where ($\theta\text{,}$$\phi$) are spherical coordinates, with similar expressions holding for $dy$ and $dz\text{.}$ Suppose you want to know how the temperature changes as you walk along a line of constant latitude, that is, with $\phi$ held constant. We can substitute (7.9.5) into (7.9.3), along with the similar expressions for $dy$ and $dz\text{,}$ obtaining

\begin{align*} dT \amp= \Partial{T}{x}\, \left(\Partial{x}{\theta}\,d\theta + \Partial{x}{\phi}\,d\phi\right) + \Partial{T}{y}\, \left(\Partial{y}{\theta}\,d\theta + \Partial{y}{\phi}\,d\phi\right) + \Partial{T}{z}\, \left(\Partial{z}{\theta}\,d\theta + \Partial{z}{\phi}\,d\phi\right)\\ \amp= \left( \Partial{T}{x}\,\Partial{x}{\theta} + \Partial{T}{y}\,\Partial{y}{\theta} + \Partial{T}{z}\,\Partial{z}{\theta} \right)\,d\theta + \left( \Partial{T}{x}\,\Partial{x}{\phi} + \Partial{T}{y}\,\Partial{y}{\phi} + \Partial{T}{z}\,\Partial{z}{\phi} \right)\,d\phi . \end{align*}

But we also have

$$dT = \Partial{T}{\theta}\,d\theta + \Partial{T}{\phi}\,d\phi\tag{7.9.6}$$

and by comparing coefficients we obtain

$$\Partial{T}{\theta} = \Partial{T}{x}\,\Partial{x}{\theta} + \Partial{T}{y}\,\Partial{y}{\theta} + \Partial{T}{z}\,\Partial{z}{\theta}\label{mchain}\tag{7.9.7}$$

as well as a similar expression for $\Partial{T}{\phi}\text{.}$

Equation (7.9.7) is the traditional statement of the multivariable chain rule. You can easily reconstruct this expression from (7.9.3) by “dividing” by $d\theta\text{,}$ so long as you remember to replace ordinary derivatives by partial derivatives.