/

Chain Rule Calculator – Derivative Solver with Steps

Chain Rule Calculator — Step-by-Step Derivative with f'(g(x))·g'(x) Working
Calculus Tool

Chain Rule Calculator

The free chain rule calculator solves single-variable, nested triple-composition, and multivariable chain rule problems with full step-by-step decomposition into outer f(u) and inner g(x) functions — showing every step of f'(g(x))·g'(x) with automatic verification.

Chain Rule Derivative Calculator
d/dx[ f(x) ] = ?
sin(x^2)Trig composite
(3*x+1)^5Power composite
e^(x^3)Exponential
ln(cos(x))Log of trig
sqrt(4-x^2)Square root
tan(x^2+3*x)Tan composite
cos(5*x)Trig linear
(x^2+1)^10Power rule
2*x*sin(x^2)U-sub check

Use * for multiplication, ^ for powers. e^(x^2) not exp(x^2). Chain rule applies when you have a function inside another function.

d/dx[
sin(x²)
(3x+1)⁵
e^(x³)
ln(cos x)
√(4−x²)
cos(5x)
(x²+1)¹⁰
tan(x²+3x)
Error

Chain Rule Result — d/dx[f(g(x))] = f'(g(x)) · g'(x)

d/dx[f(x)] =
Composite Function Decomposition — f(x) = f(g(x))
Chain Rule — Step-by-Step Working
Verification
Numerical Check — Evaluate at x₀
x₀ =

Nested Chain Rule: For f(g(h(x))), the generalised chain rule gives:
d/dx[f(g(h(x)))] = f'(g(h(x))) · g'(h(x)) · h'(x)

d/dx[
sin(√(x²+1))
e^(sin(x²))
ln(cos(√x))
cos((x²+1)³)
√(sin(x²))
Error

Triple Chain Rule — d/dx[f(g(h(x)))] = f'(g(h(x)))·g'(h(x))·h'(x)

d/dx[f(x)] =
Nested Chain Rule — Outside-In Peeling Method
Verification

Multivariable Chain Rule: For z = f(x,y), x = x(t), y = y(t):
dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt)

z = f(x,y) =
x(t) =
y(t) =
z=x²y+y³, x=cos t, y=sin t
z=xy, x=eᵗ, y=t²
z=x²+y², x=sin t, y=cos t
z=xy², x=t, y=t²
Error
Partial Derivatives of z
∂z/∂x =
∂z/∂y =
Ordinary Derivatives of x(t), y(t)
dx/dt =
dy/dt =
Multivariable Chain Rule — Step-by-Step

dz/dt — Final Result

Two-Parameter Chain Rule: For z = f(x,y), x = x(s,t), y = y(s,t):
∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s)
∂z/∂t = (∂z/∂x)(∂x/∂t) + (∂z/∂y)(∂y/∂t)

z = f(x,y) =
x(s,t) =
y(s,t) =
z=x²+y², x=st, y=s+t
z=xy, x=s², y=t²
Error
Two-Parameter Chain Rule — Step-by-Step

∂z/∂s — Result

∂z/∂t — Result

Chain Rule — Interactive Reference by Function Type
1 Power Composite d/dx[(g(x))ⁿ] = n·(g(x))ⁿ⁻¹·g'(x)

Outer: f(u) = uⁿ → f'(u) = n·uⁿ⁻¹    Inner: u = g(x)

Chain rule: d/dx[(g(x))ⁿ] = n·(g(x))ⁿ⁻¹ · g'(x) — the power rule combined with the inner derivative.

(3x+1)⁵ → 5(3x+1)⁴ · 3 = 15(3x+1)⁴

(x²+1)¹⁰ → 10(x²+1)⁹ · 2x = 20x(x²+1)⁹

2 Trig Composite d/dx[sin(g(x))] = cos(g(x))·g'(x)

Outer: f(u) = sin(u) → f'(u) = cos(u)    Inner: u = g(x)

The chain rule gives: d/dx[sin(g(x))] = cos(g(x)) · g'(x). The key is that cos evaluates at g(x), not just x.

sin(x²) → cos(x²) · 2x = 2x·cos(x²)

cos(5x) → −sin(5x) · 5 = −5sin(5x)

3 Exponential Composite d/dx[e^(g(x))] = e^(g(x))·g'(x)

Outer: f(u) = eᵘ → f'(u) = eᵘ    Inner: u = g(x)

Since eᵘ differentiates to itself, the chain rule gives e^(g(x)) times g'(x) — the outer part stays unchanged.

e^(x³) → e^(x³) · 3x² = 3x²·e^(x³)

