The Chain Rule
The general technique behind every composite function — powers, trig, exponentials and logarithms of anything more complicated than x.
Composite functions
Many functions are built by feeding one function into another — a composite function, like $(3x^2-1)^5$, $\sin(3x^2)$, or $e^{\sin x}$. In each case an "outer" operation (a power, a trig function, an exponential) is applied to an "inner" expression that isn't simply $x$. The previous three lessons previewed a pattern for handling these when the inner expression is linear; the chain rule is the general version, valid for any inner expression.
The chain rule
If $y$ is a function of $u$, and $u$ is itself a function of $x$, the chain rule says
To differentiate a composite function, set $u$ equal to the "inner" expression, differentiate the "outer" expression with respect to $u$, differentiate $u$ with respect to $x$, then multiply the two results together.
Look for a function wrapped around another expression — $(3x^2-1)^5$, $\sin(4x^2)$, $e^{x^2}$, $\sqrt{2x+1}$, $\ln(x^3+2)$. An "outer" operation is applied to an "inner" expression that isn't simply $x$.
The general power rule
The single most common use of the chain rule is differentiating $\big(f(x)\big)^n$ for some function $f(x)$ and constant $n$:
This single result — "bring down the power, reduce it by one, multiply by the derivative of the inside" — covers roots too, since $\sqrt{f(x)}=\big(f(x)\big)^{1/2}$.
The general pattern for standard functions
Every standard derivative from the last three lessons extends the same way, with $f(x)$ in place of a simple $kx$:
Differentiate the outer function exactly as if the inside were $x$, leaving the inside untouched — then multiply by the derivative of the inside. This works identically whether the outer function is a power, a trig function, an exponential, a logarithm, or one of the reciprocal or inverse trig functions from the previous lesson.
Worked example 1
With practice, this can be written directly: differentiate the outer power to get $5(3x^2-1)^4$, then multiply by the derivative of the inside, $6x$, without formally naming $u$.
Worked example 2
Worked example 3
Whenever the inner function is linear, $f'(x)$ is just a constant, and it cancels neatly with the fractional power — which is exactly why the earlier "multiply by $k$" shortcut for $\sin(kx)$, $e^{kx}$, and similar worked without ever mentioning the chain rule by name.
Forgetting to multiply by the inner derivative altogether — differentiating $(3x^2-1)^5$ as $5(3x^2-1)^4$ with no $\times6x$. Also common: differentiating the inside of the function instead of the outside, e.g. writing $\dfrac{d}{dx}\big[\sin(3x^2)\big]=6x\sin(3x^2)$ instead of $6x\cos(3x^2)$.
Check yourself
Differentiate $y=\ln(x^2+1)$.
(Hint: use $\dfrac{d}{dx}\big[\ln f(x)\big]=\dfrac{f'(x)}{f(x)}$.)