Introduction.
Since the partial derivatives of any given function can be computed using the rules for ordinary derivatives, we do not really need any new rules for the derivative of compositions.
However, in practice there is a nice pattern, and by stating this as a rule, time and effort can be saved in computing partial derivatives, including an easier version of implicit differentiation.
Subsection 4.5.1 The Chain Rule
Theorem 4.5.1. The Chain Rule, Case I.
For \(z=f(x,y)\) a differentiable function of two variables and \(x=g(t)\) and \(y=h(t)\) differentiable functions of one variable, the composite function \(z=f(g(t),h(t))\) of one variable has [ordinary] derivative
\begin{equation*}
\frac{dz}{dt}
= \frac{\partial z}{\partial x}\frac{d x}{d t} + \frac{\partial z}{\partial y}\frac{d y}{d t},
= \frac{\partial f}{\partial x}\frac{d g}{d t} + \frac{\partial f}{\partial y}\frac{d h}{d t}
\end{equation*}
or
\begin{equation*}
\frac{d}{dt}f(g(t),h(t)) = f_x(g(t),h(t)) g'(t) + f_y(g(t),h(t))h'(t).
\end{equation*}
The last version emphasizes that the derivatives of \(f\) are evaluated with the same arguments as \(f\text{.}\)
The variables \(x\) and \(y\) here are independent variables of \(f\) but dependent variables of \(g\) and \(h\text{:}\) they are called intermediate variables in this composition, to distinguish from the independent variable \(t\) of the composition.
Adding an extra independent variable to the functions \(g\) and \(h\) simply turns the above ordinary derivative \(dz/dt\) into a partial derivative \(\partial z / \partial t\) and adds a second partial derivative:
Theorem 4.5.2. The Chain Rule, Case II.
For \(z=f(x,y)\text{,}\) \(x=g(s,t)\) and \(y=h(s,t)\) functions of two variables, all differentiable, the function \(z=f(g(s,t),h(s,t))\) is also differentiable, with partial derivatives
\begin{align*}
\frac{\partial z}{\partial s}
\amp= \frac{\partial z}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial s}\\
\frac{\partial z}{\partial t}
\amp= \frac{\partial z}{\partial x}\frac{\partial x}{\partial t} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial t}
\end{align*}
The variables \(x\) and \(y\) here are independent variables of \(f\) and dependent variables of \(g\) and \(h\text{:}\) they are called intermediate variables in this composition, to distinguish from the independent variables \(s\) and \(t\text{.}\)
There is nothing special about \(f\) having two variables: the above rules extend to \(z=f(x_1,x_2,\dots x_n)\text{.}\)
Also, there is nothing special about these \(n\) intermediate variables being functions of one or two variables as in the two cases above. They can instead be functions of \(m\) intermediate variables \(t_1 \dots t_m\text{.}\)
The following final version of the Chain Rule includes the above two cases, along with the Chain Rule for functions of a single variable:
Theorem 4.5.3. The Chain Rule, General Version.
For \(z=f(x_1,x_2,\dots x_n)\) and \(x_i=g_i(t_1,\dots,t_m)\text{,}\) \(1 \leq i \leq n\text{,}\) all differentiable, the composition \(z=f(x_1(t_1,\dots,t_m),\dots,x_n(t_1,\dots,t_m))\) is a function of \(t_1 , \dots , t_m\) that is also differentiable, with partial derivatives
\begin{align*}
\frac{\partial z}{\partial t_i}
\amp= \frac{\partial z}{\partial x_1}\frac{\partial x_1}{\partial t_i}
+ \cdots + \frac{\partial z}{\partial x_j}\frac{\partial x_j}{\partial t_i}
+ \cdots + \frac{\partial z}{\partial x_n}\frac{\partial x_n}{\partial t_i}\\
\amp= \sum_{j=1}^{n} \frac{\partial z}{\partial x_j}\frac{\partial x_j}{\partial t_i}
\end{align*}
Subsection 4.5.2 Implicit Differentiation Made Easy
The method of implicit differentiation introduced in an introductory calculus course (see Section 3.6 of
Calculus, Early Transcendentals by Stewart or
Section 3.8 of OpenStax Calculus Volume 1) can be expedited using the Chain Rule for a function of two variables.
Suppose that a function \(y=f(x)\) is specified implicitly, as the solution of an equation in \(x\) and \(y\text{.}\) That equation can be written in terms of a function \(F\) of two variables, as \(F(x,y)=0\text{.}\) Applying the Chain Rule, but now with \(x\) as the independent variable, \(F(x,f(x))=0\) and so \(\ds\frac{d F}{d x} = 0\text{,}\) but also the Chain Rule gives
\begin{equation*}
0 = \frac{d F}{d x}
= \frac{\partial F}{\partial x}\frac{d x}{d x} + \frac{\partial F}{\partial y}\frac{d y}{d x}
= \frac{\partial F}{\partial x} + \frac{\partial F}{\partial y}\frac{d y}{d x}.
\end{equation*}
Solving gives
\begin{equation}
\frac{d y}{d x} = - \frac{\partial F / \partial x}{\partial F / \partial y} = - \frac{F_x}{F_y}.\tag{4.5.1}
\end{equation}
Note the difference between \(\ds\frac{dF}{dx}\) and \(\ds\frac{\partial F}{\partial x}\text{.}\)
Example 4.5.4.
If \(y=f(x)\) is defined by the equation \(x^2 + xy^3 + \sin y = 0\text{,}\) the form \(F(x,y)=0\) has
\begin{equation*}
\frac{\partial F}{\partial x} = 2x+y^3, \quad\frac{\partial F}{\partial y} = 3xy^2 + \cos y,
\end{equation*}
so
\begin{equation*}
\frac{d y}{d x} = - \frac{F_x}{F_y} = - \frac{2x+y^3}{3xy^2 + \cos y}
\end{equation*}
This is the result one would get with implicit differentiation, but all the equation solving has been done in advance in
(4.5.1), so no longer needs to be done each time.
Subsection 4.5.3 The Implicit Function Theorem
So far it has been assumed that the equation \(F(x,y(x))=0\) determines a differentiable function \(y=f(x)\text{.}\)
This is not always true; there can be:
multiple solutions, describing different parts of the curve \(F(x,y)=0\text{,}\) and
points where that curve has a vertical tangent, so no finite value of \(dy/dx\) is possible.
The precise conditions are as follows:
Theorem 4.5.5. The Implicit Function Theorem.
-
If for a point \(P(x_0,y_0)\) satisfying \(F(x_0,y_0)=k\) (a constant),
Function
\(F\) is differentiable at point
\(P\) (see
Theorem 4.4.7); that is,
\(F\) and its partial derivatives are continuous at and near
\(P\text{,}\) and
\(\displaystyle F_y(x_0,y_0) \neq 0\)
then there is a unique differentiable function \(y=f(x)\) defined for values of \(x\) near \(x_0\) which solves \(F(x,f(x))=k\) and with \(f(x_0)=y_0\text{.}\) That is, there is a differentiable curve through \(P\) which lies in the level set \(F(x,y)=k\text{.}\)
Further, its derivative is given by
(4.5.1):
\begin{equation*}
\frac{d y}{d x} = - \frac{\partial F / \partial x}{\partial F / \partial y} = - \frac{F_x}{F_y}.
\end{equation*}
Likewise, if
\(F_x(x_0,y_0) \neq 0\text{,}\) there is a unique differentiable function
\(x=f(y)\) defined for values of
\(y\) near
\(y_0\) which solves
\(F(f(y),y)=k\) and with
\(f(y_0)=x_0\text{,}\) and
\begin{equation*}
\frac{d x}{d y} = - \frac{\partial F / \partial y}{\partial F / \partial x} = - \frac{F_y}{F_x}.
\end{equation*}
Note that in each case, the non-zero derivative condition is merely what is needed for the formulas for the derivatives along the curve to make sense!
Subsection 4.5.4 Implicitly Defined Functions of Several Variables
A function \(z=f(x,y)\) of two variables is sometimes specified as the solution of an equation \(F(x,y,z)=0\text{:}\) for example the function describing a quadric surface, or at least part of such a surface.
The Chain Rule can again be used to compute the partial derivatives of \(f\text{.}\)
(Aside: These partial derivatives help describe the tangent plane at a point on the surface \(F(x,y,z)=0\) by giving components of a normal vector to the tangent plane, which will be useful in studying surfaces defined by equations.)
For such a function \(f\text{,}\) \(u(x,y)=F(x,y,f(x,y))=0\) so both partial derivatives of this composition are zero: \(u_x = u_y=0\text{.}\)
The Chain Rule gives
\begin{equation*}
\frac{\partial u}{\partial x} = 0
= \frac{\partial F}{\partial x} \frac{\partial x}{\partial x} + \frac{\partial F}{\partial y} \frac{\partial y}{\partial x} + \frac{\partial F}{\partial z} \frac{\partial z}{\partial x}.
\end{equation*}
and a similar result for \(u_y\text{.}\)
A strange thing here is that \(x\) and \(y\) are the independent variables of \(u\) and are also two of the three intermediate variables.
Clearly intermediate variable \(y\) does not depend on independent variable \(x\text{,}\) so \(\partial y /\partial x = 0\text{,}\) and also \(\partial x /\partial x = 1\text{.}\) Thus
\begin{equation*}
\frac{\partial F}{\partial x} + \frac{\partial F}{\partial z} \frac{\partial z}{\partial x} = 0.
\end{equation*}
This and a similar calculation based on \(u_y=0\) give
\begin{equation}
\frac{\partial z}{\partial x} = - \frac{\partial F / \partial x}{\partial F / \partial z}, \quad
\frac{\partial z}{\partial y} = - \frac{\partial F / \partial y}{\partial F / \partial z}.\tag{4.5.2}
\end{equation}
Again this is valid at a point \((x_0,y_0,z_0)\) if the following version of the Implicit Function Theorem applies:
Theorem 4.5.6. The Implicit Function Theorem for \(F(x,y,z)=k\).
-
If for a point \(P(x_0,y_0,z_0)\) satisfying \(F(x_0,y_0,z_0)=k\text{,}\) the function \(F\) and its partial derivatives are continuous near \(P\) [i.e. on a ball centered at that point] and \(F_z(x_0,y_0,z_0) \neq 0\text{,}\) then there is a unique differentiable function \(z=f(x,y)\) defined for values of \((x,y)\) near \((x_0,y_0)\) which solves \(F(x,y,f(x,y))=k\) and with \(f(x_0,y_0)=z_0\text{;}\) that is, there is a "smooth surface" through \(P\) which lies in the level set \(F(x,y,z)=k\text{.}\)
Further, its derivatives are as in
(4.5.2).
Likewise for the other two possibilities of solving for \(x\) or \(y\text{.}\)