e^(x²−2x) → e^(x²−2x) · (2x−2)

4 Log Composite d/dx[ln(g(x))] = g'(x)/g(x)

Outer: f(u) = ln(u) → f'(u) = 1/u    Inner: u = g(x)

Chain rule: d/dx[ln(g(x))] = (1/g(x)) · g'(x) = g'(x)/g(x). A very commonly tested pattern.

ln(cos(x)) → (−sin(x))/cos(x) = −tan(x)

ln(x²+1) → 2x/(x²+1)

5 Square Root Composite d/dx[√(g(x))] = g'(x)/(2√(g(x)))

Outer: f(u) = √u → f'(u) = 1/(2√u)    Inner: u = g(x)

Rewrite √(g(x)) = (g(x))^(1/2), then chain rule gives (1/2)(g(x))^(−1/2) · g'(x) = g'(x)/(2√(g(x))).

√(4−x²) → (−2x)/(2√(4−x²)) = −x/√(4−x²)

Chain Rule Examples — Searchable Reference Table

Click any row to load into the chain rule calculator. Outer function shown in indigo, inner in teal.

Trigonometric Composites
f(x)d/dx [f(x)]Outer · Inner
sin(x²)2x·cos(x²)sin(u) ·
cos(5x)−5sin(5x)cos(u) · 5x
tan(x²+3x)(2x+3)sec²(x²+3x)tan(u) · x²+3x
sin(3x+1)3cos(3x+1)sin(u) · 3x+1
cos(x²)−2x·sin(x²)cos(u) ·
Exponential Composites
f(x)d/dx [f(x)]Outer · Inner
e^(x²)2x·e^(x²)eᵘ ·
e^(x³)3x²·e^(x³)eᵘ ·
e^(3x+1)3e^(3x+1)eᵘ · 3x+1
e^(sin x)cos(x)·e^(sin x)eᵘ · sin x
Logarithmic Composites
f(x)d/dx [f(x)]Outer · Inner
ln(x²+1)2x/(x²+1)ln(u) · x²+1
ln(cos x)−tan(x)ln(u) · cos x
ln(sin x)cot(x)ln(u) · sin x
ln(3x+2)3/(3x+2)ln(u) · 3x+2
Power Composites
f(x)d/dx [f(x)]Outer · Inner
(3x+1)⁵15(3x+1)⁴u⁵ · 3x+1
(x²+1)¹⁰20x(x²+1)⁹u¹⁰ · x²+1
√(4−x²)−x/√(4−x²)√u · 4−x²
√(x²+1)x/√(x²+1)√u · x²+1
sin³(x)3sin²(x)·cos(x) · sin x

What Is the Chain Rule — Definition and Formula

This chain rule calculator computes the derivative of any composite function using the chain rule formula f'(g(x))·g'(x), providing full step-by-step decomposition into an outer function and an inner function — covering single-variable, nested triple-composition, and the multivariable chain rule partial derivative calculator for dz/dt and ∂z/∂s cases.

The chain rule is the fundamental differentiation rule for composite functions — functions of the form y = f(g(x)), where one function is nested inside another. The chain rule states:

d/dx[f(g(x))] = f'(g(x)) · g'(x) Outer derivative evaluated at inner · times derivative of inner

In plain language: "Derivative of the outside (leaving the inside alone), times the derivative of the inside." This mnemonic captures the chain rule completely. Every use of the chain rule follows f'(g(x))·g'(x) — without exception.

The chain rule formula f'(g(x))·g'(x) can also be written in Leibniz notation. If y = f(u) and u = g(x), then:

dy/dx = (dy/du) · (du/dx) Leibniz form of the chain rule — rates "cancel" like fractions

This Leibniz form makes the chain rule intuitive: the du terms appear to cancel, leaving dy/dx. While this isn't rigorous, it gives the correct answer and explains why the chain rule formula f'(g(x))·g'(x) works for every composite function.

How to Use the Chain Rule — Step-by-Step Method

The chain rule differentiation calculator applies this four-step method for every composite function. Learning this process allows you to handle any chain rule problem systematically.

  1. Step 1 — Identify outer and inner function: Ask "what is the last operation performed?" That is the outer function f. Everything inside it is the inner function g(x). For sin(x²): outer = sin(u), inner = x².
  2. Step 2 — Differentiate the outer function, leaving the inner alone: Treat u = g(x) as a single variable. Compute f'(u). Do NOT touch the inner function yet.
  3. Step 3 — Differentiate the inner function: Compute g'(x) using standard differentiation rules (power rule, product rule, etc.).
  4. Step 4 — Multiply: The chain rule gives d/dx[f(g(x))] = f'(g(x))·g'(x). Substitute u = g(x) back into f'(u), then multiply by g'(x). Simplify.

