# The Chain Rule (Examples and Proof)

Okay, so you know how to differentiation a function using a definition and some derivative rules. On the other hand, simple basic functions such as the fifth root of twice an input does not fall under these techniques. The chain rule gives another method to find the derivative of a function whose input is another function. Under certain conditions, such as differentiability, the result is fantastic, but you should practice using it.

With a lot of work, we can sometimes find derivatives without using the chain rule either by expanding a polynomial, by using another differentiation rule, or maybe by using a trigonometric identity. The derivative would be the same in either approach; however, the chain rule allows us to find derivatives that would otherwise be very difficult to handle.

## The Chain Rule and Its Proof

This section gives plenty of examples of the use of the chain rule as well as an easily understandable proof of the chain rule. In order to understand the chin rule the reader must be aware of composition of functions.

Theorem. (Chain Rule) Suppose $f$ is a differentiable function of $u$ which is a differentiable function of $x.$ Then $f(u(x))$ is a differentiable function of $x$ and \begin{equation} \frac{d f}{d x}=\frac{df}{du}\frac{du}{dx}. \end{equation}

Proof. We wish to show $\frac{d f}{d x}=\frac{df}{du}\frac{du}{dx}$ and will do so by using the definition of the derivative for the function $f$ with respect to $x,$ namely, \begin{equation} \frac{df}{dx}=\lim_{\Delta x\to 0}\frac{f[u(x+\Delta x)]-f[u(x)]}{\Delta x} \end{equation} To better work with this limit let’s define an auxiliary function: \begin{equation} g(t)= \begin{cases} \displaystyle \frac{f[u(x)+t]-f[u(x)]}{t}-\frac{df}{du} & \text{ if } t\neq 0 \\ 0 & \text{ if } t=0 \end{cases} \end{equation} Let $\Delta u=u(x+\Delta x)-u(x),$ then three properties of the function $g$ are

$(1) \quad \displaystyle g(\Delta u)=\frac{f[u(x)+\Delta u]-f[u(x)]}{\Delta u}-\frac{df}{du}$ provided $\Delta u\neq 0$

$(2) \quad \displaystyle \left[g(\Delta u)+\frac{df}{du}\right]\Delta u=f[u(x)+\Delta u]-f[u(x)]$

$(3) \quad g$ is continuous at $t=0$ since $$\lim_{t\to 0} \left[ \frac{f[u(x)+t]-f[u(x)]}{t}\right]=\frac{df}{du}.$$
Now we can rewrite $\displaystyle \frac{df}{dx}$ as follows: \begin{align} \frac{df}{dx} & = \lim_{\Delta x\to 0}\frac{f[u(x+\Delta x)]-f[u(x)]}{\Delta x} \\ & =\lim_{\Delta x\to 0}\frac{f[u(x)+\Delta u]-f[u(x)]}{\Delta x} \\ & =\lim_{\Delta x\to 0} \frac{\left(g(\Delta u)+\frac{df}{du}\right)\Delta u}{\Delta x} \\ & =\lim_{\Delta x\to 0}\left(g(\Delta u)+\frac{df}{du}\right)\lim_{\Delta x\to 0}\frac{\Delta u}{\Delta x} \\ & =\left[\lim_{\Delta x\to 0}g(\Delta u)+\lim_{\Delta x\to 0}\frac{df}{du}\right]\text{ }\lim_{\Delta x\to 0}\frac{\Delta u}{\Delta x} \\ & =\left[g\left( \lim_{\Delta x\to 0}\Delta u \right)+\lim_{\Delta x\to 0}\frac{df}{du}\right]\text{ }\lim_{\Delta x\to 0}\frac{\Delta u}{\Delta x} \\ & =\left[g(0)+\lim_{\Delta x\to 0}\frac{df}{du}\right]\text{ }\lim_{\Delta x\to 0}\frac{\Delta u}{\Delta x} \\ & =\left[0+\lim_{\Delta x\to 0}\frac{df}{du}\right]\text{ }\lim_{\Delta x\to 0}\frac{\Delta u}{\Delta x} \\ & =\frac{df}{du}\frac{du}{dx}. \end{align} as needed.

