Chain Rule Calculator 2025 - Free Step-by-Step Solutions

Master derivatives of composite functions with our free chain rule differentiation calculator. Get instant step-by-step solutions for any nested function derivative (2025)

✅ 100% Free ⚡ Instant Results 📚 Step-by-Step 📱 Mobile Friendly

🎯 What is the Chain Rule?

The chain rule is one of the most powerful and essential differentiation techniques in calculus. It allows you to find the derivative of composite functions — functions that are "nested" inside other functions. Whether you're working with trigonometric, exponential, logarithmic, or polynomial compositions, this chain rule differentiation calculator is your go-to tool for finding nested function derivatives instantly.

Chain Rule Formula:

d/dx[f(g(x))] = f'(g(x)) · g'(x)

In simple terms: "Derivative of the outer function times the derivative of the inner function." New to derivatives? Start with our basic derivative calculator to build foundational skills.

When to use this calculator: Use our chain rule calculator whenever you encounter composite functions like sin(x²), e^(3x+1), (x²+1)⁵, ln(x³), or any function where one operation is nested inside another. This composite function calculator online provides instant step-by-step solutions for all your nested function derivative calculations. Simply enter your function, select your variable, and get instant step-by-step solutions!

✅ Mathematically Verified 🔒 Privacy Friendly 📊 Used by 50,000+ Students

🧮 Calculate Chain Rule Derivative with Our Composite Function Calculator

Differentiate with respect to:

📌 Try These Chain Rule Examples:

Calculating derivative...

📊 Your Results

Composite Function
Derivative (using Chain Rule)

📝 Step-by-Step Solution

What is the Chain Rule?

The chain rule is one of the most important differentiation rules in calculus. It's used to find the derivative of composite functions—functions that are "nested" inside other functions. The chain rule is often used together with the product rule and quotient rule to solve complex derivatives.

Chain Rule Formula:

d/dx[f(g(x))] = f'(g(x)) · g'(x)

In simple terms: "Derivative of the outer function times the derivative of the inner function."

When to Use the Chain Rule

Use the chain rule whenever you have a composite function, which means one function is inside another. Common examples include:

How the Chain Rule Works

The chain rule works by breaking down the composite function into two parts:

  1. Outer function (f): The outside operation
  2. Inner function (g): The inside operation
Example 1: Find d/dx[sin(x²)]

Step 1: Identify outer and inner functions

  • Outer: f(u) = sin(u)
  • Inner: g(x) = x²

Step 2: Find derivatives

  • f'(u) = cos(u)
  • g'(x) = 2x

Step 3: Apply chain rule

d/dx[sin(x²)] = cos(x²) · 2x = 2x·cos(x²)

Example 2: Find d/dx[e^(3x+1)]

Step 1: Identify functions

  • Outer: f(u) = e^u
  • Inner: g(x) = 3x+1

Step 2: Find derivatives

  • f'(u) = e^u
  • g'(x) = 3

Step 3: Apply chain rule

d/dx[e^(3x+1)] = e^(3x+1) · 3 = 3e^(3x+1)

Common Chain Rule Patterns

Tips for Mastering the Chain Rule

  1. Always identify the outer and inner functions first
  2. Remember: "Outside times inside" - differentiate the outside, then multiply by the derivative of the inside
  3. Practice with simple examples before moving to complex ones
  4. Check your work by expanding if possible
  5. Use parentheses to keep track of what you're differentiating

After mastering the chain rule, explore our implicit differentiation calculator for more advanced calculus problems.

❓ Frequently Asked Questions About Chain Rule

What is the chain rule in calculus?

The chain rule is a fundamental differentiation technique used to find derivatives of composite functions - functions that contain other functions inside them. In simple terms, if you have a function f(g(x)), the chain rule states that its derivative is f'(g(x)) multiplied by g'(x). Think of it as a way to "peel the layers" of a mathematical onion. For example, to differentiate sin(x²), you first differentiate the outer sine function (getting cos(x²)) and multiply by the derivative of the inner function x² (which is 2x). So d/dx[sin(x²)] = cos(x²) · 2x = 2x·cos(x²). This rule is essential for calculus students as it appears in nearly every advanced differentiation problem and forms the foundation for more complex mathematical concepts in physics, engineering, and economics.

