Professor Leonard – Calculus 3 – 13.5: The Chain Rule for Multivariable Functions
Thomas – 14.4 The Chain Rule
Our Old Friend, the Chain Rule
The Chain Rule is one of the first major tools one learns in Calculus. It is used to differentiate composite functions, where one function is nested inside another function. When w = f(x) and x = g(t), the variable w ultimately becomes a function of t. We then calculate the derivative using
\frac{dw}{dt}=\frac{dw}{dx}\frac{dx}{dt}
For example, suppose
w=x^2,\qquad x=t^3
Then
\frac{dw}{dx}=2x,\qquad \frac{dx}{dt}=3t^2
so
\frac{dw}{dt}=2x(3t^2)=6xt^2=6t^5
In essence, we differentiate the outer function first, then multiply by the derivative of the inner function. Composite functions can have multiple nested layers, requiring the Chain Rule to be applied repeatedly. As anyone who has taken Calculus knows, bookkeeping can become tedious when dealing with multiple layers, fractions, exponents, logarithms, and trigonometric functions.
A derivative measures how one variable changes as another changes. The Chain Rule allows us to calculate that rate of change when variables influence one another indirectly through one or more intermediate functions.
Chain Rule for Multivariable Functions: What’s Different and What’s the Same
The fundamental idea of the Chain Rule remains unchanged, regardless of whether we are differentiating functions of one variable or many. We still differentiate one layer at a time and multiply derivatives together along a chain.
What changes is that a function may now depend on several intermediate variables instead of just one. Intermediate variables are themselves functions of other variables. There may now be several paths connecting an independent variable to the dependent variable, and every complete path contributes to the final derivative. We therefore multiply the derivatives along each path and add their contributions together.
For example, a function such as
w=3xy^2+2zx+7yz^3
may appear to have three independent variables. However, suppose
x=r+s,\qquad y=r^2,\qquad z=\sin s
Then r and s are the true independent variables, while x, y, and z are intermediate variables that connect the independent variables to w.
Why Partial Derivatives Appear
In Multivariable Calculus, functions often depend on more than one variable. Because of this, changing one variable while keeping the others fixed becomes important.
A partial derivative measures how a function changes with respect to one variable while all the other variables are held constant.
For example, if
f(x,y)=x^2+y^2
then
\frac{\partial f}{\partial x}=2x
because y is treated as a constant.
Likewise,
\frac{\partial f}{\partial y}=2y
because x is held constant instead.
The Chain Rule therefore combines partial derivatives of the dependent variable with derivatives (or partial derivatives) of the intermediate variables. Ordinary derivatives are still used whenever a variable depends on only one variable, while partial derivatives are used whenever a variable depends on two or more variables.
Functions with One Independent Variable
A multivariable function may contain many intermediate variables while still depending on only one independent variable. Each intermediate variable contributes its own path from the independent variable to the dependent variable.
For example, let
z=x^2+y^2
where
x=t^2,\qquad y=3t
The Chain Rule becomes
\frac{dz}{dt}=\frac{\partial z}{\partial x}\frac{dx}{dt}+\frac{\partial z}{\partial y}\frac{dy}{dt}
Along each path, we multiply the derivative of the dependent variable with respect to the intermediate variable by the derivative of the intermediate variable with respect to the independent variable. The resulting derivative is the sum of the products from every complete path. Once the derivative has been found, we can substitute the given values to evaluate it at a specific point.
Functions with More than One Independent Variable
When a function depends on more than one independent variable, we calculate a separate partial derivative for each independent variable. The process itself remains exactly the same.
For example, let
z=x^2+y^2
where
x=s+t,\qquad y=s-t
Then
\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}
and
\frac{\partial z}{\partial t}=\frac{\partial z}{\partial x}\frac{\partial x}{\partial t}+\frac{\partial z}{\partial y}\frac{\partial y}{\partial t}
Along each path, we multiply the appropriate derivatives together and then add the products from every complete path connecting the independent variable to the dependent variable. Ordinary derivatives are still used whenever a variable depends on only one variable, while partial derivatives are used whenever a variable depends on several variables.
Branch Diagrams
As functions become more complicated, it can be difficult to keep track of every relationship between variables. Not every intermediate variable is necessarily connected to every independent variable. Branch diagrams provide a useful visual map of these relationships.
Branch diagrams place the dependent variable on one side, the independent variable(s) on the other, and the intermediate variables in between. Lines are drawn wherever one variable depends directly on another. Each branch represents one derivative in the Chain Rule.
To differentiate, simply follow every complete path from the independent variable to the dependent variable. Multiply the derivatives along each path, then add the products from every complete path.
With an accurate branch diagram, even complicated Chain Rule problems become systematic and straightforward because we are simply applying the differentiation rules we already know.