## Examples Using The Chain Rule

Example. Find the derivative of the function \begin{equation} y=\frac{x}{\sqrt{x^4+4}}. \end{equation}

Solution. Using the chain rule and the quotient rule, \begin{equation}
\frac{dy}{dx}=\frac{\sqrt{x^4+4}(1)-x\frac{d}{dx}\left(\sqrt{x^4+4}\right)}{\left(\sqrt{x^4+4}\right)^2}=\frac{\sqrt{x^4+4}(1)-x\left(\frac{2
x^3}{\sqrt{4+x^4}}\right)}{\left(\sqrt{x^4+4}\right)^2} \end{equation} which simplifies to \begin{equation} \frac{dy}{dx}=\frac{4-x^4}{\left(4+x^4\right)^{3/2}} \end{equation} as desired.

Example. Find the derivative of the function \begin{equation} g(x)=\left(\frac{3x^2-2}{2x+3}\right)^3. \end{equation}

Solution. Using the chain rule and the quotient rule, we determine, \begin{equation} \frac{dg}{dx} =3\left(\frac{3x^2-2}{2x+3} \right)^2\left(\frac{(2x+3)6x-\left(3x^2-2\right)2}{(2x+3)^2}\right)
\end{equation} which simplifies to \begin{equation} \frac{dg}{dx}=\frac{6 \left(2-3 x^2\right)^2 \left(2+9 x+3 x^2\right)}{(3+2 x)^4} \end{equation} as desired.

Example. Find the derivative of the function \begin{equation} h(t)=2 \cot ^2(\pi t+2). \end{equation}

Solution. Using the chain rule and the formula $\displaystyle \frac{d}{dx}(\cot u)=-u’\csc ^2u,$ \begin{align} \frac{dh}{dt} & =4\cot (\pi t+2)\frac{d}{dx}[\cot (\pi t+2)] \\ & =-4\pi \cot (\pi t+2)\csc ^2(\pi t+2). \end{align} as desired.

Example. Find the derivative of the function \begin{equation} y=\sin \sqrt{x}+\sqrt{\sin x} \end{equation}

Solution. Using the chain rule, \begin{align} \frac{dy}{dx}&=\cos \sqrt{x}\frac{d}{dx}\left(\sqrt{x}\right)+\frac{1}{3}(\sin x)^{-2/3}\frac{d}{dx}(\sin x) \\ & =\frac{1}{3 x^{2/3}}\cos \sqrt{x}+\frac{\cos x}{3(\sin x)^{2/3}}. \end{align}

Example. Show that \begin{equation} \frac{d}{d x}( \ln |\cos x| )=-\tan x

Solution. Using the differentiation rule $\frac{d}{dx}[\ln u]=\frac{u’}{u};$ we have, \begin{equation} \frac{d}{d x}( \ln |\cos x| ) =\frac{1}{\cos x}\frac{d}{dx}(\cos x) =\frac{\sin x}{\cos x} =\tan x \end{equation} and \begin{align} & \frac{d}{d x}( (\ln |\sec x+\tan x|) ) \\ & \qquad =\frac{1}{|\sec x+\tan x|}\frac{d}{dx}(|\sec x+\tan x|) \\ & \qquad = \frac{1}{|\sec x+\tan x|}\frac{\sec x+\tan x}{|\sec x+\tan x|}\frac{d}{dx}(\sec x+\tan x) \\ & \qquad =\frac{1}{|\sec x+\tan x|}\frac{\sec x+\tan x}{|\sec x+\tan x|}(\sec x \tan x +\sec^2 x)\\ & \qquad =\frac{\sec x \tan x+\sec ^2x}{\sec x+\tan x} \\ & \qquad =\sec x \end{align} using $\displaystyle \frac{d}{dx}[|u|]=\frac{u}{|u|}(u’), u\neq 0.$

