Chain Rule
Composition of Functions
We define a composite (or
compound) function of $x$ as a function that is "composed" of two
functions; one function depends on the other function that
depends on $x$, namely $y= f(g(x))$. The notation you
may have seen before is $y=(f \circ g)(x)=f(g(x))$. Suppose
that we have variables $x$, $y$, and $u$, and that $y = f(u)$ and $u
= g(x)$. (Previously we called $u=g(x)$ the inside part of $f(g(x))$.) Then $f$
is a composite function of $x$.
DO: Find $f$ and $g$
and write as $f(g(x))$ in the following examples in order to
familiarize yourself with the notation. Determine the
inside part and outside part of each.
Examples
 $y=\sin(x^2)$ is a composite function with $u=x^2$ and
$y=\sin(u)$.
 $y=\sin^2(x)$ is a composite function with $u=\sin(x)$ and
$y=u^2$.
 $y=e^{3x}$ is a composite function with $u=3x$ and $y=e^u$.
 $y=(x^2 + 4x + 7)^5$ is a composite function with $u=x^2 + 4x
+ 7$ and $y=u^5$.
Version 2 of the chain rule says that
$$\frac{dy}{dx}
= \frac{dy}{du} \frac{du}{dx}$$ 
Note that $\displaystyle \frac{dy}{dx}$ is the same as
$\displaystyle{\frac{d}{dx}\Big(f\big(g(x)\big)\Big)}$, that
$\displaystyle{\frac{dy}{du}} = f'(u)=f'(g(x))$, and that
$\displaystyle{\frac{du}{dx}}$ is the same thing as $g'(x)$. So
Version 2 says the exact same thing as Version 1.
Let's see how it applies to our examples above.
DO: After looking at
the first example, try to do others before looking at the
solutions. You will learn much more by trying and doing
than by reading. While you read, write down what you are
thinking and what is happening.
Example 1: If $y=\sin(x^2)$, then $u=x^2$ so that
$y=\sin(u)$.
Then $\dfrac{du}{dx} =2x$, and $\dfrac{dy}{du}=\cos(u)$. All
together, we have $$ \frac{dy}{dx} =
\frac{dy}{du}\frac{du}{dx}=\cos(u)\cdot2x = \cos(x^2)\cdot
2x.$$
Example 2: If $y = \sin^2(x)$, then $u=\sin(x)$ so that
$y=u^2$.
Then $\dfrac{du}{dx}=\cos(x)$, and $\dfrac{dy}{du}=2u$. All
together, we have $$\frac{dy}{dx} =
\frac{dy}{du}\frac{du}{dx}=2u\cdot \cos(x) = 2\sin(x)\cos(x).$$
Example 3: If $y=e^{3x}$, then $u=3x$ so that $y=e^u$.
Then $\dfrac{du}{dx}=3$, and $\dfrac{dy}{du}=e^u$. All together, we
have $$\frac{dy}{dx}= \frac{dy}{du}\frac{du}{dx} =e^u\cdot3 = 3
e^{3x}.$$
Example 4: If $y=(x^2 + 4x + 7)^5$, then $u=x^2+4x + 7$ so
that $y=u^5$.
Then $\dfrac{du}{dx}=2x+4$, and $\dfrac{dy}{du} = 5u^4$. All
together we have $$\frac{dy}{dx} = \frac{dy}{du}\frac{du}{dx} =
5u^4(2x+4)=5(x^2+4x+7)^4(2x+4).$$
DO: Try all these examples
using version 1, $(f(g(x)))'=f'(g(x))g'(x)$, just for
practice.
