How to differentiate using the chain rule

The chain rule evaluates the derivative of a composite function f(g(x))f(g(x)) as f(g(x))g(x)f'(g(x))g'(x). It applies whenever a differentiable function is nested inside another differentiable function.

The setup

Identify the composition. Define the inner function as u=g(x)u = g(x) and the outer function as y=f(u)y = f(u).

The steps

  1. Find the derivative of the outer function with respect to uu, yielding f(u)f'(u).
  2. Find the derivative of the inner function with respect to xx, yielding g(x)g'(x).
  3. Multiply these two derivatives to get f(u)g(x)f'(u) \cdot g'(x).
  4. Substitute the original expression for g(x)g(x) back into uu.

Checking the result

If the function can be expanded algebraically (e.g., a low-power binomial), do so and differentiate term-by-term using the power rule to verify your result matches.

Common errors

The most frequent error is differentiating the outer function but forgetting to multiply by the derivative of the inner function. Another common mistake is differentiating the inner function inside the argument of the outer function, rather than evaluating the outer derivative at the original inner function.

Worked example

Evaluate the derivative of y=sin(3x2+1)y = \sin(3x^2 + 1) with respect to xx.

Let u=3x2+1u = 3x^2 + 1 and y=sin(u)y = \sin(u).

Find the derivative of the outer function: dydu=cos(u)\frac{dy}{du} = \cos(u).

Find the derivative of the inner function: dudx=6x\frac{du}{dx} = 6x.

Multiply the derivatives: dydx=dydududx=cos(u)6x\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx} = \cos(u) \cdot 6x.

Substitute uu back: dydx=6xcos(3x2+1)\frac{dy}{dx} = 6x \cos(3x^2 + 1).

FAQ

Run your own problem

References: Calculus, Volume 1 (OpenStax) · Calculus: Early Transcendentals (Stewart) · AP Calculus AB (Khan Academy)

See also