# How Does the Chain Rule for Differentiation Work?

The chain rule looks a bit complex in its theoretic form, but it is easy to use as soon as you understand the logic of it. The chain rule is used to differentiate composite functions, which are functions that have another function as an argument.

Formula

### TheChainRule

 $\phantom{\rule{-0.17em}{0ex}}{\left[f\left(g\right)\right]}^{\prime }={f}^{\prime }\left(g\right)\cdot {g}^{\prime },$

where $f\left(g\right)=f\left(g\left(x\right)\right)$ and $g=g\left(x\right)$

The derivative of a composite function is equal to the derivative of the outer function multiplied by the derivative of the inner function.

This is how you use the chain rule:

1.
Identify what the inner function and the outer function. To put it simply, the inner function is the one you can cover with a finger, while the outer function is the function that is visible around your finger.
2.
Call the inner function $g\left(x\right)$. When you differentiate, everything becomes a bit clearer if you write just $g$ instead of $g\left(x\right)$.
3.
Differentiate the outer function.
4.
Differentiate the inner function.
5.
Multiply the two functions.
6.
Clean up the expression.

Example 1

Differentiate $f\left(x\right)=\phantom{\rule{-0.17em}{0ex}}{\left(2{x}^{2}+2x+4\right)}^{5}$

Hold your finger over what is inside the parentheses. You can see that the “power of 5” is on the outside. That means

 $g=2{x}^{2}+2x+4$

is the inner function and ${\left(g\right)}^{5}$ is the outer function. That gives you $f\left(g\right)={\left(g\right)}^{5}$ and $g=2{x}^{2}+2x+4$, and

$\begin{array}{llll}\hfill {f}^{\prime }\left(g\right)& =5{\left(g\right)}^{4}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {g}^{\prime }& =4x+2.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Then you get

$\begin{array}{llll}\hfill \phantom{\rule{-0.17em}{0ex}}{\left[f\left(g\right)\right]}^{\prime }& =5{\left(g\right)}^{4}\cdot {g}^{\prime }\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =5\phantom{\rule{-0.17em}{0ex}}{\left(2{x}^{2}+2x+4\right)}^{4}\left(4x+2\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Example 2

Differentiate $f\left(x\right)={e}^{{x}^{3}+2x}$

You hold your finger over the stuff in the exponent and see that “$e$” is on the outside. That gives you that $g={x}^{3}+2x$ is the inner function and ${e}^{g}$ is the outer function. This means that $f\left(g\right)={e}^{g}$ and $g={x}^{3}+2x$, and

$\begin{array}{llll}\hfill {f}^{\prime }\left(g\right)& ={e}^{g}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {g}^{\prime }& =3{x}^{2}+2\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Then you get

$\begin{array}{llll}\hfill \phantom{\rule{-0.17em}{0ex}}{\left[f\left(g\right)\right]}^{\prime }& ={e}^{g}\cdot {g}^{\prime }\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={e}^{{x}^{3}+2x}\phantom{\rule{-0.17em}{0ex}}\left(3{x}^{2}+2\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\phantom{\rule{-0.17em}{0ex}}\left(3{x}^{2}+2\right){e}^{{x}^{3}+2x}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Example 3

Differentiate $f\left(x\right)=\mathrm{ln}\phantom{\rule{-0.17em}{0ex}}\left(4{x}^{2}-3x+2\right)$

Put your finger over what’s in the parentheses and see that $\mathrm{ln}\left(g\right)$ is on the outside. That gives you that $g=4{x}^{2}-3x+2$ is the inner function and $\mathrm{ln}\left(g\right)$ is the outer function, and

$\begin{array}{rcll}{f}^{\prime }\left(g\right)& =\frac{1}{g}\cdot {g}^{\prime }& & \text{}\\ {g}^{\prime }& =8x-3& & \text{}\end{array}$

Then you get

$\begin{array}{llll}\hfill \phantom{\rule{-0.17em}{0ex}}{\left[f\left(g\right)\right]}^{\prime }& =\frac{1}{g}\cdot {g}^{\prime }\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\frac{1}{4{x}^{2}-3x+2}\cdot \left(8x-3\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\frac{8x-3}{4{x}^{2}-3x+2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$