Visual Calculus · derivative deep dive
Interactive lesson · derivatives

Chain Rule: Formula, Visual Meaning & Worked Examples

A composite function is one function wrapped inside another. Before using calculus notation, watch one tiny change pass through an inner wrapper and then an outer wrapper. The outer stage acts on what the inner stage already changed.

Learning goalSee why nested local rates multiply, then apply that mechanism to the chain rule.
y = f(g(x))dydx = f′(g(x)) · g′(x)
Step 1

Move the idea

Drag the slider

Try it: change the OUTER wrapper rate

Move the slider

Change one parameter and watch what changes with it.

Step 2 · The aha

The outer wrapper acts on the already-scaled result. ×2 inside, then ×3 outside gives ×6 overall. That multiplication is the chain rule.

01

Map the wrappers to functions

For y=(2x+1)², the inner wrapper is g(x)=2x+1. The outer wrapper is f(u)=u². Writing u=g(x) only gives a name to the value passed from the inner layer to the outer one.

02

Now read the real local rates

The inner local rate is du/dx=2. The outer local rate is dy/du=2u, so unlike the simple playground it changes with position. The mechanism is still the same: one local scale feeds the next.

03

Multiply because the stages are nested

A tiny Δx first becomes about g′(x)Δx. The outer function then scales that already-changed amount by f′(g(x)). Therefore dy/dx=f′(g(x))g′(x).

Try it yourself

Two tiny checks before the formula drill.

Quick check 1

Inner wrapper ×2, outer wrapper ×4. What is the total local stretch?

Quick check 2

In y=(2x+1)², which part is the inner function?

Work it through

Make the idea reusable.

Leibniz notation exposes the logic

Writing dy/dx=(dy/du)(du/dx) makes the intermediate variable visible. The du symbols are not literally fractions being cancelled, but the notation mirrors the correct composition of local rates.

The outer derivative keeps the inside

Differentiate the outer function with respect to its input, then evaluate that derivative at the unchanged inner expression. Only after that do you multiply by the inner derivative.

When the inner derivative is 1

If g(x)=x+c, then g′(x)=1, so the chain-rule factor is invisible. That is why some simple examples can make the rule look unnecessary even though it is still operating.

Definition

What is the chain rule?

The chain rule differentiates a composite function. If y=f(g(x)), then dy/dx=f′(g(x))·g′(x). In words: differentiate the outside function while keeping the inside expression, then multiply by the derivative of the inside function.

Method

How to use the chain rule

  1. 01
    Identify the composition

    Find the inner expression g(x) and the outer operation f(u). A useful temporary variable is u=g(x).

  2. 02
    Differentiate the outside

    Compute f′(u), then replace u with the original inside expression g(x). Do not simplify away the inner structure too early.

  3. 03
    Differentiate the inside

    Compute g′(x). This is the second local stretch factor.

  4. 04
    Multiply and simplify

    Multiply f′(g(x)) by g′(x), then simplify the final expression if useful.

Worked examples

Chain rule worked examples

Power

Square of a linear function

y=(3x−2)2

y′=6(3x−2) Outer derivative: 2(3x−2). Inner derivative: 3. Multiply them.

Trigonometric

Sine of a quadratic

y=sin(x2)

y′=2x cos(x²) Outer derivative: cos(x²). Inner derivative: 2x.

Exponential

Exponential with an inner function

y=e5x+1

y′=5e^(5x+1) The derivative of e^u is e^u, then multiply by u′=5.

Do not mix these up

Chain rule vs product rule vs power rule

TypeWhat it describesTypical example
Chain ruleA function is inside another function.sin(x²), (3x−2)^5, e^(4x)
Product ruleTwo functions are multiplied.x² sin(x)
Power ruleA plain power of x is differentiated directly.x^7
Common questions

Chain rule FAQ

Why do you multiply by the inner derivative?

Because a small change in x is first rescaled by the inner function before the outer function sees it. Two successive local scale factors multiply.

Do I always need to write u-substitution?

No. Using u is a learning aid that exposes the two stages. Once the structure is clear, you can apply f′(g(x))g′(x) directly.

Can the chain rule be used more than once?

Yes. Nested compositions can require repeated chain-rule layers. Differentiate from the outside inward, multiplying by each inner derivative.

How is the chain rule related to substitution in integrals?

Both track how one variable changes through another, but they solve different operations. The derivative chain rule composes local rates; substitution reorganizes an integral using a change of variable.

Step 3 · One-question check

Did it click?

For y=(2x+1)², why is dy/dx = 4(2x+1)?

Continue the path
Continue the path: build the running-total idea before integrals