Chain Rule

The Chain Rule tells you how to differentiate a composite function—when one function is plugged into another—by multiplying the outer and inner derivatives.

ddxf(g(x))=f(g(x))g(x)\frac{d}{dx}f\big(g(x)\big) = f'\big(g(x)\big)\,g'(x)

Solve a problem with Chain Rule

Type the problem. The solver will use Chain Rule where Chain Rule is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Chain Rule takes
ff
gg
xx
Chain Rule
SymbolMeaning
ffThe outer function—the one applied last in the composition f(g(x))f(g(x)). It takes the output of gg as its input.
ggThe inner function—the one applied first in the composition f(g(x))f(g(x)). Its output becomes the input to ff.
xxThe independent variable, the thing you are ultimately differentiating with respect to; confusing it with the intermediate variable u=g(x)u = g(x) is a common source of error.

When to use it

Use Chain Rule when you see one function nested inside another, like sin(x2)\sin(x^2) or (3x+1)5(3x+1)^5.

Level

Usually taught in: Calculus I · Appears on: AP Calculus

Worked examples

1. Differentiate a polynomial raised to a power

Problem

Find ddx(4x+3)6\frac{d}{dx}(4x + 3)^6.
  1. Outer function: f(u)=u6,Inner function: g(x)=4x+3\text{Outer function: } f(u) = u^6, \quad \text{Inner function: } g(x) = 4x + 3

    Identify which part is the outer function (the last operation) and which is the inner (applied first). Here, we raise something to the 6th power (outer), and that something is 4x+34x + 3 (inner).

  2. f(u)=6u5f'(u) = 6u^5

    Differentiate the outer function with respect to its input uu.

  3. g(x)=4g'(x) = 4

    Differentiate the inner function with respect to xx.

  4. ddx(4x+3)6=f(g(x))g(x)=6(4x+3)54=24(4x+3)5\frac{d}{dx}(4x + 3)^6 = f'(g(x)) \cdot g'(x) = 6(4x + 3)^5 \cdot 4 = 24(4x + 3)^5

    Apply Chain Rule: the derivative of the outer function evaluated at g(x)g(x), multiplied by the derivative of the inner function.

Answer: 24(4x+3)524(4x + 3)^5

We cannot use Power Rule directly because the base 4x+34x + 3 is not just xx. Chain Rule handles this by reducing the exponent (getting 66 in front and an exponent of 55), keeping the inner expression, and multiplying by the derivative of that inner expression, which is 44.

2. Differentiate a trigonometric function with a polynomial argument

Problem

Find ddxcos(x23x)\frac{d}{dx}\cos(x^2 - 3x).
  1. Outer function: f(u)=cos(u),Inner function: g(x)=x23x\text{Outer function: } f(u) = \cos(u), \quad \text{Inner function: } g(x) = x^2 - 3x

    The cosine is applied to an expression that depends on xx, so cosine is the outer function and x23xx^2 - 3x is the inner.

  2. f(u)=sin(u)f'(u) = -\sin(u)

    The derivative of cosine is negative sine, found using the standard derivative rule.

  3. f(g(x))=sin(x23x)f'(g(x)) = -\sin(x^2 - 3x)

    Evaluate the outer derivative at the inner function g(x)=x23xg(x) = x^2 - 3x.

  4. g(x)=2x3g'(x) = 2x - 3

    Differentiate the inner function x23xx^2 - 3x with respect to xx using Power Rule.

  5. ddxcos(x23x)=sin(x23x)(2x3)\frac{d}{dx}\cos(x^2 - 3x) = -\sin(x^2 - 3x) \cdot (2x - 3)

    Multiply the derivative of the outer function (evaluated at the inner function) by the derivative of the inner function.

Answer: sin(x23x)(2x3)-\sin(x^2 - 3x) \cdot (2x - 3)

Without Chain Rule, we would have no way to handle trigonometric functions of complicated arguments—none of the basic derivative rules apply directly. Chain Rule breaks this into two familiar pieces: the derivative of cosine and the derivative of the polynomial inside it.

3. Find the rate of change of a garden plot's area

Problem

A rectangular garden plot is being enlarged. Its side length grows as s(t)=ts(t) = \sqrt{t} meters at time tt seconds, and its area is A(s)=s2A(s) = s^2 square meters. Find dAdt\frac{dA}{dt} when t=4t = 4.
  1. Outer function: A(s)=s2,Inner function: s(t)=t=t1/2\text{Outer function: } A(s) = s^2, \quad \text{Inner function: } s(t) = \sqrt{t} = t^{1/2}

    The area depends on the side length ss, which depends on time tt. Area is the outer function; the side length is the inner.

  2. dAds=2s\frac{dA}{ds} = 2s

    Differentiate area with respect to side length using Power Rule.

  3. dsdt=12t1/2=12t\frac{ds}{dt} = \frac{1}{2}t^{-1/2} = \frac{1}{2\sqrt{t}}

    Differentiate the side length with respect to time, again using Power Rule with the exponent 12\frac{1}{2}.

  4. dAdt=dAdsdsdt=2s12t\frac{dA}{dt} = \frac{dA}{ds} \cdot \frac{ds}{dt} = 2s \cdot \frac{1}{2\sqrt{t}}

    Apply Chain Rule in Leibniz notation: how area changes with time equals how area changes with side length, times how side length changes with time.

  5. Substitute s=t:dAdt=2t12t=2t2t=1\text{Substitute } s = \sqrt{t}: \quad \frac{dA}{dt} = 2\sqrt{t} \cdot \frac{1}{2\sqrt{t}} = \frac{2\sqrt{t}}{2\sqrt{t}} = 1

    Use s=ts = \sqrt{t} from the given function to simplify. The result is constant.

  6. At t=4:dAdt=1 m2/s\text{At } t = 4: \quad \frac{dA}{dt} = 1 \text{ m}^2/\text{s}

    Even without substitution, the answer is always 11 square meter per second, regardless of the time.

