Skip to main content
Mathematics LibreTexts

1.5: The Chain Rule

  • Page ID
    139433
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    The Chain Rule

    From what has been discussed so far it might be tempting to think that the derivative of a function like \(\sin\,2x\) is simply \(\cos\,2x\), since the derivative of \(\sin\,x\) is \(\cos\,x\). It turns out that is not correct:

    \[\begin{aligned} \ddx\,(\sin\,2x) ~&=~ \ddx\,(2\;\sin\,x\;\cos\,x) \quad\text{(by the double-angle formula for sine)}\

    \[4pt] &=~ 2\;\ddx\,(\sin\,x\;\cos\,x) \quad\text{(by the Constant Multiple Rule)}\

    \[4pt] &=~ 2\;\left(\sin\,x \cdot \ddx\,(\cos\,x) ~+~ \cos\,x \cdot \ddx\,(\sin\,x)\right) \quad\text{(by the Product Rule)}\

    \[4pt] &=~ 2\;\left(\sin\,x \cdot (-\sin\,x) ~+~ \cos\,x \cdot \cos\,x\right)\

    \[4pt] &=~ 2\;\left(\cos^2 x ~-~ \sin^2 x\right)\

    \[4pt] &=~ 2\;\cos\,2x \quad\text{(by the double-angle formula for cosine)}\end{aligned} \nonumber \]

    So the derivative of \(\sin\,2x\) is \(2\,\cos\,2x\), not \(\cos\,2x\).

    In other words, you cannot simply replace \(x\) by \(2x\) in the derivative formula for \(\sin\,x\). Instead, regard \(\sin\,2x\) as a composition of two functions: the sine function and the \(2x\) function. That is, let \(f(u) = \sin\,u\), where the variable \(u\) itself represents a function of another variable \(x\), namely \(u(x) = 2x\). So since \(f\) is a function of \(u\), and \(u\) is a function of \(x\), then \(f\) is a function of \(x\), namely: \(f(x) = \sin\,2x\). Since \(f\) is a differentiable function of \(u\), and \(u\) is a differentiable function of \(x\), then \(\dfdu\) and \(\dudx\) both exist (with \(\dfdu = \cos\,u\) and \(\dudx = 2\)), and multiplying the derivatives shows that \(f\) is a differentiable function of \(x\):

    \[\begin{aligned} \frac{\df}{\cancel{\du}} \cdot \frac{\cancel{\du}}{\dx} ~&=~ \dfdx \quad\text{since the infinitesimals $\du$ cancel, so}\

    \[4pt] (\cos\,u) \cdot 2 ~&=~ \dfdx \quad\Rightarrow\quad \dfdx ~=~ 2\;\cos\,u ~=~ 2\;\cos\,2x\end{aligned} \nonumber \]

    The above argument holds in general, and is known as the Chain Rule: Notice how simple the proof is—the infinitesimals \(\du\) cancel.24

    The Chain Rule should make sense intuitively. For example, if \(\dfdu = 4\) then that means \(f\) is increasing 4 times as fast as \(u\), and if \(\dudx = 3\) then \(u\) is increasing 3 times as fast as \(x\), so overall \(f\) should be increasing \(12 = 4 \cdot 3\) times as fast as \(x\), exactly as the Chain Rule says.

    Example \(\PageIndex{1}\): sinx2pxp1deriv

    Add text here.

    Solution

    Find the derivative of \(f(x) = \sin\,(x^2 + x + 1)\).

    Solution: The idea is to make a substitution \(u = x^2 + x + 1\) so that \(f(x) = \sin\,u\). By the Chain Rule,

    \[\begin{aligned} \dfdx ~&=~ \dfdu \cdot \dudx\

    \[4pt] &=~ \ddu\,(\sin\,u) \;\cdot\; \ddx\,(x^2 + x + 1)\

    \[4pt] &=~ (\cos\,u) \cdot (2x + 1)\

    \[4pt] &=~ (2x + 1)\,\cos\,(x^2 + x + 1) \end{aligned} \nonumber \]

    after replacing \(u\) by its definition as a function of \(x\) in the last step; the final answer for the derivative should be in terms of \(x\), not \(u\).

    In the Chain Rule you can think of the function in question as the composition of an “outer” function \(f\) and an “inner” function \(u\); first take the derivative of the “outer” function then multiply by the derivative of the “inner” function. Think of the “inner” function as a box into which you can put any function of \(x\), and the “outer” function being a function of that empty box.

    For instance, for the function \(f(x) = \sin\,(x^2 + x + 1)\) in the previous example, think of the “outer” function as \(\sin\,\Box\), where \(\Box = x^2 + x + 1\) is the “inner” function, so that

    \[\begin{aligned} f(x) ~&=~ \sin\,(x^2 + x + 1)\\ &=~ \sin\,\Box\\ \dfdx ~&=~ \left(\cos\,\Box\right) \;\cdot\; \ddx\,\Box\

    \[4pt] &=~ \left(\cos\,\setlength{\fboxsep}{2pt}\boxed{x^2 + x + 1}\right) \;\cdot\; \ddx\,\setlength{\fboxsep}{2pt}\boxed{x^2 + x + 1}\

    \[4pt] &=~ (2x + 1)\,\cos\,(x^2 + x + 1)\end{aligned} \nonumber \]

    Example \(\PageIndex{1}\): chainrulepow

    Add text here.

    Solution

    Find the derivative of \(f(x) = (2x^4 - 3\cos\,x)^{10}\).

    Solution: Here the “outer” function is \(f(\Box) = \Box^{10}\) and the “inner” function is \(\Box = u = 2x^4 - 3\cos\,x\):

    \[\dfdx ~=~ \dfdu \cdot \dudx ~=~ 10\,\Box^9 \;\cdot\; \ddx\,(\Box) ~=~ 10\,(2x^4 - 3\cos\,x)^9 \;(8x^3 + 3\sin\,x) \nonumber \]

    Recall that the composition \(f \circ g\) of two functions \(f\) and \(g\) is defined as \((f \circ g)(x) = f(g(x))\). Using prime notation the Chain Rule can be written as:

    Using the Chain Rule, the Power Rule can be extended to include exponents that are rational numbers:25 To prove this, let \(r = m/n\), where \(m\) and \(n\) are integers with \(n \ne 0\). Then \(y = x^r = x^{m/n} = \left(x^m\right)^{1/n}\), so that \(y^n = x^m\). Taking the derivative with respect to \(x\) of both sides of this equation gives

    \[\begin{aligned} \ddx\,\left(y^n\right) ~&=~ \ddx\,\left(x^m\right) \quad\text{, so evaluating the left side by the Chain Rule gives}\

    \[4pt] n y^{n-1} \;\cdot\; \dydx ~&=~ m x^{m-1}\

    \[4pt] n \left(x^{m/n}\right)^{n-1} \;\cdot\; \dydx ~&=~ m x^{m-1}\

    \[4pt] \dydx ~&=~ \frac{m x^{m-1}}{n x^{m - (m/n)}} ~=~ \frac{m}{n}\,x^{m - 1 - (m - (m/n))} ~=~ \frac{m}{n}\,x^{(m/n) - 1} ~=~ r\,x^{r-1} \quad\checkmark\end{aligned} \nonumber \]

    Example \(\PageIndex{1}\): derivsqrtx

    Add text here.

    Solution

    Find the derivative of \(f(x) = \sqrt{x}\).

    Solution: Since \(\sqrt{x} = x^{1/2}\) then by the Power Rule:

    \[\dfdx ~=~ \ddx\,\left(x^{1/2}\right) ~=~ \frac{1}{2}\,x^{1/2 - 1} ~=~ \frac{1}{2}\,x^{-1/2} ~=~ \frac{1}{2\,\sqrt{x}} \nonumber \]

    Example \(\PageIndex{1}\): deriv1oversqrtx

    Add text here.

    Solution

    Find the derivative of \(f(x) = \frac{2}{3\sqrt{x}}\).

    \[\dfdx ~=~ \ddx\,\left(\frac{2}{3}\,x^{-1/2}\right) ~=~ \frac{2}{3} \cdot \frac{-1}{2}\,x^{-3/2} ~=~ -\frac{1}{3\,x^{3/2}} \nonumber \]

    [sec1dot5]

    For Exercises 1-18, find the derivative of the given function.

    2

    \(f(x) ~=~ (1 ~-~ 5x)^4\)

    \(f(x) ~=~ 5\,(x^3 ~+~ x ~-~ 1)^4\)

    2

    \(f(x) ~=~ \sqrt{1 ~-~ 2x}\vphantom

    ParseError: ")" expected (click for details)
    Callstack:
        at (Sandboxes/dinesh.koticha_at_gmail.com/Elementary_Calculus_(Corral)/01:_The_Derivative/1.05:_The_Chain_Rule), /content/body/div/p[68]/span, line 1, column 5
        at wiki.page()
        at (Bookshelves/Calculus/Elementary_Calculus_2e_(Corral)/01:_The_Derivative/1.05:_The_Chain_Rule), /content/body/div/pre, line 2, column 14
    
    \)

    \(f(x) ~=~ (1 ~-~ x^2 )^{\tfrac{3}{2}}\)

    2

    \(f(x) ~=~ \dfrac{\sqrt{x}}{x ~+~ 1}\)

    \(f(x) ~=~ \dfrac{\sqrt{x} ~+~ 1}{\sqrt{x} ~-~ 1}\)

    2

    \(f(t) ~=~ \left(\dfrac{1 ~-~ t}{1 ~+~ t}\right)^4\vphantom{\left(\dfrac{x^2 ~+~ 1}{x ~-~ 1}\right)^6}\)

    \(f(x) ~=~ \left(\dfrac{x^2 ~+~ 1}{x ~-~ 1}\right)^6\)

    2

    \(f(x) ~=~ \sin^2 x\)

    \(f(x) ~=~ \cos\,\left(\sqrt{x}\right)\)

    2

    \(f(x) ~=~ 3 \tan\,(5x)\)

    \(f(x) ~=~ A\,\cos\,(\omega x ~+~ \phi)\) (\(A\), \(\omega\), \(\phi\) are constants)

    2

    \(f(x) ~=~ \sec\,(x^2)\vphantom{\left(\dfrac{1}{1 - x}\right)}\)

    \(f(x) ~=~ \sin^2 \left(\dfrac{1}{1 - x}\right) ~+~ \cos^2 \left(\dfrac{1}{1 - x}\right)\)

    2

    \(L(\beta) ~=~ \dfrac{1}{\sqrt{1 ~-~ \beta^2}}\vphantom{\left(1 ~+~ \left(\dfrac{x - l}{s}\right)^2\right)^{-1}}\)

    \(f(x) ~=~ \dfrac{1}{\pi s}\left(1 ~+~ \left(\dfrac{x - l}{s}\right)^2\right)^{-1}\) (\(s\), \(l\) are constants)

    2

    \(f(x) ~=~ \cos\,(\cos\,x)\)

    \(f(x) ~=~ \sqrt{1 ~+~ \sqrt{x}}\)

    [[1.]]

    In a certain type of electronic circuit26 the overall gain \(A_v\) is given by

    \[A_v ~=~ \frac{A_o}{1 ~-~ T} \nonumber \]

    where the loop gain \(T\) is a function of the open-loop gain \(A_o\).

    1. Show that

      \[\frac{d \negmedspace A_v}{d\!A_o} ~=~ \frac{1}{1 ~-~ T} ~-~ \frac{A_o}{(1 ~-~ T)^2} \frac{d \negmedspace (1 - T)}{d\!A_o} ~. \nonumber \]

    2. In the case where \(T\) is directly proportional to \(A_o\), use part (a) to show that

      \[\frac{d \negmedspace A_v}{d\!A_o} ~=~ \frac{1}{(1 ~-~ T)^2} ~. \nonumber \]

      (Hint: First show that \(\;A_o \cdot \frac{d \negmedspace (1 - T)}{d\!A_o} ~=~ -T\).)

    Show that the Chain Rule can be extended to 3 functions: if \(u\) is a differentiable function of \(x\), \(v\) is a differentiable function of \(u\), and \(f\) is a differentiable function of \(v\), then

    \[\dfdx ~=~ \dfdv \;\cdot\; \dvdu \;\cdot\; \dudx \nonumber \]

    so that \(f\) is a differentiable function of \(x\). Notice that the 3 derivatives are linked together as in a chain (hence the name of the rule). The Chain Rule can be extended to any finite number of functions by the above technique.

    In an internal combustion engine, as a piston moves downward the connecting rod rotates the crank in the clockwise direction, as shown in Figure [fig:crank] below.27

    The point \(A\) can only move vertically, causing the point \(B\) to move around a circle of radius \(a\) centered at the point \(O\), which is directly below the point \(A\) and does not move. As the crank rotates it makes an angle \(\theta\) with the line \(\overline{OA}\). Let \(l = AB\) and \(s = OA\) as in the picture. Assume that all lengths are measured in centimeters, and let the time variable \(t\) be measured in minutes.

    1. Show that \(s ~=~ a \cos\,\theta ~+~ \left(l^2 ~-~ a^2 \sin^2\theta\right)^{1/2}~\) for \(0 \le \theta \le \pi\).
    2. The mean piston speed is \(\bar{S}_p = 2LN\), where \(L = 2a\) is the piston stroke, and \(N\) is the rotational velocity of the crank, measured in revolutions per minute (rpm). The instantaneous piston velocity is \(S_p = \dsdt\). Let \(R = l/a\). Show that for \(0 \le \theta \le \pi\),

      \[\ABS{\frac{S_p}{\bar{S}_p}} ~=~ \frac{\pi}{2}\,\sin\,\theta \left[1 ~+~ \frac{\cos\,\theta}{\left(R^2 - \sin^2\theta\right)^{1/2}}\right] ~~. \nonumber \]


    This page titled 1.5: The Chain Rule is shared under a GNU General Public License 3.0 license and was authored, remixed, and/or curated by Michael Corral.

    • Was this article helpful?