Example. Find the derivative of the function \begin{equation} y=\sin ^4\left(x^2-3\right)-\tan ^2\left(x^2-3\right). \end{equation}

Solution. Using the chain rule, $$y’=4\sin ^3\left(x^2-3\right)\cos \left(x^2-3\right)(2x)-2\tan \left(x^2-3\right)\sec ^2\left(x^2-3\right)(2x)$$ which simplifies to $$y’=4x \left[2 \sin ^3\left(x^2-3\right)\cos \left(x^2-3\right)-\tan \left(x^2-3\right)\sec^2\left(x^2-3\right)\right].$$ as desired.

In the following examples we continue to illustrate the chain rule.

Example. Let $f$ be a function for which $$f'(x)=\frac{1}{x^2+1}.$$ If $g(x)=f(3x-1),$ what is $g'(x)?$ Also, if $h(x)=f\left(\frac{1}{x}\right),$ what is $h'(x)?$

Solution. By the chain rule $$g'(x)=f'(3x-1)\frac{d}{dx}(3x-1)=3f'(3x-1)=\frac{3}{(3x-1)^2+1}.$$ Also, by the chain rule \begin{align} h'(x) & = f’\left(\frac{1}{x}\right)\frac{d}{dx}\left(\frac{1}{x}\right) \\ & =-f’\left(\frac{1}{x}\right)\left(\frac{1}{x^2}\right) \\ & =\frac{-1}{\left(\frac{1}{x} \right)^2 + 1} \left(\frac{1}{x^2}\right) \\ & =\frac{-1}{x^2+1}. \end{align} as desired.

Example. Let $f$ be a function for which $f(2)=-3$ and $$f'(x)=\sqrt{x^2+5}.$$ If $\displaystyle g(x)=x^2f\left(\frac{x}{x-1}\right),$ what is $g'(2)?$

Solution. Using the chain rule and the product rule we determine, \begin{equation} g'(x)=2x f\left(\frac{x}{x-1}\right)+x^2f’\left(\frac{x}{x-1}\right)\frac{d}{dx}\left(\frac{x}{x-1}\right)\end{equation} \begin{equation} = 2x f\left(\frac{x}{x-1}\right)+x^2f’\left(\frac{x}{x-1}\right)\left(\frac{-1}{(x-1)^2}\right). \end{equation} Therefore, \begin{equation} g'(2)=2(2) f\left(\frac{2}{2-1}\right)+2^2f’\left(\frac{2}{2-1}\right)\left(\frac{-1}{(2-1)^2}\right)=-24. \end{equation} as desired.

