In single variable calculus, we learned how to use the chain rule. This rule tells us if \(y=f(u)\) and \(u=g(x)\) are two differentiable functions then \(y=f\circ g(x)\) is also a differentiable function and \[\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx},\quad \text{or}\quad (f\circ g)’ (x))=f'(u)g'(x).\]
There is an analogous theorem for functions of several variables. We start with the simplest case for functions of two variables.

Definition 1. If \(x(t)\) and \(y(t)\) are differentiable functions at \(t_0\) and if \(z=f(x,y)\) is a differentiable function at \((x_0,y_0)=(x(t_0),y(t_0))\), then \(z=f(x(t),y(t))\) is differentiable at \(t_0\), and
\[\left.\frac{dz}{dt}\right|_{t_0}=\left.\frac{\partial z}{\partial x}\right|_{(x_0,y_0)}\left.\frac{dx}{dt}\right|_{t_0}+\left.\frac{\partial z}{\partial y}\right|_{(x_0,y_0)}\left.\frac{dy}{dx}\right|_{t_0}\]

Proof: If \(t\) is given an increment \(\Delta t\), then \(x, y\), and \(z\) receive increments \(\Delta x, \Delta y\), and \(\Delta z\), and
\[\Delta z=\frac{\partial z}{\partial x} \Delta x+\frac{\partial z}{\partial y}\Delta y+\sqrt{(\Delta x)^2+(\Delta y)^2}\ \varepsilon(\Delta x,\Delta y)\]
where \(\lim_{(\Delta x,\Delta y)\to(0,0)}\varepsilon(\Delta x,\Delta y)=0\). Let’s divide both sides by \(\Delta t\):
\[\frac{\Delta z}{\Delta t}=\frac{\partial z}{\partial x} \frac{\Delta x}{\Delta t}+\frac{\partial z}{\partial y}\frac{\Delta y}{\Delta t}+\sqrt{\left(\frac{\Delta x}{\Delta t}\right)^2+\left(\frac{\Delta y}{\Delta t}\right)^2}\ \varepsilon(\Delta x,\Delta y).\]
If we let \(\Delta t\to 0\), then \(\Delta x=x(t+\Delta t)-x(t)\to 0\) because \(x(t)\) is differentiable and therefore continuous. With the same argument \(\Delta y\to 0\). Because \((\Delta x, \Delta y)\to(0,0)\), we conclude \(\varepsilon(\Delta x,\Delta y)\to 0\).

If \(t\) is the only independent variable, \[\lim_{\Delta t\to0}\frac{\Delta z}{\Delta t}=\frac{dz}{dt},\quad \lim_{\Delta t\to0}\frac{\Delta x}{\Delta t}=\frac{dx}{dt},\quad \lim_{\Delta t\to0}\frac{\Delta y}{\Delta t}=\frac{dy}{dt}.\]
Now we just need to plug these expressions in the previous equation:
\[\frac{dz}{dt}=\frac{\partial z}{\partial x}\frac{dx}{dt}+\frac{\partial z}{\partial y}\frac{dy}{dt}+\sqrt{\left(\frac{dx}{dt}\right)^2+\left(\frac{d y}{d t}\right)^2}\ \underbrace{\lim_{(\Delta x,\Delta y)\to 0} \varepsilon(\Delta x,\Delta y)}_{=0},\]
or
\[\frac{dz}{dt}=\frac{\partial z}{\partial x}\frac{dx}{dt}+\frac{\partial z}{\partial y}\frac{dy}{dt}.\]
So we have proved the theorem.

Now consider a case where there are other independent variables besides
\(t\). In this case:
\[\lim_{\Delta t\to0}\frac{\Delta z}{\Delta t}=\frac{\partial z}{\partial t},\quad \lim_{\Delta t\to0}\frac{\Delta x}{\Delta t}=\frac{\partial x}{\partial t},\quad \lim_{\Delta t\to0}\frac{\Delta y}{\Delta t}=\frac{\partial y}{\partial t},\]
and we have:
\[\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}.\]
Therefore, we have proved the following theorem.

Definition 2. If \(x=x(s,t)\) and \(y=y(s,t)\) are differentiable functions at \((s_0,t_0)\) and if \(z=f(x,y)\) is a differentiable function at \((x_0,y_0)=(x(s_0,t_0),y(s_0,t_0))\), then \(z=f(x(s,t),y(s,t))\) is differentiable at \((s_0,t_0)\), and
\[\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},\]
\[\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}.\]

We can combine the two equations in the above theorem into a single matrix equation.
\[\begin{bmatrix} \dfrac{\partial z}{\partial s} & \dfrac{\partial z}{\partial t} \end{bmatrix}=\begin{bmatrix} \dfrac{\partial z}{\partial x} & \dfrac{\partial z}{\partial y} \end{bmatrix}\ \begin{bmatrix} \dfrac{\partial x}{\partial s} & &\dfrac{\partial x}{\partial t}\\ \\ \dfrac{\partial y}{\partial s} & & \dfrac{\partial y}{\partial t} \end{bmatrix}\]
This is called the matrix form of the chain rule. Note that the partial derivatives in the first and the last matrices are evaluated at \((s_0,t_0)\), while the partial derivatives in the second matrix are evaluated at \((x_0,y_0)\).

When \(z=f(x,y)\), \(x=x(s,t)\), and \(y=y(s,t)\), \(z\) is dependent variable, and \(s\) and \(t\) are independent variables. \(x\) and \(y\) are called intermediate variables.

As you will see in the following examples, the chain can take different forms. You can draw a
tree diagram to help you determine the correct form of the chain rule for a given problem.

Figure 1. tree diagram

Start from the dependent variable, say \(z\), and draw branches to the intermediate variables, say \(x\) and \(y\). Then connect the intermediate variables to the independent variables, say \(s\) and \(t\). One each branch write the corresponding partial derivative, for example \(\partial z/\partial x\). This process is shown in Fig. 3.33. To find \(\partial z/\partial t\), read down each route to \(t\), multiply derivatives along the way, and then add the products.