When do you use the chain rule?

You use the chain rule whenever you encounter composite functions - one function nested inside another. Look for these visual cues: functions inside parentheses like sin(x²), exponential functions with expressions in the exponent like e^(3x+1), or functions raised to powers like (x²+5)³. The key identifier is having an "outer" function and an "inner" function. For example, in ln(cos(x)), the outer function is ln(u) and the inner function is cos(x). You would apply the chain rule as follows: d/dx[ln(cos(x))] = (1/cos(x)) · (-sin(x)) = -sin(x)/cos(x) = -tan(x). Don't use the chain rule for simple polynomials like x³ (use power rule) or products of functions like x·sin(x) (use product rule). Always identify the structure first - composition means chain rule, multiplication means product rule, and division means quotient rule.

What is the chain rule formula?

The chain rule formula is: d/dx[f(g(x))] = f'(g(x)) · g'(x). This elegant mathematical expression captures the essence of differentiating composite functions. In Leibniz notation, it's written as dy/dx = (dy/du) · (du/dx) where u = g(x). Let's apply this to a practical example: finding the derivative of e^(x³). Here, the outer function is e^u (whose derivative is e^u) and the inner function is x³ (whose derivative is 3x²). Applying the formula: d/dx[e^(x³)] = e^(x³) · 3x² = 3x²·e^(x³). For more complex cases like triple compositions such as sin(e^(x²)), you apply the chain rule multiple times: d/dx[sin(e^(x²))] = cos(e^(x²)) · e^(x²) · 2x. Understanding this formula unlocks the ability to differentiate virtually any composite function you'll encounter in calculus courses.

Chain rule vs product rule: What's the difference?

The chain rule and product rule serve completely different purposes in calculus. The chain rule handles composite functions (one function inside another) like sin(x²), while the product rule handles multiplication of functions like x·sin(x). Visual identification is key: chain rule problems show nested parentheses or functions inside other functions, whereas product rule problems show multiplication symbols or functions written side-by-side. For example, to differentiate x²·sin(x), use the product rule: (2x)·sin(x) + x²·cos(x). But to differentiate sin(x²), use the chain rule: cos(x²)·2x. Sometimes you need both rules in the same problem! For x²·sin(x³), first apply the product rule: 2x·sin(x³) + x²·d/dx[sin(x³)], then apply the chain rule to the second term: 2x·sin(x³) + x²·cos(x³)·3x² = 2x·sin(x³) + 3x⁴·cos(x³).

How do you remember the chain rule?

Remember the chain rule with this simple mantra: "Derivative of the outside, times derivative of the inside." Think of peeling an onion from the outside in. A helpful analogy is a Russian nesting doll - to get to the innermost doll, you must open each outer shell sequentially. For the mathematical process, always work from outside to inside. Take e^(sin(x²)) as an example: the outermost function is e^u (derivative: e^u), the middle is sin(v) (derivative: cos(v)), and the innermost is x² (derivative: 2x). Chain them together: e^(sin(x²)) · cos(x²) · 2x. Another memory trick is the phrase "outside times inside" - differentiate the outer function keeping the inner unchanged, then multiply by the derivative of what's inside. Practice with simple examples like sin(2x) first, where you get cos(2x)·2, before tackling complex nested functions.

What are some chain rule examples?

Here are several illustrative chain rule examples covering different difficulty levels. Easy example: d/dx[(x+3)⁵]. Outer function is u⁵ (derivative: 5u⁴), inner is (x+3) (derivative: 1). Result: 5(x+3)⁴·1 = 5(x+3)⁴. Medium example: d/dx[ln(x²+1)]. Outer function is ln(u) (derivative: 1/u), inner is (x²+1) (derivative: 2x). Result: 1/(x²+1) · 2x = 2x/(x²+1). Hard example: d/dx[cos(e^(sin(x)))]. Work from outside in: -sin(e^(sin(x))) · e^(sin(x)) · cos(x). Notice how each layer contributes one factor to the final product. Advanced example: d/dx[(sin(x²))³] requires both chain rule twice and power rule: 3(sin(x²))² · cos(x²) · 2x = 6x·(sin(x²))²·cos(x²). These examples demonstrate the versatility and power of the chain rule in handling increasingly complex composite functions.