Example. Assuming that the following derivatives exists, find \begin{equation} \frac{d}{d x}f’ [f(x)] \qquad \text{and}\qquad \frac{d}{d x}f [f'(x)]. \end{equation}

Solution. Using the chain rule, \begin{equation} \frac{d}{d x}f'[f(x)] =f” [ f(x)] f'(x) \end{equation} which is the second derivative evaluated at the function multiplied by the first derivative; while, \begin{equation} \frac{d}{d x}f [f'(x)]=f'[f'(x)]f”(x) \end{equation} is the first derivative evaluated at the first derivative multiplied by the second derivative. When will these derivatives be the same?

Example. Show that if a particle moves along a straight line with position $s(t)$ and velocity $v(t),$ then its acceleration satisfies $a(t)=v(t)\frac{dv}{ds}.$ Use this formula to find $\frac{dv}{d s}$ in the case where $s(t)=-2t^3+4t^2+t-3.$

Solution. By the chain rule, \begin{equation} a(t)=\frac{dv}{dt}=\frac{dv}{d s}\frac{ds}{dt}=v(t)\frac{dv}{ds} \end{equation} In the case where $s(t)=-2t^3+4t^2+t-3;$ we determine, \begin{equation} \frac{ds}{dt} = v(t) = -6t^2+8t+1 \qquad \text{and } \qquad a(t)=-12t+8. \end{equation} Thus, \begin{equation} \frac{dv}{d s}=\frac{-12t+8}{-6t^2+8t+1}. \end{equation} What does this rate of change represent?

Example. Find an equation of the tangent line to the graph of the function $f(x)=\left(9-x^2\right)^{2/3}$ at the point $(1,4).$

Solution. By using the chain rule we determine, \begin{equation} f'(x)=\frac{2}{3}\left(9-x^2\right)^{-1/3}(-2x)=\frac{-4x}{3\sqrt{9-x^2}} \end{equation}
and so $\displaystyle f'(1)=\frac{-4}{3\sqrt{9-1^2}}=\frac{-2}{3}.$ Therefore, an equation of the tangent line is $y-4=\left(\frac{-2}{3}\right)(x-1)$ which simplifies to $$y=\frac{-2}{3}x+\frac{14}{3}.$$

Example. Determine the point(s) at which the graph of \begin{equation} f(x)=\frac{x}{\sqrt{2x-1}} \end{equation} has a horizontal tangent.

Solution. By using the chain rule we determine, \begin{align} f'(x) & = \frac{\sqrt{2x-1}(1)-x\frac{d}{dx}\left(\sqrt{2x-1}\right)}{\left(\sqrt{2x-1}\right)^2} \\ & =\frac{\sqrt{2x-1}(1)-x \left(\frac{1}{\sqrt{-1+2 x}}\right)}{\left(\sqrt{2x-1}\right)^2} \end{align} which simplifies to $$f'(x)=\frac{-1+x}{(-1+2 x)^{3/2}}.$$ Thus the only point where $f$ has a horizontal tangent line is $(1,1).$

## Exercises on the Chain Rule

Exercise. Given $y=6u-9$ and find $\frac{dy}{dx}$ for (a) $u=(1/2)x^4$, (b) $u=-x/3$, and (c) $u=10x-5.$

Exercise. For each of the following functions, write the function ${y=f(x)}$ in the form $y=f(u)$ and $u=g(x)$, then find $\frac{dy}{dx}.$

$(1) \quad \displaystyle y=\left(\frac{x^2}{8}+x-\frac{1}{x}\right)^4$

$(2) \quad \displaystyle y=\sec (\tan x)$

$(3) \quad \displaystyle y=5 \cos ^{-4}x$

$(4) \quad \displaystyle y=e^{5-7x}$

$(5) \quad \displaystyle y=\sqrt{2x-x^2}$

$(6) \quad \displaystyle y=e^x \sqrt{2x-x^2}$

Exercise. Find the derivative of the following functions.

$(1) \quad \displaystyle r=-(\sec \theta +\tan \theta )^{-1}$

$(2) \quad \displaystyle y=\frac{1}{x}\sin ^{-5}x-\frac{x}{3}\cos ^3x$

$(3) \quad \displaystyle y=(4x+3)^4(x+1)^{-3}$

$(4) \quad \displaystyle y=(1+2x)e^{-2x}$

$(5) \quad \displaystyle h(x)=x \tan \left(2 \sqrt{x}\right)+7$

$(6) \quad \displaystyle g(t)=\left(\frac{1+\cos t}{\sin t}\right)^{-1}$

$(7) \quad \displaystyle q=\sin \left(\frac{t}{\sqrt{t+1}}\right)$

$(8) \quad \displaystyle y=\theta ^3e^{-2\theta }\cos 5\theta$

$(9) \quad \displaystyle y=(1+\cos 2t)^{-4}$

$(10) \quad \displaystyle y=\left(e^{\sin (t/2)}\right)^3$

$(11) \quad \displaystyle y=\left(1+\tan ^4\left(\frac{t}{12}\right)\right)^3$

$(12) \quad \displaystyle y=4 \sin \left(\sqrt{1+\sqrt{t}}\right)$

$(13) \quad \displaystyle y=\frac{1}{9}\cot (3x-1)$

$(14) \quad \displaystyle y=\sin \left(x^2e^x\right)$

$(15) \quad \displaystyle y=e^x \sin \left(x^2e^x\right)$

Exercise. Suppose that the functions $f$, $g$, and their derivatives with respect to $x$ have the following values at $x=0$ and $x=1.$ \begin{equation} \begin{array}{c|cccc} x & f(x) & g(x) & f'(x) & g'(x) \\ \hline 0 & 1 & 1 & 5 & 1/3 \\ 1 & 3 & -4 & -1/3 & -8/3 \end{array} \end{equation} Find the derivatives with respect to $x$ of the following combinations at a given value of $x,$

$(1) \quad \displaystyle 5 f(x)-g(x), x=1$

$(2) \quad \displaystyle f(x)g^3(x), x=0$

$(3) \quad \displaystyle \frac{f(x)}{g(x)+1}, x=1$

$(4) \quad \displaystyle f(g(x)), x=0$

$(5) \quad \displaystyle g(f(x)), x=0$

$(6) \quad \displaystyle \left(x^{11}+f(x)\right)^{-2}, x=1$

$(7) \quad \displaystyle f(x+g(x)), x=0$

$(8) \quad \displaystyle f(x g(x)), x=0$

$(9) \quad \displaystyle f^3(x)g(x), x=0$

Exercise. (a) Find the tangent to the curve $y=2 \tan (\pi x/4)$ at $x=1.$ (b) What is the smallest value the slope of the curve can ever have on the interval $-2<x<2?$ Give reasons for you answer.

Exercise. Suppose that $u=g(x)$ is differentiable at $x=-5,$ $y=f(u)$ is differentiable at $u=g(-5),$ and $(f\circ g)'(-5)$ is negative. What, if anything, can be said about the values of $g'(-5)$ and $f'(g(-5))?$

Exercise. Differentiate the functions given by the following equations

$(1) \quad y=\cos^2\left(\frac{1-\sqrt{x}}{1+\sqrt{x}}\right)$

$(2) \quad y=\sqrt{1+\tan \left(x+\frac{1}{x}\right)}$

$(3) \quad n=\left(y+\sqrt{y+\sqrt{2y-9}}\right)^8$

Exercise. If $g(t)=[f(\sin t)]^2,$ where $f$ is a differentiable function, find $g'(t).$

Exercise. Suppose $f$ is a differentiable function on $\mathbb{R}.$ Let $F$ and $G$ be the functions defined by $$F(x)=f(\cos x) \qquad \qquad G(x)=\cos (f(x)).$$ Find expressions for $F'(x)$ and $G'(x).$

Exercise. Determine if the following statement is true or false. Then justify your claim. If $y$ is a differentiable function of $u,$ $u$ is a differentiable function of $v,$ and $v$ is a differentiable function of $x,$ then $$\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dv}\frac{dv}{dx}.$$

Exercise. Let $u$ be a differentiable function of $x.$ Use $|u|=\sqrt{u^2}$ to prove that $$\frac{d}{dx}(|u| )=\frac{u’ u}{|u|}$$ when $u\neq 0.$ Use the formula to find $h’$ given $h(x)=x|2x-1|.$

Exercise. Show that $$\frac{d}{d\theta }(\sin \theta {}^{\circ})=\frac{\pi }{180}\cos \theta .$$ What do you think is the importance of the exercise? David Smith (Dave) has a B.S. and M.S. in Mathematics and has enjoyed teaching precalculus, calculus, linear algebra, and number theory at both the junior college and university levels for over 20 years. David is the founder and CEO of Dave4Math.