Example 1

If \(z=x^2y-y^2\) and \(x=\cos t\) and \(y=e^t\) find \(\frac{dz}{dt}\) at \(t=0\).

Solution

Method (a) We can plug \(x(t)\) and \(y(t)\) into the expression for \(z\) and then differentiate with respect to \(t\):
\[\begin{aligned} z=x^2y-y^2=\cos^2 t\ e^t-(e^t)^2=\cos^2 t\ e^t-e^{2t}\quad \text{[Remember: } \left(a^b\right)^c=a^{bc}]\end{aligned}\]
Now we can easily differentiate with respect to \(t\):
\[\frac{dz}{dt}=-2\sin t \cos t e^t+\cos^2 t\ e^t-2e^{2t}\]


For the last step, we can just plug \(t=0\) into the above expression:
\[\left.\frac{dz}{dt}\right|_{t=0}=-2\sin 0 \cos 0\ e^0+\cos^2 0\ e^0-2 e^0=0+1 \times 1 – 2\times 1=-1\]

Method (b): We can use Theorem 1.
\[\frac{\partial z}{\partial x}=2xy,\quad \frac{\partial z}{\partial y}=x^2-2y\]
\[\frac{dx}{dt}=-\sin t,\quad \frac{dy}{dt}=e^t\]
\[\left.\frac{dz}{dt}\right|_{t_0}=\left.\frac{\partial z}{\partial x}\right|_{(x_0,y_0)}\left.\frac{dx}{dt}\right|_{t_0}+\left.\frac{\partial z}{\partial y}\right|_{(x_0,y_0)}\left.\frac{dy}{dx}\right|_{t_0}\]

\[\Rightarrow \frac{dz}{dt}=2xy\times (-\sin t)+(x^2-2y)\times e^t.\]

When \(t=t_0=0\)
\[x_0=x(t=t_0)=\cos 0=1,\quad y_0=y(t=t_0)=e^0=1\]

Therefore:
\[\begin{aligned} \left.\frac{dz}{dt}\right|_{t=0}&=\left[2xy\right]_{{x=1}\atop {y=1}}\times \left(-\sin t\right)_{t=0}+\left[x^2-2y\right]_{{x=1}\atop {y=1}}\times \left.e^t\right|_{t=0}\\ &=2\times 1\times 1\times 0+(1^2-2)\times 1=-1\end{aligned}\]

Sometimes, we cannot use the substitution technique. The following example is one of those situations.

Example 2

Calculate how fast the volume of a right circular cone is changing if the radius of the base is 5 in and increasing at the rate of 0.1 in/sec, and the altitude of the cone is 12 in and decreasing at rate of 0.5 in/sec.

Solution

Let \(r\) be the radius of the base, \(h\) the altitude, and \(V\) the volume of the cone. From geometry we know: \(V=\frac{1}{3}\pi r^2h\).

[from wiki]
Now \(r\) and \(h\) are functions of time, \(t\), and we want to find \(dV/dt\).

We know:
\[r_0=5\ {\rm in},\quad \frac{dr}{dt}=0.1\ {\rm in/sec}, \quad h_0=12\ {\rm in},\quad \frac{dh}{dt}=-0.5\ {\rm in/sec}\]

\[\begin{aligned} \left.\frac{dV}{dt}\right|_{t=t_0}&=\left.\frac{\partial V}{\partial r}\right|_{{r=r_0}\atop{h=h_0}}\left.\frac{dr}{dt}\right|_{t=t_0}+\left.\frac{\partial V}{\partial h}\right|_{{r=r_0}\atop{h=h_0}}\left.\frac{dh}{dt}\right|_{t=t_0}\\ &=\left(\frac{2}{3}\pi r h\right)_{{r=r_0}\atop{h=h_0}}(0.1)+\left(\frac{1}{3}\pi r^2\right)_{{r=r_0}\atop{h=h_0}}(-0.5)\\ &=\left(\frac{2}{3}\pi 5\times 12\right)(0.1)+\left(\frac{1}{3}\pi 5^2\right)(-0.5)=-\frac{\pi}{6}\ {\rm in}^3/{\rm sec}\end{aligned}\]

Of course, we expand Theorem 1 when \(z=f(x_1,\cdots,x_n)\) is a differentiable function of \(x_1,\cdots,x_n\) and \(x_1(t),\cdots,x_n(t)\) are differentiable functions of \(t\). Then:
\[\frac{dz}{dt}=\frac{\partial z}{\partial x_1}\frac{dx_1(t)}{dt}+\cdots+\frac{\partial z}{\partial x_n}\frac{dx_n(t)}{dt}.\]
We can write the above equation in a matrix form:
\[\begin{bmatrix} \dfrac{\partial z}{\partial t} \end{bmatrix}=\begin{bmatrix} \dfrac{\partial z}{\partial x_1} &\cdots & \dfrac{\partial z}{\partial x_n} \end{bmatrix}\ \begin{bmatrix} \dfrac{d x_1(t)}{d t} \\ \vdots \\ \dfrac{d x_n(t)}{d t} \end{bmatrix}\]

Example 3

Consider two objects moving with time \(t\ge 0\) on two paths given by the following equations:
\[\begin{aligned} \text{first object:}\hspace{2cm} &x_1=\sin t-1,\quad y_1=\sin 2t+1,\\ \text{second object:}\hspace{2cm} &x_2=2\sin t+2,\quad y_2=\cos 2t.\end{aligned}\]
At what rate is the distance between the two objects changing when \(t=\frac{\pi}{2}\)?

Solution