Example 1: Chain Rule for sin(x²)

  1. Outer: f(u) = sin(u) → f'(u) = cos(u)
  2. Inner: u = g(x) = x² → g'(x) = 2x
  3. Substitute: f'(g(x)) = cos(x²)
  4. Chain rule: d/dx[sin(x²)] = cos(x²) · 2x = 2x·cos(x²)

Example 2: Chain Rule for (3x+1)⁵

  1. Outer: f(u) = u⁵ → f'(u) = 5u⁴
  2. Inner: u = g(x) = 3x+1 → g'(x) = 3
  3. f'(g(x)) = 5(3x+1)⁴
  4. Chain rule: d/dx[(3x+1)⁵] = 5(3x+1)⁴ · 3 = 15(3x+1)⁴

Example 3: Chain Rule for e^(x³)

  1. Outer: f(u) = eᵘ → f'(u) = eᵘ
  2. Inner: u = g(x) = x³ → g'(x) = 3x²
  3. f'(g(x)) = e^(x³)
  4. Chain rule: d/dx[e^(x³)] = e^(x³) · 3x² = 3x²·e^(x³)

Example 4: Chain Rule for ln(cos x)

  1. Outer: f(u) = ln(u) → f'(u) = 1/u
  2. Inner: u = g(x) = cos(x) → g'(x) = −sin(x)
  3. f'(g(x)) = 1/cos(x)
  4. Chain rule: d/dx[ln(cos x)] = (1/cos x)(−sin x) = −sin(x)/cos(x) = −tan(x)

Example 5: Chain Rule for √(4−x²)

  1. Rewrite: (4−x²)^(1/2)
  2. Outer: f(u) = u^(1/2) → f'(u) = (1/2)u^(−1/2) = 1/(2√u)
  3. Inner: u = g(x) = 4−x² → g'(x) = −2x
  4. f'(g(x)) = 1/(2√(4−x²))
  5. Chain rule: d/dx[√(4−x²)] = [1/(2√(4−x²))]·(−2x) = −x/√(4−x²)

Nested Chain Rule — Three or More Layers

The nested chain rule generalises f'(g(x))·g'(x) to three or more layers of composition. For f(g(h(x))), the generalised chain rule is:

d/dx[f(g(h(x)))] = f'(g(h(x))) · g'(h(x)) · h'(x) Outermost derivative · middle derivative · innermost derivative — "peel from outside in"

The method is called "outside-in peeling": differentiate the outermost function first (leaving everything inside unchanged), then multiply by the derivative of the next layer (leaving what's inside it unchanged), then multiply by the derivative of the innermost layer. This applies the chain rule formula f'(g(x))·g'(x) at each stage.

Example: d/dx[sin(√(x²+1))]

  1. Identify three layers: f(u) = sin(u), g(v) = √v, h(x) = x²+1
  2. Outermost derivative: f'(u) = cos(u) → evaluated at √(x²+1): cos(√(x²+1))
  3. Middle derivative: g'(v) = 1/(2√v) → evaluated at x²+1: 1/(2√(x²+1))
  4. Innermost derivative: h'(x) = 2x
  5. Multiply all three: cos(√(x²+1)) · [1/(2√(x²+1))] · 2x
  6. Simplify: x·cos(√(x²+1)) / √(x²+1)

Connection to Limits: The chain rule formula f'(g(x))·g'(x) can be derived from the limit definition of the derivative. The key insight (from the limit proof) is that as h → 0, the difference quotient [f(g(x+h)) − f(g(x))]/h factors into the outer and inner difference quotients — each approaching their respective derivatives. This is why the chain rule calculator's limit interpretation connects to the infinitesimal rates (dy/du)(du/dx) = dy/dx.

Multivariable Chain Rule — dz/dt and Partial Derivatives

The multivariable chain rule calculator extends f'(g(x))·g'(x) to functions of several variables. For z = f(x,y) where x and y depend on a single parameter t, the chain rule for partial derivatives gives:

dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt) Sum of partial derivative × ordinary derivative for each path through which t affects z

This partial derivative chain rule calculator formula has one term for each intermediate variable (x and y). Each term is a partial derivative of z with respect to the intermediate variable, times the ordinary derivative of that variable with respect to t. This is precisely how the chain rule formula f'(g(x))·g'(x) generalises to multiple variables.