Is the chain rule hard to learn?

The chain rule has a reputation for being challenging, but it's actually quite manageable with proper understanding and practice. The initial difficulty often stems from recognizing when to apply it and correctly identifying the outer and inner functions. Most students struggle initially with complex nested functions, but this improves dramatically with practice. Start with simple examples like sin(2x) or (x+1)³, then gradually progress to more complex compositions. The key insight is that the chain rule is just a systematic way of accounting for how changes propagate through nested relationships - a concept that mirrors many real-world phenomena. With our step-by-step calculator, you can see exactly how each component contributes to the final derivative. Many successful calculus students report that after working through 10-15 practice problems, the chain rule becomes second nature. The mathematical community considers it one of the most beautiful and useful formulas in differential calculus.

How is the chain rule used in calculus?

The chain rule is foundational in calculus with applications spanning pure mathematics and practical fields. In differential calculus, it's essential for implicit differentiation, related rates problems, and optimization. For example, in related rates, if a balloon's radius r changes with time t, and volume V = (4/3)πr³, then dV/dt = dV/dr · dr/dt = 4πr² · dr/dt. In integral calculus, the chain rule manifests as substitution in integration (u-substitution), making it equally important for antiderivatives. Beyond academics, engineers use it for control systems, economists for marginal analysis, physicists for motion equations, and data scientists for machine learning algorithms. In multivariable calculus, it extends to partial derivatives and vector calculus. The chain rule essentially describes how changes in interconnected variables propagate through systems, making it indispensable for modeling real-world phenomena mathematically.

🛑 When NOT to Use the Chain Rule

Understanding when not to use the chain rule is just as important as knowing when to use it. Here are common scenarios where students mistakenly apply the chain rule:

💡 Pro Tip #1: Before applying any differentiation rule, always identify the structure of your function. Ask: "Is this a composition, product, or quotient?" This simple step prevents most rule-application errors.

❌ Mistake #1: Simple Polynomials

Incorrect: Using chain rule for d/dx[x³] = 3x² · 1

Correct: d/dx[x³] = 3x² (simple power rule)

💡 Remember: The chain rule is only needed for composite functions - when one function is nested inside another.

❌ Mistake #2: Products of Functions

Incorrect: Using chain rule for d/dx[x · sin(x)]

Correct: Use the product rule: d/dx[x · sin(x)] = 1 · sin(x) + x · cos(x)

💡 Tip: If you see multiplication between functions, think product rule, not chain rule.

❌ Mistake #3: Quotients of Functions

Incorrect: Using chain rule for d/dx[sin(x)/x]

Correct: Use the quotient rule: d/dx[sin(x)/x] = [x · cos(x) - sin(x) · 1]/x²

💡 Tip: Division of functions requires the quotient rule, not the chain rule.

✅ When to Use Chain Rule Correctly

Look for these indicators:

  • Functions inside parentheses: sin(), e^(3x+1)
  • Functions raised to powers: (x²+1)⁵, [sin(x)]³
  • Trigonometric functions with expressions: cos(e^x), tan(ln(x))
  • Nested functions: e^(sin()) (requires multiple applications)

⚖️ Chain Rule vs Product Rule: Key Differences

Students often confuse when to use the chain rule versus the product rule. While both are essential differentiation techniques, they apply to completely different mathematical situations. Let's break down the key differences:

💡 Pro Tip #2: Create a mental checklist: 1) Are functions composed (one inside another)? Use chain rule. 2) Are functions multiplied? Use product rule. 3) Are functions divided? Use quotient rule. This systematic approach eliminates confusion.

Aspect Chain Rule Product Rule
Mathematical Operation Function Composition: f(g(x)) Function Multiplication: f(x)·g(x)
Visual Indicator Parentheses, nested functions Multiplication sign or juxtaposition
Formula d/dx[f(g(x))] = f'(g(x)) · g'(x) d/dx[f(x)·g(x)] = f'(x)·g(x) + f(x)·g'(x)
Number of Functions One function inside another Two separate functions multiplied
Example sin(x²) or e^(3x+1) x · sin(x) or (x²+1) · e^x
🔍 How to Identify Which Rule to Use