The distance between two objects \(A=(x_1,y_1)\) and \(B=(x_2,y_2)\) is:
\[s=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\]
Here \(x_1, y_1, x_2\) and \(y_2\) vary with \(t\). For part (a) and (b), we need to find \(ds/dt\). One method is to plug the formulas of \(x_1(t), y_1(t), x_2(t)\) and \(y_2(t)\) into the formula of \(s\), and make \(s\) a function of \(t\) alone. Then you can differentiate it with respect to \(t\). We leave this method to you. The second method is to use the chain rule we learned in this section:


\[\frac{ds}{dt}=\frac{\partial s}{\partial x_1}\frac{dx_1}{dt}+\frac{\partial s}{\partial y_1}\frac{dy_1}{dt}+\frac{\partial s}{\partial x_2}\frac{dx_2}{dt}+\frac{\partial s}{\partial y_2}\frac{dy_2}{dt}\]
\[\begin{aligned} &\left.\frac{dx_1}{dt}\right|_{t=\frac{\pi}{2}}=\cos t\Big|_{t=\frac{\pi}{2}}=0, \quad \left.\frac{dy_1}{dt}\right|_{t=\frac{\pi}{2}}=2\cos 2t\Big|_{t=\frac{\pi}{2}},=-2\\ &\left.\frac{dx_2}{dt}\right|_{t=\frac{\pi}{2}}=2\cos t\Big|_{t=\frac{\pi}{2}}=0,\quad \left.\frac{dy_2}{dt}\right|_{t=\frac{\pi}{2}}=-\sin 2t\Big|_{t=\frac{\pi}{2}}=0,\end{aligned}\] \begin{align*}
\Rightarrow \left.\frac{ds}{dt}\right|_{t=\frac{\pi}{2}}=&\left.\frac{\partial s}{\partial y_1}\right|_{t=\frac{\pi}{2}}\cdot\left.\frac{dy_1}{dt}\right|_{t=\frac{\pi}{2}}\\
=&\left.\frac{y_1-y_2}{s}\right|_{t=\frac{\pi}{2}}(-2)
\end{align*}

Because
\[x_1(\pi/2)=0,\quad y_1(\pi/2)=1\] \[x_2(\pi/2)=4,\quad y_2(\pi/2)=-1\] we get
\[\left.\frac{\partial s}{\partial y_1}\right|_{t=\frac{\pi}{2}}=\frac{2}{\sqrt{4^2+2^2}}=\frac{1}{\sqrt{5}}\] and finally
\[\left.\frac{ds}{dt}\right|_{t=\pi/2}=\frac{1}{\sqrt{5}}\times(-2)=-\frac{2}{\sqrt{5}}.\]

Example 4

If \(z=x^2-y^2\), find the rate of changes of \(z\) with respect to polar coordinates (find \(\frac{\partial z}{\partial r}\) and \(\frac{\partial z}{\partial \theta}\)).

Solution

In polar coordinates:
\[x=r\cos\theta,\quad y=r\sin\theta\]Method (a): We can write \(z\) in terms of \(r\) and \(\theta\) and then differentiate with respect to them directly:
\[z=(r\cos\theta)^2-(r\sin\theta)^2=r^2(\cos^2\theta-\sin^2\theta)\]
Therefore:
\[\begin{aligned} &\frac{\partial z}{\partial r}=2r(\cos^2\theta-\sin^2\theta)=2r\cos 2\theta,\quad {\color{blue}[\text{recall } \cos^2\theta-\sin^2\theta=\cos 2\theta]}\\ &\frac{\partial z}{\partial \theta}=r^2(-2\sin\theta\cos\theta-2\cos\theta\sin\theta)=-4r^2\sin\theta\cos\theta=-2r^2\sin 2\theta,\\ &\hspace{5.5cm}{\color{blue}[\text{recall } 2\sin\theta\cos\theta=\sin 2\theta]}\end{aligned}\]
Method (b): We can use the chain rule:


\[\begin{bmatrix} \dfrac{\partial z}{\partial r} & \dfrac{\partial z}{\partial \theta} \end{bmatrix}=\begin{bmatrix} \dfrac{\partial z}{\partial x} & \dfrac{\partial z}{\partial y} \end{bmatrix}\ \begin{bmatrix} \dfrac{\partial x}{\partial r} & &\dfrac{\partial x}{\partial \theta}\\ \\ \dfrac{\partial y}{\partial r} & & \dfrac{\partial y}{\partial \theta} \end{bmatrix}\]

\[\begin{aligned} &\frac{\partial z}{\partial x}=2x=2r\cos\theta, \quad \frac{\partial z}{\partial y}=-2y=-2r\sin\theta,\\ &\frac{\partial x}{\partial r}=\cos\theta,\quad \frac{\partial x}{\partial \theta}=-r\sin\theta,\\ &\frac{\partial y}{\partial r}=\sin\theta,\quad\frac{\partial y}{\partial \theta}=r\cos\theta.\end{aligned}\]
Thus:
\[\begin{aligned} \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}\\ &=(2r\cos\theta)(\cos\theta)+(-2r\sin\theta)(\sin\theta)\\ &=2r(\cos^2\theta-\sin^2\theta)\\ &=2r\cos 2\theta\end{aligned}\]

\[\begin{aligned} \frac{\partial z}{\partial \theta}&=\frac{\partial z}{\partial x}\frac{\partial x}{\partial \theta}+\frac{\partial z}{\partial y}\frac{\partial y}{\partial \theta}\\ &=(2r\cos\theta)(-r\sin\theta)+(-2r\sin\theta)(r\cos\theta)\\ &=-4r\cos\theta\sin\theta\\ &=-2r\sin 2\theta\end{aligned}\]

Example 5

If \(x(t)\), \(y(t)\) and \(z=f(x,y)\) are twice continuously differentiable functions, find
\(d^2z/dt^2\)

Solution