Worked Example: z = x²y + y³, x = cos(t), y = sin(t)

  1. Compute partial derivatives: ∂z/∂x = 2xy, ∂z/∂y = x² + 3y²
  2. Compute ordinary derivatives: dx/dt = −sin(t), dy/dt = cos(t)
  3. Chain rule: dz/dt = (2xy)(−sin t) + (x²+3y²)(cos t)
  4. Substitute x = cos t, y = sin t: dz/dt = 2cos(t)sin(t)(−sin t) + (cos²t + 3sin²t)(cos t)
  5. = −2sin²(t)cos(t) + cos³(t) + 3sin²(t)cos(t)
  6. = cos³(t) + sin²(t)cos(t) = cos(t)[cos²(t) + sin²(t)] = cos(t)

For two parameters s and t (the general multivariable chain rule calculator case), where z = f(x,y), x = x(s,t), y = y(s,t), the chain rule partial derivative calculator gives two equations:

∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s) ∂z/∂t = (∂z/∂x)(∂x/∂t) + (∂z/∂y)(∂y/∂t)

The multivariable chain rule combines ordinary chain rule reasoning with partial derivatives — for computing ∂z/∂x and ∂z/∂y independently, see our Partial Derivative Calculator.

Common Mistakes With the Chain Rule

Mistake 1 — Forgetting to Multiply by g'(x)

  • ❌ Wrong: d/dx[sin(x²)] = cos(x²)
  • ✅ Correct chain rule: d/dx[sin(x²)] = cos(x²) · 2x = 2x·cos(x²)
  • The g'(x) factor — the inner derivative — is the most commonly omitted part of the chain rule formula f'(g(x))·g'(x).

Mistake 2 — Misidentifying Outer vs Inner Function

  • ❌ Wrong for ln(cos x): treating cos(x) as outer, ln as inner
  • ✅ Correct: outer = ln(u) since it wraps everything; inner = cos(x)
  • Always ask: "what is the last operation applied?" — that is the outer function.

Mistake 3 — Applying Chain Rule to Non-Composites

  • ❌ Wrong: d/dx[sin(x) + x²] — chain rule applied to a sum
  • ✅ Correct: use sum rule; neither sin(x) nor x² alone is a composite requiring chain rule
  • Chain rule only applies when one function is genuinely inside another.

Mistake 4 — Sign Errors in Trig Inner Derivatives

  • ❌ Wrong: d/dx[ln(cos x)] = sin(x)/cos(x) = tan(x)
  • ✅ Correct chain rule: g'(x) = d/dx[cos x] = −sin(x) → result is −sin(x)/cos(x) = −tan(x)
  • Always compute g'(x) explicitly; sign errors compound in chain rule problems.

Mistake 5 — Not Substituting Inner Function Back into f'(u)

  • ❌ Wrong: d/dx[sin(x²)] = cos(u)·2x (leaving u unsubstituted)
  • ✅ Correct: substitute u = x² → cos(x²)·2x — the final answer must be in terms of x only
  • After computing f'(u), always replace u with g(x) in the chain rule formula.

Worked Examples — Ten Full Chain Rule Solutions

f(x)Outer f(u)Inner g(x)d/dx[f(g(x))] = f'(g(x))·g'(x)
sin(x²)sin(u)2x·cos(x²)
(3x+1)⁵u⁵3x+115(3x+1)⁴
e^(x³)eᵘ3x²·e^(x³)
ln(cos x)ln(u)cos x−tan(x)
√(4−x²)√u4−x²−x/√(4−x²)
cos(5x)cos(u)5x−5sin(5x)
(x²+1)¹⁰u¹⁰x²+120x(x²+1)⁹
tan(x²+3x)tan(u)x²+3x(2x+3)sec²(x²+3x)
e^(sin x)eᵘsin xcos(x)·e^(sin x)
sin(√(x²+1))sin(u)√(x²+1)x·cos(√(x²+1))/√(x²+1)

Full Solution 6: cos(5x)

  1. f(u) = cos(u) → f'(u) = −sin(u)
  2. u = g(x) = 5x → g'(x) = 5
  3. f'(g(x)) = −sin(5x)
  4. Chain rule: d/dx[cos(5x)] = −sin(5x) · 5 = −5sin(5x)
  5. Verify: d/dx(−5·(−sin(5x))/5) = d/dx(sin(5x))... checking: (1/5)d/dx[cos(5x)] worked ✓

Full Solution 9: e^(sin x)

  1. f(u) = eᵘ → f'(u) = eᵘ
  2. u = g(x) = sin(x) → g'(x) = cos(x)
  3. f'(g(x)) = e^(sin x)
  4. Chain rule: d/dx[e^(sin x)] = e^(sin x) · cos(x) = cos(x)·e^(sin x)