Ask yourself these questions:

  • Are the functions composed? (One inside another?) → Chain Rule
  • Are the functions multiplied? (Side by side with × or ·?) → Product Rule
  • Do I see nested parentheses? → Chain Rule
  • Do I see two functions being multiplied? → Product Rule
⚡ Combined Example

Sometimes you need both rules in the same problem!

Problem: Find d/dx[x² · sin(x³)]

Solution: This requires the product rule first (multiplication of x² and sin(x³)), then the chain rule for differentiating sin(x³).

d/dx[x² · sin(x³)] = 2x · sin(x³) + x² · cos(x³) · 3x²

= 2x·sin(x³) + 3x⁴·cos(x³)

📊 Chain Rule Comparison Tables

Chain Rule vs Quotient Rule

Feature Chain Rule Quotient Rule
Function Type Composition: f(g(x)) Division: f(x)/g(x)
Visual Cue Nested parentheses Fraction bar or division sign
Formula f'(g(x)) · g'(x) [f'(x)g(x) - f(x)g'(x)]/[g(x)]²
Example sin(x²), e^(3x) sin(x)/x, (x²+1)/(x-1)
When to Use One function inside another Functions divided by each other

Single Rule vs Combined Rules

Problem Type Rule(s) Needed Example
Simple Composition Chain Rule Only d/dx[sin(2x)] = 2cos(2x)
Product of Functions Product Rule Only d/dx[x·sin(x)] = sin(x) + x·cos(x)
Quotient of Functions Quotient Rule Only d/dx[sin(x)/x] = [x·cos(x) - sin(x)]/x²
Product with Composition Product + Chain Rules d/dx[x·sin(x²)] = sin(x²) + x·2x·cos(x²)
Quotient with Composition Quotient + Chain Rules d/dx[sin(x²)/x] = [x·2x·cos(x²) - sin(x²)]/x²
Complex Compositions Multiple Chain Rules d/dx[e^(sin(x²))] = e^(sin(x²))·cos(x²)·2x

🚀 Advanced Chain Rule Examples

Once you've mastered basic chain rule applications, you'll encounter more complex scenarios involving multiple nested functions. These "triple composition" problems require applying the chain rule multiple times. Let's explore several advanced examples with detailed step-by-step solutions:

💡 Pro Tip #3: For complex nested functions, work from the outside in. Label each layer clearly (outer, middle, inner) and differentiate one layer at a time. This methodical approach prevents missing terms in your solution.

Example 1: Triple Composition - Exponential of Trigonometric of Polynomial

Problem: Find d/dx[e^(sin(x²))]

1
Identify the Nested Structure

We have three nested functions:

  • Outer: e^u where u = sin(x²)
  • Middle: sin(v) where v = x²
  • Inner:
2
Apply Chain Rule Three Times

d/dx[e^(sin(x²))] = d/du[e^u] · d/dv[sin(v)] · d/dx[x²]

= e^(sin(x²)) · cos(x²) · 2x

3
Final Answer

d/dx[e^(sin(x²))] = 2x·e^(sin(x²))·cos(x²)

Example 2: Logarithmic of Trigonometric of Exponential

Problem: Find d/dx[ln(cos(e^x))]

1
Identify the Nested Structure

We have three nested functions:

  • Outer: ln(u) where u = cos(e^x)
  • Middle: cos(v) where v = e^x
  • Inner: e^x
2
Apply Chain Rule Three Times

d/dx[ln(cos(e^x))] = (1/cos(e^x)) · (-sin(e^x)) · e^x

3
Simplify the Expression

= -e^x · sin(e^x) / cos(e^x)

= -e^x · tan(e^x)

4
Final Answer

d/dx[ln(cos(e^x))] = -e^x·tan(e^x)

Example 3: Power of Trigonometric of Logarithmic

Problem: Find d/dx[(sin(ln(x)))³]

1
Identify the Nested Structure

We have three nested functions:

  • Outer: u³ where u = sin(ln(x))
  • Middle: sin(v) where v = ln(x)
  • Inner: ln(x)
2
Apply Chain Rule Three Times

d/dx[(sin(ln(x)))³] = 3(sin(ln(x)))² · cos(ln(x)) · (1/x)

3
Final Answer

d/dx[(sin(ln(x)))³] = (3/x)(sin(ln(x)))²·cos(ln(x))