Answer: dAdt=1 m2/s\frac{dA}{dt} = 1 \text{ m}^2/\text{s}

This is a real-world scenario where quantity you care about (area) depends on a measurement (side length) that itself changes over time. Chain Rule connects these rates: it tells how fast the area grows with time, given how fast the side length grows with time. This kind of related-rates problem is one of the most important applications of Chain Rule.

Common mistakes

Where Chain Rule usually goes wrong
Answer came out wrong
For ddxsin(3x)\frac{d}{dx}\sin(3x), writing the answer as cos(3x)\cos(3x) and stopping.
ddxsin(3x)=cos(3x)3=3cos(3x)\frac{d}{dx}\sin(3x) = \cos(3x) \cdot 3 = 3\cos(3x)
For ddx(5x2)7\frac{d}{dx}(5x - 2)^7, writing the answer as 7(5x2)67(5x - 2)^6 without multiplying by 55.
ddx(5x2)7=7(5x2)65=35(5x2)6\frac{d}{dx}(5x - 2)^7 = 7(5x - 2)^6 \cdot 5 = 35(5x - 2)^6
For ddxln(x21)\frac{d}{dx}\ln(x^2 - 1), writing the answer as 1x21\frac{1}{x^2 - 1} and forgetting the rest.
ddxln(x21)=1x212x=2xx21\frac{d}{dx}\ln(x^2 - 1) = \frac{1}{x^2 - 1} \cdot 2x = \frac{2x}{x^2 - 1}
The mistakeWhy it is wrongThe fix
For ddxsin(3x)\frac{d}{dx}\sin(3x), writing the answer as cos(3x)\cos(3x) and stopping.The outer derivative is cos(3x)\cos(3x), but Chain Rule requires you to multiply by the derivative of the inner function, which is 33.ddxsin(3x)=cos(3x)3=3cos(3x)\frac{d}{dx}\sin(3x) = \cos(3x) \cdot 3 = 3\cos(3x)
For ddx(5x2)7\frac{d}{dx}(5x - 2)^7, writing the answer as 7(5x2)67(5x - 2)^6 without multiplying by 55.You applied the power rule correctly to the outside, but Chain Rule says you must also multiply by the derivative of what is inside the parentheses, which is 55.ddx(5x2)7=7(5x2)65=35(5x2)6\frac{d}{dx}(5x - 2)^7 = 7(5x - 2)^6 \cdot 5 = 35(5x - 2)^6
For ddxln(x21)\frac{d}{dx}\ln(x^2 - 1), writing the answer as 1x21\frac{1}{x^2 - 1} and forgetting the rest.The derivative of ln(u)\ln(u) is 1u\frac{1}{u}, which gives 1x21\frac{1}{x^2 - 1}. But Chain Rule requires multiplying by the derivative of x21x^2 - 1, which is 2x2x.ddxln(x21)=1x212x=2xx21\frac{d}{dx}\ln(x^2 - 1) = \frac{1}{x^2 - 1} \cdot 2x = \frac{2x}{x^2 - 1}

Tips and when to use something else

  • Always identify the outer and inner functions before you start differentiating—draw a box around the innermost part if it helps.
  • Forgetting to multiply by the inner derivative is the most common Chain Rule mistake. After writing f(g(x))f'(g(x)), always ask yourself: have I multiplied by g(x)g'(x)?
  • If the function is not composite, do not force Chain Rule. For example, ddxx3=3x2\frac{d}{dx}x^3 = 3x^2 by Power Rule alone; there is no need to invoke Chain Rule.
  • When functions are nested inside functions inside functions—like sin(ex2)\sin(e^{x^2})—apply Chain Rule repeatedly, working from the outside in. Each application handles one layer.

Frequently asked questions

What is the difference between Chain Rule and Power Rule?
Power Rule says ddxxn=nxn1\frac{d}{dx}x^n = nx^{n-1}, which works when the base is just xx. Chain Rule is more general: it gives ddx(g(x))n=n(g(x))n1g(x)\frac{d}{dx}(g(x))^n = n(g(x))^{n-1} \cdot g'(x) when the base is any function g(x)g(x). If you apply Power Rule to xnx^n and then compare it to Chain Rule on (g(x))n(g(x))^n, you see that Chain Rule multiplies by g(x)g'(x) at the end—that is the extra step.
Do I need to use Chain Rule every time I see a composite function?
Chain Rule is the formal technique for differentiating composites. Sometimes a composite can be rewritten in simpler form before differentiating. For example, (2x)3=8x3(2x)^3 = 8x^3, which you can differentiate with Power Rule alone. But Chain Rule is always correct and often the most direct route, especially when expansion is messy or impossible.
Can I apply Chain Rule multiple times in the same problem?
Yes. If you differentiate sin(x2+1)\sin(x^2 + 1), you apply Chain Rule once. But if you differentiate sin((2x+1)3)\sin((2x + 1)^3), you apply Chain Rule on the outside (for the sine), then again on the inside (for the power), because the argument of sine is itself composite. Work from the outside in, applying Chain Rule to each layer until you reach xx.
What if the inner function is very complicated?
Chain Rule works exactly the same way. Identify outer and inner, differentiate each, and multiply. The difficulty lies only in computing g(x)g'(x), which might require Power Rule, Product Rule, Quotient Rule, or other techniques. The structure of Chain Rule itself never changes—only the complexity of the pieces.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18