Calculus

What is the Chain Rule? (Beginner Friendly Explanation + Examples)

A simple guide to understanding and using the chain rule in calculus.

4 min read
By MathlyAI Team
CalculusChain RuleDerivativesBeginner

The chain rule is a fundamental concept in calculus used to find the derivative of composite functions. A composite function is a function created by plugging one function into another.

Think of it like a set of Russian nesting dolls—one doll is inside another. The chain rule helps us "unpack" these layers to find the derivative.

The Formula

The chain rule can be written in a couple of ways. If you have a function h(x)=f(g(x))h(x) = f(g(x)), its derivative is:

h(x)=f(g(x))g(x)h'(x) = f'(g(x)) \cdot g'(x)

In Leibniz notation, if yy is a function of uu, and uu is a function of xx, then:

dydx=dydududx\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}

This basically means: "take the derivative of the outer function (leaving the inner function as is), then multiply by the derivative of the inner function."

Example 1: A Simple Case

Let's find the derivative of h(x)=(x2+1)3h(x) = (x^2 + 1)^3.

Step 1: Identify the inner and outer functions.

  • The outer function is f(u)=u3f(u) = u^3.
  • The inner function is g(x)=x2+1g(x) = x^2 + 1.

Step 2: Find the derivatives of these functions.

  • The derivative of the outer function is f(u)=3u2f'(u) = 3u^2.
  • The derivative of the inner function is g(x)=2xg'(x) = 2x.

Step 3: Apply the chain rule.

h(x)=f(g(x))g(x)h'(x) = f'(g(x)) \cdot g'(x)

Substitute g(x)g(x) back into f(u)f'(u):

f(g(x))=3(x2+1)2f'(g(x)) = 3(x^2 + 1)^2

Now multiply by the derivative of the inner function:

h(x)=3(x2+1)22xh'(x) = 3(x^2 + 1)^2 \cdot 2x

Simplify the expression:

h(x)=6x(x2+1)2h'(x) = 6x(x^2 + 1)^2

Example 2: Trigonometric Functions

Let's find the derivative of h(x)=sin(3x)h(x) = \sin(3x).

Step 1: Identify the inner and outer functions.

  • The outer function is f(u)=sin(u)f(u) = \sin(u).
  • The inner function is g(x)=3xg(x) = 3x.

Step 2: Find the derivatives.

  • The derivative of the outer function is f(u)=cos(u)f'(u) = \cos(u).
  • The derivative of the inner function is g(x)=3g'(x) = 3.

Step 3: Apply the chain rule.

h(x)=f(g(x))g(x)h'(x) = f'(g(x)) \cdot g'(x)

Substitute g(x)g(x) into f(u)f'(u):

f(g(x))=cos(3x)f'(g(x)) = \cos(3x)

Multiply by the derivative of the inner function:

h(x)=cos(3x)3h'(x) = \cos(3x) \cdot 3

Simplify:

h(x)=3cos(3x)h'(x) = 3\cos(3x)

Example 3: A More Complex Case

Let's find the derivative of h(x)=e2x+5h(x) = \sqrt{e^{2x} + 5}.

First, rewrite the square root as a power: h(x)=(e2x+5)1/2h(x) = (e^{2x} + 5)^{1/2}.

Step 1: Identify the functions.

  • Outer function: f(u)=u1/2f(u) = u^{1/2}
  • Inner function: g(x)=e2x+5g(x) = e^{2x} + 5

Notice that the inner function g(x)g(x) is also a composite function! We'll need to apply the chain rule again.

Step 2: Find the derivative of the outer function.

f(u)=12u1/2=12uf'(u) = \frac{1}{2}u^{-1/2} = \frac{1}{2\sqrt{u}}

Step 3: Find the derivative of the inner function. To find the derivative of g(x)=e2x+5g(x) = e^{2x} + 5, we need the chain rule for e2xe^{2x}.

  • Outer function: eve^v (derivative is eve^v)
  • Inner function: 2x2x (derivative is 22) So, the derivative of e2xe^{2x} is e2x2=2e2xe^{2x} \cdot 2 = 2e^{2x}. The derivative of 5 is 0.
g(x)=2e2xg'(x) = 2e^{2x}

Step 4: Apply the chain rule to the main function.

h(x)=f(g(x))g(x)h'(x) = f'(g(x)) \cdot g'(x) h(x)=12e2x+5(2e2x)h'(x) = \frac{1}{2\sqrt{e^{2x} + 5}} \cdot (2e^{2x})

Simplify:

h(x)=e2xe2x+5h'(x) = \frac{e^{2x}}{\sqrt{e^{2x} + 5}}

Common Mistakes to Avoid

  1. Forgetting to multiply by the derivative of the inner function. This is the most common mistake.
  2. Plugging the wrong thing into the derivative of the outer function. Remember to leave the original inner function inside.
  3. Incorrectly identifying the inner and outer functions. Practice breaking down functions into their component parts.

Key Takeaways

  • The chain rule is for differentiating composite functions (f(g(x))f(g(x))).
  • The rule is: (derivative of the outside) * (derivative of the inside).
  • You might need to apply the chain rule multiple times for deeply nested functions.

Happy differentiating!