💡 Pro Tip for Advanced Chain Rule: When dealing with triple compositions, work from the outside in. Differentiate the outermost function first, keeping everything inside unchanged, then multiply by the derivative of what's inside. Repeat this process for each nested layer.

🔬 Chain Rule in Physics and Engineering

The chain rule isn't just an abstract mathematical concept—it's a powerful tool used extensively in physics, engineering, and applied sciences. Whenever quantities depend on other changing quantities, the chain rule helps us understand how these changes propagate through systems.

💡 Pro Tip #4: When solving real-world problems, identify the dependent variables first. If variable A depends on B, and B depends on time t, then dA/dt = (dA/dB)(dB/dt). This pattern appears in almost every application of the chain rule.

.Physics Application: Velocity and Acceleration

In kinematics, position is often expressed as a function of time, but sometimes it's more convenient to express it as a function of another variable. For example, if position x depends on angle θ, which in turn depends on time t:

Position: x = f(θ), where θ = g(t)

To find velocity (dx/dt), we use the chain rule:

Velocity = dx/dt = (dx/dθ) · (dθ/dt)

This shows how angular velocity (dθ/dt) affects linear velocity through the geometric relationship (dx/dθ).

Engineering Application: Rate of Change in Circuits

In electrical engineering, the voltage across a capacitor is related to the charge by V = Q/C. If the charge changes with time according to Q = Q₀e^(-t/RC), we can find how voltage changes over time:

V(t) = Q(t)/C = (Q₀/C)e^(-t/RC)

Using the chain rule to find dV/dt:

dV/dt = (Q₀/C) · e^(-t/RC) · (-1/RC) = -(Q₀/RC²)e^(-t/RC)

This tells us how quickly the voltage decreases during capacitor discharge.

Thermodynamics Application: Heat Transfer

In thermodynamics, temperature T might depend on position x, which changes with time t. The rate of temperature change experienced by a moving particle is:

dT/dt = (∂T/∂x) · (dx/dt) + (∂T/∂t)

This is a form of the chain rule that accounts for both convection (movement through space) and conduction (local temperature changes).

Economics Application: Marginal Analysis

In economics, production costs might depend on the quantity produced, which itself depends on time or other factors. If Cost = C(Q) and Quantity = Q(t), then:

dC/dt = (dC/dQ) · (dQ/dt)

This shows how changes in production rate affect cost changes over time.

💡 Real-World Insight: The chain rule is fundamental to understanding how changes in one variable cascade through interconnected systems. Engineers use it to predict system behaviors, physicists use it to model motion and energy transfer, and economists use it to analyze market dynamics. Mastering the chain rule gives you the mathematical foundation to tackle complex real-world problems!

⚠️ Common Chain Rule Mistakes to Avoid

❌ Mistake #1: Forgetting the Inner Derivative

Incorrect: d/dx[sin(x²)] = cos(x²)

Correct: d/dx[sin(x²)] = cos(x²) · 2x

💡 Remember: You must multiply by the derivative of the inner function (2x)!

❌ Mistake #2: Misidentifying the Inner Function

Incorrect approach: Treating (x²+1)⁵ as just a power rule problem

Correct approach: Recognize (x²+1)⁵ = [u]⁵ where u = x²+1, then apply chain rule

💡 Tip: Always identify what's "inside" the main function before differentiating.

❌ Mistake #3: Wrong Order of Operations

Incorrect: Differentiating the inner function first

Correct: Differentiate outer function first (with inner unchanged), then multiply by inner's derivative

💡 Order matters: Outside → Inside, not the other way around!

🎯 Practice Problems

Test your chain rule skills with these practice problems. Try solving them yourself first, then use our calculator to check your work!

🔹 Easy Level
  1. d/dx[sin(3x)] = ? (Hint: outer = sin, inner = 3x)
  2. d/dx[(x+5)³] = ? (Hint: outer = u³, inner = x+5)
  3. d/dx[e^(2x)] = ? (Hint: outer = e^u, inner = 2x)