Full Solution 10 — Nested: sin(√(x²+1))

  1. Three layers: f = sin, g = √, h = x²+1
  2. f'(g(h(x))) = cos(√(x²+1))
  3. g'(h(x)) = 1/(2√(x²+1))
  4. h'(x) = 2x
  5. Multiply: cos(√(x²+1)) · 1/(2√(x²+1)) · 2x = x·cos(√(x²+1))/√(x²+1)

Frequently Asked Questions — Chain Rule

What is the chain rule?
The chain rule is a differentiation rule for composite functions. If y = f(g(x)), then dy/dx = f'(g(x)) · g'(x) — the derivative of the outer function evaluated at the inner function, multiplied by the derivative of the inner function. Informally: "derivative of the outside times derivative of the inside." The chain rule formula f'(g(x))·g'(x) applies to every composite function without exception.
When do you use the chain rule?
Use the chain rule whenever you have a composite function — one function inside another. If you can write f(x) = outer(inner(x)), you need the chain rule. Examples: sin(x²), e^(3x+1), (x²+1)⁵, ln(cos x), √(4−x²). If the inner function is simply x itself (e.g. sin(x), x³), the chain rule gives g'(x) = 1, which is trivially true and the standard derivative formula applies directly.
What is the multivariable chain rule?
For z = f(x,y) where x = x(t) and y = y(t), the multivariable chain rule gives dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt). This combines partial derivatives of z with ordinary derivatives of x(t) and y(t). For two parameters, ∂z/∂s = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s). The multivariable chain rule is used in physics, engineering, thermodynamics, and anywhere quantities depend on multiple intermediate variables.
How is the chain rule used in related rates?
Related rates problems apply the chain rule to connect how different quantities change over time. If A = πr², then dA/dt = (dA/dr)(dr/dt) = 2πr · (dr/dt) — the chain rule formula f'(g(x))·g'(x) applied with t as the independent variable. Every related rates problem is a chain rule application: express one quantity as a function of another, differentiate implicitly with respect to time, then solve for the unknown rate.
What is the difference between the chain rule and the product rule?
The chain rule applies to composite functions f(g(x)) — functions inside other functions. The product rule applies to products f(x)·g(x) — separate functions multiplied together. Chain rule: d/dx[sin(x²)] = cos(x²)·2x. Product rule: d/dx[x·sin(x)] = sin(x) + x·cos(x). Often both are needed: d/dx[x²·sin(x³)] requires the product rule on x²·sin(x³), then the chain rule on sin(x³).
How does the chain rule relate to u-substitution in integration?
U-substitution is the chain rule in reverse. Differentiation with the chain rule: d/dx[F(g(x))] = F'(g(x))·g'(x). Integration reverses this: ∫F'(g(x))·g'(x) dx = F(g(x)) + C. When you spot a composite function multiplied by the derivative of its inner function, u-substitution "un-applies" the chain rule. Setting u = g(x), du = g'(x)dx transforms the integral into ∫F'(u) du. See our Antiderivative Calculator for u-substitution worked examples.

Related Calculators

Chain Rule Quick Reference
d/dx[f(g(x))] = f'(g(x))·g'(x) The chain rule formula — always
sin(g(x)) → cos(g(x))·g'(x) Trig outer
cos(g(x)) → −sin(g(x))·g'(x) Trig outer
e^(g(x)) → e^(g(x))·g'(x) Exponential outer
ln(g(x)) → g'(x)/g(x) Log outer
(g(x))ⁿ → n·(g(x))ⁿ⁻¹·g'(x) Power outer
√(g(x)) → g'(x)/(2√(g(x))) Sqrt outer
tan(g(x)) → sec²(g(x))·g'(x) Tan outer
dy/dx = (dy/du)·(du/dx) Leibniz form
Most Searched
d/dx[sin(x²)] = 2x·cos(x²)
d/dx[(3x+1)⁵] = 15(3x+1)⁴
d/dx[e^(x³)] = 3x²e^(x³)
d/dx[ln(cos x)] = −tan x
d/dx[√(4−x²)] = −x/√(4−x²)
d/dx[cos(5x)] = −5sin(5x)
d/dx[(x²+1)¹⁰] = 20x(x²+1)⁹
d/dx[tan(x²+3x)]

Share This Tool

Share the Chain Rule Calculator with students!

Free chemistry, physics, biology & math calculators with step-by-step solutions. Trusted by 100,000+ students. Solve any science problem instantly!

Newsletter

Subscribe to our Newsletter to be updated. We promise not to spam.

Copyright © 2026 SciSolveLab. All Rights Reserved

Scroll to Top