According to Theorem 1, we have:
\[\frac{dz}{dt}=\frac{\partial z}{\partial x}\frac{dx}{dt}+\frac{\partial z}{\partial y}\frac{dy}{dt}\]
If we differentiate with respect to \(t\), we have:
\begin{equation}
\bbox[#F2F2F2,5px,border:2px solid orange]{\frac{d^2z}{dt^2}=\frac{d}{dt}\left(\frac{\partial z}{\partial x}\right)\frac{dx}{dt}+\frac{\partial z}{\partial x}\frac{d^2x}{dt^2}+\frac{d}{dt}\left(\frac{\partial z}{\partial y}\right)\frac{dy}{dt}+\frac{\partial z}{\partial y}\frac{d^2y}{dt^2}.} \label{Eq:Ex_ChainRule} \tag{*}
\end{equation}

Now \(\frac{\partial z}{\partial x}\) and \(\frac{\partial z}{\partial y}\) are functions of \(x\) and \(y\) and to find their derivatives with respect to \(t\), we apply Theorem 1, with \(z\) replaced by \(\frac{\partial z}{\partial x}\) or \(\frac{\partial z}{\partial y}\). Then we have:
\[\begin{aligned} \frac{d}{dt}\left(\frac{\partial z}{\partial x}\right)&=\frac{\partial^2 z}{\partial x^2}\frac{dx}{dt}+\frac{\partial^2 z}{\partial y \partial x}\frac{dy}{dt},\\ \text{and}\hspace{2.5cm} \frac{d}{dt}\left(\frac{\partial z}{\partial y}\right)&=\frac{\partial^2 z}{\partial y \partial x}\frac{dx}{dt}+\frac{\partial^2 z}{\partial y^2}\frac{dy}{dt}.\end{aligned}\]
Substituting in (*), we have
\begin{align}\frac{d^2z}{dt^2}&=\left(\frac{\partial^2 z}{\partial x^2}\frac{dx}{dt}+\frac{\partial^2 z}{\partial y \partial x}\frac{dy}{dt}\right)\frac{dx}{dt}+\frac{\partial z}{\partial x}\frac{d^2x}{dt^2}\\ &+\left(\frac{\partial^2 z}{\partial y \partial x}\frac{dx}{dt}+\frac{\partial^2 z}{\partial y^2}\frac{dy}{dt}\right)\frac{dy}{dt}+\frac{\partial z}{\partial y}\frac{d^2y}{dt^2}\Rightarrow \end{align}
\begin{equation}
\bbox[#F2F2F2,5px,border:2px solid orange]{\frac{d^2z}{dt^2}=\frac{\partial^2 z}{\partial x^2}\left(\frac{dx}{dt}\right)^2+2\frac{\partial^2 z}{\partial x\partial y}\frac{d x}{dt}\frac{dy}{dt}+\frac{\partial^2 z}{\partial y^2}\left(\frac{dy}{dt}\right)^2+\frac{\partial z}{\partial x}\frac{d^2 x}{dt^2}+\frac{\partial z}{\partial y}\frac{d^2 y}{dt^2}.} \tag{**}\end{equation}

In above, we put \(\partial^2 z/(\partial x \partial y)=\partial^2 z/(\partial y\partial x)\), because the second partial derivatives of \(z=f(x,y)\) are continuous (recall Theorem 3.7.1 for the symmetry of the second partial derivatives).

Example 6

If \(x(s,t)\), \(y(s,t)\) and \(z=f(x,y)\) are twice continuously differentiable functions, find \(\frac{\partial^2 z}{\partial t^2}\) and \(\frac{\partial^2 z}{\partial s \partial t}\)

Solution

Finding \(\frac{\partial^2 z}{\partial t^2}\) is easy. We just need to replace \(\frac{d}{dt}\) by \(\frac{\partial}{\partial t}\) in Eq. (**) in the previous example. Therefore:

\begin{equation}\bbox[#F2F2F2,5px,border:2px solid orange]{\frac{\partial^2z}{\partial t^2}=\frac{\partial^2 z}{\partial x^2}\left(\frac{\partial x}{\partial t}\right)^2+2\frac{\partial^2 z}{\partial x\partial y}\frac{\partial x}{\partial t}\frac{\partial y}{\partial t}+\frac{\partial^2 z}{\partial y^2}\left(\frac{\partial y}{\partial t}\right)^2+\frac{\partial z}{\partial x}\frac{\partial^2 x}{\partial t^2}+\frac{\partial z}{\partial y}\frac{\partial^2 y}{\partial t^2}.}\label{Eq:Ex_ChainRule6}\tag{*}\end{equation}

The process of finding \(\frac{\partial^2 z}{\partial s \partial t}\)
is similar to the process of finding \(\frac{d^2 z}{dt^2}\) in the previous example. To find \(\frac{\partial^2 z}{\partial s \partial t}\), we start from \(\frac{\partial z}{\partial t}\) that we know from Theorem 2:
\[\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}.\]
Then we differentiate with respect to \(s\):
\begin{equation}\frac{\partial^2 z}{\partial s \partial t}=\frac{\partial}{\partial s}\left(\frac{\partial z}{\partial x}\right)\frac{\partial x}{\partial t}+\frac{\partial z}{\partial x}\frac{\partial^2 x}{\partial s \partial t}+\frac{\partial}{\partial s}\left(\frac{\partial z}{\partial y}\right)\frac{\partial y}{\partial t}+\frac{\partial z}{\partial y}\frac{\partial^2 y}{\partial s\partial t}.\tag{**}\end{equation}
Again \(\partial z/\partial x\) and \(\partial z/\partial y\) are two functions of \(x\) and \(y\), therefore:
\[\frac{\partial}{\partial s}\left(\frac{\partial z}{\partial x}\right)=\frac{\partial^2 z}{\partial x^2}\frac{\partial x}{\partial s}+\frac{\partial^2 z}{\partial y \partial x}\frac{\partial y}{\partial s},\]
\[\frac{\partial}{\partial s}\left(\frac{\partial z}{\partial y}\right)=\frac{\partial^2 z}{\partial x\partial y}\frac{\partial x}{\partial s}+\frac{\partial^2 z}{\partial y^2}\frac{\partial y}{\partial s}.\]
Substituting the above expressions in (**), we get:

\begin{align}\frac{\partial^2 z}{\partial s \partial t}&=\frac{\partial^2 z}{\partial x^2}\frac{\partial x}{\partial s}\frac{\partial x}{\partial t}+\frac{\partial^2 z}{\partial x\partial y}\left(\frac{\partial x}{\partial s}\frac{\partial y}{\partial t}+\frac{\partial x}{\partial t}\frac{\partial y}{\partial s}\right)\\ &+\frac{\partial^2 z}{\partial y^2}\frac{\partial y}{\partial s}\frac{\partial y}{\partial t}+\frac{\partial z}{\partial x}\frac{\partial^2 x}{\partial s\partial t}+\frac{\partial z}{\partial y}\frac{\partial^2 y}{\partial s\partial t}.\tag{***}\end{align}

Obviously (***) reduces to (*) if we put \(s=t\).

Example 7

If \(z=f(x,y)\), express \(\dfrac{\partial^2 z}{\partial x^2}+\dfrac{\partial^2 z}{\partial y^2}\) in polar coordinates.

Solution

Here we assume \(z=\phi(r,s)\), \(r=r(x,y)\) and \(\theta=\theta(x,y)\) and we want to find \(\frac{\partial^2 z}{\partial x^2}+\frac{\partial^2 z}{\partial y^2}\) in terms of the first and second partial derivates of \(z\) with respect to \(r\) and \(\theta\). Therefore in this example, \(x\) and \(y\) are independent variables and \(r\) and \(\theta\) are intermediate variables. To this end, we can use Eq. (*) in the previous example, and replace \(s\) and \(t\) with \(x\) and \(y\), and replace \(x\) and \(y\) in that equation by \(r\) and \(s\). Therefore:
\[\begin{aligned} &\frac{\partial^2z}{\partial x^2}=\frac{\partial^2 z}{\partial r^2}\left(\frac{\partial r}{\partial x}\right)^2+2\frac{\partial^2 z}{\partial r\partial \theta}\frac{\partial r}{\partial x}\frac{\partial \theta}{\partial x}+\frac{\partial^2 z}{\partial \theta^2}\left(\frac{\partial \theta}{\partial x}\right)^2\\&+\frac{\partial z}{\partial r}\frac{\partial^2 r}{\partial x^2}+\frac{\partial z}{\partial \theta}\frac{\partial^2 \theta}{\partial x^2},\\ \text{similarly}&\\ &\frac{\partial^2z}{\partial y^2}=\frac{\partial^2 z}{\partial r^2}\left(\frac{\partial r}{\partial y}\right)^2+2\frac{\partial^2 z}{\partial r\partial \theta}\frac{\partial r}{\partial y}\frac{\partial \theta}{\partial y}+\frac{\partial^2 z}{\partial \theta^2}\left(\frac{\partial
\theta}{\partial y}\right)^2\\&+\frac{\partial z}{\partial r}\frac{\partial^2 r}{\partial y^2}+\frac{\partial z}{\partial \theta}\frac{\partial^2 \theta}{\partial y^2}.\end{aligned}\] Now we need to find the partial derivates of \(r\) and \(\theta\) with respect to \(x\) and \(y\):
\[r=\sqrt{x^2+y^2}\Rightarrow\left\{\begin{array}{l l l} \dfrac{\partial r}{\partial x}=\dfrac{x}{\sqrt{x^2+y^2}}=\dfrac{x}{r} &\Rightarrow& \dfrac{\partial^2 r}{\partial x^2}=\dfrac{r-\frac{x}{r}x}{r^2}=\dfrac{y^2}{r^{3}}, \\ \\ \dfrac{\partial r}{\partial y}=\dfrac{y}{\sqrt{x^2+y^2}}=\dfrac{y}{r} &\Rightarrow & \dfrac{\partial^2 r}{\partial y^2}=\dfrac{r-\frac{y}{r}y}{r^2}=\dfrac{x^2}{r^{3}}, \end{array} \right.\]

\[\theta=\arctan\left(\frac{y}{x}\right)\Rightarrow\left\{\begin{array}{l l l} \dfrac{\partial \theta}{\partial x}=\dfrac{\frac{-y}{x^2}}{1+\frac{y^2}{x^2}}=\dfrac{-y}{r^2} &\Rightarrow& \dfrac{\partial^2 \theta}{\partial x^2}=-\dfrac{-2r\frac{x}{r}y}{r^4}=\dfrac{2xy}{r^4}, \\ \\ \dfrac{\partial \theta}{\partial y}=\dfrac{\frac{1}{x}}{1+\frac{y^2}{x^2}}=\dfrac{x}{r^2} & \Rightarrow & \dfrac{\partial^2 \theta}{\partial y^2}=\dfrac{-2r\frac{y}{r}x}{r^2}=\dfrac{-2xy}{r^{4}}, \end{array} \right.\]

Therefore:
\[\begin{aligned} \frac{\partial^2 z}{\partial x^2}+\frac{\partial^2 z}{\partial y^2}=&\frac{\partial^2 z}{\partial r^2}\left[\left(\frac{\partial r}{\partial x}\right)^2+\left(\frac{\partial r}{\partial y}\right)^2\right]+2\frac{\partial^2 z}{\partial r\partial \theta}\left[\frac{\partial r}{\partial x}\frac{\partial \theta}{\partial x}+\frac{\partial r}{\partial y}\frac{\partial \theta}{\partial y}\right]\\&+\frac{\partial^2 z}{\partial \theta^2}\left[\left(\frac{\partial \theta}{\partial x}\right)^2+\left(\frac{\partial \theta}{\partial y}\right)^2\right]\\&+\frac{\partial z}{\partial r}\left[\frac{\partial^2 r}{\partial x^2}+\frac{\partial^2 r}{\partial y^2}\right]+\frac{\partial z}{\partial \theta}\left[\frac{\partial^2 \theta}{\partial x^2}+\frac{\partial^2\theta}{\partial y^2}\right]\\ =&\frac{\partial^2 z}{\partial r^2}\left[\frac{x^2}{r^2}+\frac{y^2}{r^2}\right]+2\frac{\partial^2 z}{\partial r\partial \theta}\left[\frac{x}{r}.\frac{(-y)}{r^2}+\frac{y}{r}\frac{x}{r^2}\right]+\frac{\partial^2 z}{\partial \theta^2}\left[\frac{y^2}{r^4}+\frac{x^2}{r^4}\right]\\ &+\frac{\partial z}{\partial r}\left[\frac{y^2}{r^3}+\frac{x^2}{r^3}\right]+\frac{\partial z}{\partial \theta}\left[\frac{2xy}{r^4}-\frac{2xy}{r^4}\right]\\ =&\frac{\partial^2 z}{\partial r^2}+\frac{1}{r^2}\frac{\partial^2 z}{\partial \theta^2}+\frac{1}{r}\frac{\partial z}{\partial r}. \end{aligned}\] Thus:

\begin{equation}\bbox[#F2F2F2,5px,border:2px solid orange] {\frac{\partial^2 z}{\partial x^2}+\frac{\partial^2 z}{\partial y^2}=\frac{\partial^2 z}{\partial r^2}+\frac{1}{r}\frac{\partial z}{\partial r}+\frac{1}{r^2}\frac{\partial^2 z}{\partial \theta^2}.}\end{equation}

This is a very important result which has numerous applications in physics, engineering, and solving partial differential equations.

In physics, many quantities such as temperature, density, electrostatic and magnetic fields may vary with time and location. For example, the temperature, \(T\), on earth varies with location \((x,y,z)\) and time \(t\), so we have \(T=f(x,y,z,t)\). If the location we measure the temperature moves along a path, \(x,y\), and \(z\) also vary with time. In other words, we have \(x(t), y(t)\), and \(z(t)\). The following tree diagram shows the dependency of temperature on time:

 

If we wish to find the rate of change of \(T\) (with time), i.e. \(dT/dt\), we need to use the chain rule. With the aid of the above diagram, we multiply the corresponding derivatives along each path from \(T\) to \(t\), and add these products together:
\[\frac{dT}{dt}=\frac{\partial T}{\partial x}\frac{dx}{dt}+\frac{\partial T}{\partial y}\frac{dy}{dt}+\frac{\partial T}{\partial z}\frac{dz}{dt}+\frac{\partial T}{\partial t}.\]
Note that \(\partial T/\partial t\) is different from \(dT/dt\). The notation \(\partial T/\partial t\) means we have fixed the location and calculate the rate of change of temperature. We may indicate the fact that we have fixed the location and then measured the rate of change of temperate by writing:
\[\left(\frac{\partial T}{\partial t}\right)_{x,y,z}\]

Example 8

Suppose in a two dimensional flow, an electrical conductor creates the electrostatic potential field \(P\) given by: \[P=\cos (\pi t)\ \ln(x^2+y^2).\] If a particle of the fluid is moving along the path \(x=\sin (\frac{\pi}{2} t)+2\) and \(y=t+1\). Find the rate of change of \(P\) as seen by the particle when \(t=1\).

Solution

Here we have a function \(P(x,y,t)\) where \(x\) and \(y\) also depend on \(t\), and we want to find \(dP/dt\) when \(t=0\)

\[\frac{dP}{dt}=\frac{\partial P}{\partial x}\frac{dx}{dt}+\frac{\partial P}{\partial y}\frac{dy}{dt}+\frac{\partial P}{\partial t}\]

\[\begin{aligned} &\frac{dx}{dt}=\frac{\pi}{2} \cos \left(\frac{\pi}{2}t\right) \Rightarrow \frac{dx}{dt}\Big|_{t=1}=0\quad\\&\Rightarrow\text{we don’t need to calculate }\frac{\partial P}{\partial x} \text{ because } \frac{\partial P}{\partial x}\frac{dx}{dt}=0.\\ &\frac{dy}{dt}=1 \hspace{1cm} \text{(because it is constant, we don’t need to plug t=1 in this)}\end{aligned}\]

When \(t=1\), we have \(x=\sin(\frac{\pi}{2})+2=3\) and \(y=1+1=2\).
\[\begin{aligned} &\frac{\partial P}{\partial y}=\cos (\pi t) \frac{2y}{x^2+y^2} \Rightarrow \frac{\partial P}{\partial y}\Bigg|_{{{x=3}\atop{y=2}}\atop{t=1}}=\cos \pi \frac{2\times 2}{3^2+2^2}=-\frac{4}{13},\\ &\frac{\partial P}{\partial t}=-\pi \sin(\pi t)\ln(x^2+y^2)\Rightarrow \frac{\partial P}{\partial t}\Bigg|_{{{x=3}\atop{y=2}}\atop{t=1}}=-\pi \underbrace{\sin(\pi\times 1)}_{=0}\ln(3^2+2^2)=0.\end{aligned}\]
Therefore:
\[\frac{dP}{dt}\Bigg|_{t=1}=\frac{\partial P}{\partial y}\Bigg|_{{{x=3}\atop{y=2}}\atop{t=1}}\frac{dy}{dt}\Bigg|_{t=1}=-\frac{4}{13}\times 1=-\frac{4}{13}.\]

An alternative method is to plug \(x(t)\) and \(y(t)\) in the formula of \(P(x,y,t)\), differentiate with respect to \(t\), and then plug \(t=1\) in that. However, it is more complicated. Here we skip some calculations and show the results.

\[P=\cos (\pi t)\ \ln(x^2+y^2)=\cos(\pi t)\ \ln\left(\left(\sin \left(\frac{\pi}{2} t\right)+2\right)^2+(t+1)^2\right)\]

\begin{align}\frac{dP}{dt}&=\frac{\cos(\pi t) \left\{2 (1+t)+\pi \cos\left(\frac{\pi t}{2}\right) \left(2+\sin\left(\frac{\ \pi t}{2}\right)\right)\right\}}{(1+t)^2+\left(2+\sin\left[\frac{\pi t}{2}\right]\right)^2} \\ & -\pi \sin(\pi t) \ln\left[(1+t)^2+\left(2+\sin\left(\frac{\pi t}{2}\right)\right)^2\right]\end{align}
\[\Rightarrow \frac{dP}{dt}\Bigg|_{t=1}=-\frac{4}{13}\]

Now consider a case where \(T=f(x,y,z,t)\) and \(x=x(s,t), y=y(s,t)\), and \(z=z(s,t)\). In this case, \(T=f(x(s,t),y(s,t),z(s,t),t)=\phi(s,t)\). The following tree diagram shows this situation.

If we wish you find \(\frac{\partial \phi}{\partial t}\), according to the tree chart, we have:
\[\begin{aligned} \label{Eq:ChainRule-3} \frac{\partial \phi}{\partial t}=\frac{\partial f}{\partial x}\frac{\partial x}{\partial t}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial t}+\frac{\partial f}{\partial z}\frac{\partial z}{\partial t}+\frac{\partial f}{\partial t}.\end{aligned}\]
The above equation might be sometimes written as \(\frac{\partial T}{\partial t}=\frac{\partial T}{\partial x}\frac{\partial x}{\partial t}+\frac{\partial T}{\partial y}\frac{\partial y}{\partial t}+\frac{\partial T}{\partial z}\frac{\partial z}{\partial t}+\frac{\partial T}{\partial t}\), but we should note that \(\frac{\partial T}{\partial t}\) on the left and on the right have two different meanings. On left we are treating \(s\) as a constant, and on right we are treating \(x,y\) and \(z\) as constants. To indicate the difference between them, it would be better to use the notation in Eq. 3.2 or to write it as:
\[\begin{aligned} \label{Eq:ChainRule-4} \left(\frac{\partial T}{\partial t}\right)_s=\left(\frac{\partial T}{\partial x}\right)_{y,z,t}\left(\frac{\partial x}{\partial t}\right)_s+\left(\frac{\partial T}{\partial y}\right)_{x,z,t}\left(\frac{\partial y}{\partial t}\right)_s+\left(\frac{\partial T}{\partial z}\right)_{x,y,t}\left(\frac{\partial z}{\partial t}\right)_s+\left(\frac{\partial T}{\partial t}\right)_{x,y,z}.\end{aligned}\]
When there is no ambiguity, we may drop some or all of the subscripts.

Example 9

Given \(u= xy+yz+xz\) and \(z=x/y\), find \((\partial u/\partial x)_y\).

Solution

Method (a): According to the tree diagram:

\[\left(\frac{\partial u}{\partial x}\right)_y=\left(\frac{\partial u}{\partial x}\right)_{y,z}+\left(\frac{\partial u}{\partial z}\right)_{x,y}\left(\frac{\partial z}{\partial x}\right)_y\]
\[\begin{aligned} &\left(\frac{\partial u}{\partial x}\right)_{y,z}=y+z=y+\frac{x}{y},\\ &\left(\frac{\partial u}{\partial z}\right)_{x,y}=x+y,\hspace{2cm} \left(\frac{\partial z}{\partial x}\right)_y=\frac{1}{y}.\end{aligned}\]
Therefore:
\[\left(\frac{\partial u}{\partial x}\right)_y=y+\frac{x}{y}+(x+y)\left(\frac{1}{y}\right)=1+y+\frac{2x}{y}.\]
Method (b): First we plug \(z=x/y\) in the formula for \(u\), and then differentiate with respect to \(x\):
\[u=xy+y\frac{x}{y}+x\frac{x}{y} \Rightarrow \left(\frac{\partial u}{\partial x}\right)_y=y+1+\frac{2x}{y}.\]

Homogeneous Functions

A function \(f(x_1,\cdots,x_n)\) is called homogeneous of degree \(k\) if for any \(t>0\) and for all \((x_1,\cdots,x_n)\) in the domain of \(f\):
\[f(tx_1,\cdots,tx_n)=t^k f(x_1,\cdots,x_n)\]
In other words, a function is homogeneous if we multiply its argument by a factor, its values will be multiplied by some power of this factor. Here are some examples of homogeneous functions:

  • The function \(f(x,y)=x^2-5xy+y^2\) is homogeneous of degree 2 because:
    \[f(tx,ty)=(tx)^2-5(tx)(ty)+(ty)^2=t^2(x^2-5xy+y^2)=t^2 f(x,y).\]
  • The function \(f(x,y,z)=x^5y z^3\) is homogeneous of degree 8 because (Recall \(a^b a^c=a^{b+c}\)):\[f(tx,ty,tz)=(tx)^5 (ty) (tz)^3=(t^5 t^3) (x^5 y z^3)=t^8 f(x,y,z).\]
  • The function \(f(x,y)=(x^2 y^2)/(x^4+y^4)\) is homogeneous of degree 0 because:
    \[f(tx,ty)=\frac{t^4 x^2 y^2}{t^4(x^2+y^2)}=f(x,y).\]
  • The function \(f(x,y,z)=(x^5+y^5+z^5)^{1/5}\) is homogeneous of degree 1 because:
    \begin{align}f(tx,ty,tz)&=((tx)^5+(ty)^5+(tz)^5)^{1/5}=(t^5(x^5+y^5+z^5))^{1/5}\\&=t (x^5+y^5+z^5)^{1/5}=t f(x,y,z).\end{align}
  • The function \(f(x,y)=(x^3+y^3)/(x^2+xy)\) is homogeneous of degree -1 because:
    \[f(tx,ty)=\frac{t^3 (x^3+y^3)}{t^2(x^2+xy)}=\frac{1}{t} \frac{x^3+y^3}{x^2+xy}=t^{-1} f(x,y)\]
  • The function \(f(x,y)=\ln(x^2+y^2)\) is NOT homogeneous because in general: (Recall \(\ln{ab}=\ln{a}+\ln{b}\)and \(\ln{a^b}=b\ln{a}\))\begin{align}f(tx+ty)=\ln\left[t^2(x^2+y^2)\right]&=\ln(t^2)+\ln(x^2+y^2)\\&=2\ln t+\ln(x^2+y^2)\neq t^k \ln(x^2+y^2).\end{align}

Theorem 3. Euler’s theorem: If \(f(x,y)\) is a homogeneous function of degree \(k\) then:
\[x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=k f.\]
In general, if \(f(x_1,\cdots,x_n)\) is homogeneous of degree \(k\) then:
\[x_1\frac{\partial f}{\partial x_1}+\cdots+x_n\frac{\partial f}{\partial x_n}=k f.\]

Proof: We prove it for its simplest form. The proof for its general form is similar.

We know: \[f(tx,ty)=t^k f(x,y)\] If we differentiate this equation with respect to \(t\). If we place \(u=tx\) and \(v=tx\) and use the chain rule, we have:
\begin{equation}\frac{\partial f}{\partial u}\underbrace{\frac{\partial u}{\partial t}}_{=x}+\frac{\partial f}{\partial v}\underbrace{\frac{\partial v}{\partial t}}_{=y}=k t^{k-1} f(x,y).\tag{*}\end{equation}
Because this is true for all \(t>0\), it is true when \(t=1\). Plugging \(t=1\) in the above equation, gives \(x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=k f\).

Let’s differentiate (*) again with respect to\(t\):
\[\begin{aligned} &x\left(x\frac{\partial}{\partial u}\frac{\partial f}{\partial u}+y\frac{\partial}{\partial v}\frac{\partial f}{\partial u}\right)+y\left(x\frac{\partial}{\partial u}\frac{\partial f}{\partial v}+y\frac{\partial}{\partial v}\frac{\partial f}{\partial v}\right)=k (k-1) t^{k-2} f(x,y),\\ \text{or}\hspace{2cm} &x^2\frac{\partial^2 f}{\partial u^2}+2xy\frac{\partial^2 f}{\partial v \partial u}+y^2\frac{\partial^2 f}{\partial v^2}=k (k-1) t^{k-2} f(x,y).\end{aligned}\]
Here we assumed \(f\) is twice continuously differentiable or of class \(C^2\), hence \(\frac{\partial^2 f}{\partial u \partial v}=\frac{\partial^2 f}{\partial v \partial u}\). Placing \(t=1\), we have:
\[x^2\frac{\partial^2 f}{\partial x^2}+2xy\frac{\partial^2 f}{\partial y \partial x}+y^2\frac{\partial^2 f}{\partial y^2}=k (k-1)f(x,y).\]

Example 10

If \(z=f(x,y)\) is homogeneous of degree \(k\) and \(u=\phi(z)\), show:
\[x\frac{\partial u}{\partial x}+y\frac{\partial u}{\partial y}=k z\phi'(z).\]

Solution

According to the chain rule:


\[\frac{\partial u}{\partial x}=\underbrace{\frac{du}{dz}}_{=\phi'(z)}\frac{\partial z}{\partial x}=\phi'(z)\frac{\partial z}{\partial x},\]
\[\frac{\partial u}{\partial y}=\underbrace{\frac{du}{dz}}_{=\phi'(z)}\frac{\partial z}{\partial y}=\phi'(z)\frac{\partial z}{\partial y}.\]
Therefore
\[\begin{aligned} x\frac{\partial u}{\partial x}+y\frac{\partial u}{\partial y}&=x\phi'(z)\frac{\partial z}{\partial x}+y\phi'(z)\frac{\partial z}{\partial y}=\phi'(z)\underbrace{\left[x\frac{\partial z}{\partial x}+y\frac{\partial z}{\partial y}\right]}_{=kz}\\ &=kz\phi'(z).\end{aligned}\][Because \(z\) is homogeneous of order \(k\), according to Theorem 3 \(x\frac{\partial z}{\partial x}+y\frac{\partial z}{\partial y}=kz\).]

Example 11

Given
\[u=\arcsin\frac{x^2 y^2}{x^2+y^2},\]
find \(x\frac{\partial u}{\partial x}+y\frac{\partial u}{\partial y}\).

Solution

We note that if we put \(z=\dfrac{x^2y^2}{x^2+y^2}\), \(z\) is homogeneous of degree 2, and \(u=\phi(z)=\arcsin z\). Therefore, using the result of the previous example, we have:
\[\begin{aligned} x\frac{\partial u}{\partial x}+y\frac{\partial u}{\partial y}&=k z\phi'(z)\\ &=2 z \frac{1}{\sqrt{1-z^2}}\\ &=2 \sin u\frac{1}{\sqrt{1-\sin^2 u}}=2\frac{\sin u}{|\cos u|}=2\frac{\sin u}{\cos u}=2\tan u\end{aligned}\]
Because \(u=\arcsin z\), therefore \(-\frac{\pi}{2}\leq u\leq \frac{\pi}{2}\). In this interval \(\cos u\geq 0\). That is \(|\cos u|=\cos u\).


[1] This relationship is valid only when \(x>0\) and \(y>0\) but for our purpose it is enough.

 

Close Menu