🟡 Medium Level
  1. d/dx[cos(x²+1)] = ? (Hint: don't forget to differentiate x²+1)
  2. d/dx[√(4x²+9)] = ? (Hint: rewrite as (4x²+9)^(1/2))
  3. d/dx[ln(x³-2x)] = ? (Hint: ln derivative is 1/u times u')
🔴 Advanced Level
  1. d/dx[sin²(x³)] = ? (Hint: this is [sin(x³)]², needs chain rule twice!)
  2. d/dx[e^(sin(x))] = ? (Hint: triple composition!)
  3. d/dx[tan(e^(2x))] = ? (Hint: outer = tan, middle = e^u, inner = 2x)
  4. d/dx[(cos(x)+1)^(x²)] = ? (Hint: very advanced, needs chain rule + logarithmic differentiation)
Detailed Solutions
1
d/dx[sin(3x)]

Outer function: sin(u), Inner function: u = 3x

d/dx[sin(3x)] = cos(3x) · d/dx[3x] = cos(3x) · 3 = 3cos(3x)

2
d/dx[(x+5)³]

Outer function: u³, Inner function: u = x+5

d/dx[(x+5)³] = 3(x+5)² · d/dx[x+5] = 3(x+5)² · 1 = 3(x+5)²

3
d/dx[e^(2x)]

Outer function: e^u, Inner function: u = 2x

d/dx[e^(2x)] = e^(2x) · d/dx[2x] = e^(2x) · 2 = 2e^(2x)

4
d/dx[cos(x²+1)]

Outer function: cos(u), Inner function: u = x²+1

d/dx[cos(x²+1)] = -sin(x²+1) · d/dx[x²+1] = -sin(x²+1) · 2x = -2x·sin(x²+1)

5
d/dx[√(4x²+9)]

Rewrite as (4x²+9)^(1/2)

Outer function: u^(1/2), Inner function: u = 4x²+9

d/dx[(4x²+9)^(1/2)] = (1/2)(4x²+9)^(-1/2) · d/dx[4x²+9] = (1/2)(4x²+9)^(-1/2) · 8x

= 4x(4x²+9)^(-1/2) = 4x/√(4x²+9)

6
d/dx[ln(x³-2x)]

Outer function: ln(u), Inner function: u = x³-2x

d/dx[ln(x³-2x)] = (1/(x³-2x)) · d/dx[x³-2x] = (1/(x³-2x)) · (3x²-2) = (3x²-2)/(x³-2x)

7
d/dx[sin²(x³)]

Rewrite as [sin(x³)]². This requires the chain rule twice!

Outer function: u², Middle function: sin(v), Inner function: v = x³

d/dx[sin²(x³)] = 2sin(x³) · d/dx[sin(x³)] = 2sin(x³) · cos(x³) · d/dx[x³]

= 2sin(x³) · cos(x³) · 3x² = 6x²·sin(x³)·cos(x³)

8
d/dx[e^(sin(x))]

This is a triple composition!

Outer function: e^u, Middle function: sin(v), Inner function: v = x

d/dx[e^(sin(x))] = e^(sin(x)) · d/dx[sin(x)] = e^(sin(x)) · cos(x) = e^(sin(x))·cos(x)

9
d/dx[tan(e^(2x))]

Outer function: tan(u), Middle function: e^v, Inner function: v = 2x

d/dx[tan(e^(2x))] = sec²(e^(2x)) · d/dx[e^(2x)] = sec²(e^(2x)) · e^(2x) · d/dx[2x]

= sec²(e^(2x)) · e^(2x) · 2 = 2e^(2x)·sec²(e^(2x))

10
d/dx[(cos(x)+1)^(x²)]

This very advanced problem requires both chain rule and logarithmic differentiation.

Let y = (cos(x)+1)^(x²). Taking natural logarithm of both sides:

ln(y) = x² · ln(cos(x)+1)

Differentiating both sides with respect to x:

(1/y) · dy/dx = 2x · ln(cos(x)+1) + x² · [1/(cos(x)+1)] · (-sin(x))

dy/dx = y · [2x·ln(cos(x)+1) - x²·sin(x)/(cos(x)+1)]

= (cos(x)+1)^(x²) · [2x·ln(cos(x)+1) - x²·sin(x)/(cos(x)+1)]

💡 Pro Tip: Practice these problems without looking at the solutions first. Then check your work with our detailed solutions above. This active learning approach will help you master the chain rule!

🔗 Related Derivative Calculators

Expand your calculus toolkit with these related calculators: