Tutorials › AP Calculus › The Chain Rule in Multi-Step Compositions
← All AP Calculus Tutorials
AP Calculus AB & BC Intermediate

The Chain Rule in Multi-Step Compositions

How to differentiate functions nested several layers deep. The key is to work from the outside in, keeping every intermediate function intact until its derivative has been accounted for.

What Makes a Composition "Multi-Step"?

The basic chain rule handles a function such as : one function is applied to another. But AP Calculus problems often go several layers deeper. You might see a power applied to a trigonometric function applied to a polynomial, or an exponential function applied to a quadratic expression that is itself inside a square root.

For example, consider . There isn't just one inside function. There are three layers:

The three layers
Outer:
Middle:
Inner:

The chain rule still works exactly the same way. You simply apply it repeatedly. Each layer contributes one derivative factor.

The big idea
Differentiate the outer layer  ×  differentiate the middle layer  ×  differentiate the inner layer

The Formula for Multiple Layers

Suppose a function is built as , where , , and . Then the chain rule can be applied one layer at a time:

Notice what happens: every layer contributes a derivative. The original function structure remains visible in the intermediate factors, and the final factor comes from differentiating all the way down to .

A Reliable Layer-by-Layer Method

  1. Start at the outside. Identify the final operation performed on the expression.
  2. Differentiate that outside layer while leaving everything inside it unchanged.
  3. Move one layer inward. Differentiate the next function and multiply by its derivative.
  4. Continue until you reach .
  5. Multiply all the derivative factors together. Simplify only after every layer has been differentiated.

A useful mental model is to think of the function as a series of nested boxes. You open the outermost box first, differentiate what you find, then move to the next box.

Worked Examples

Example 1: Three Nested Layers

Differentiate .

Layer 1: The outside function is . Its derivative is , leaving the entire inside expression unchanged.
Layer 2: The next function is . Its derivative is .
Layer 3: The innermost function is , whose derivative is .
Multiply:
Result:
Example 2: Exponential Outside a Trigonometric Function

Differentiate .

Layer 1: Outside function: . Its derivative is .
Layer 2: The exponent contains . The derivative of is .
Layer 3: The innermost function is , whose derivative is .
Multiply all three factors:
Result:
Example 3: A Fractional Power with Multiple Layers

Differentiate .

Layer 1: Rewrite the square root as a power: .
Layer 2: The outside power contributes .
Layer 3: Differentiate the sine layer: .
Layer 4: Differentiate the innermost polynomial: .
Multiply:
Result:
Example 4: Four Layers Deep

Differentiate .

Layer 1: Outside function: . Its derivative contributes .
Layer 2: Differentiate the logarithm: .
Layer 3: Differentiate the cosine layer: .
Layer 4: Differentiate the polynomial inside: .
Result before simplifying:
Result:

How to Keep Track of the Layers

When a problem gets complicated, don't try to mentally differentiate the entire expression in one step. Instead, label the layers.

Example structure
Outer:
Middle:
Inner:

Then differentiate one layer at a time. The answer should contain one derivative factor for every genuine layer of composition.

Chain Rule + Other Rules

Multi-step compositions frequently appear inside products, quotients, or other structures. The chain rule does not replace those rules. Instead, you use the appropriate rule at the outermost level and then use the chain rule wherever a nested function appears.

Example 5: Product Rule Outside, Chain Rule Inside

Differentiate .

Step 1: The expression is a product, so begin with the product rule.
Step 2: The derivative of is .
Step 3: For , use the chain rule repeatedly: the outside sine contributes , the cosine layer contributes , and the polynomial contributes .
Result:

A Fast AP Calculus Strategy

On an AP Calculus free-response question, you usually don't need to invent a new technique for a complicated composition. You need to recognize its structure.

  1. Find the outermost operation. Is it a product? A quotient? A power? A trigonometric function? An exponential?
  2. Apply that rule first.
  3. Look inside each resulting derivative. If there is another function inside, use the chain rule.
  4. Repeat. Every time you encounter a nested function, keep differentiating inward.
  5. Stop when the innermost expression is reached.

The most important habit is this: do not stop after differentiating the outer layer. A multi-step composition requires you to keep moving inward until every layer has contributed its derivative.

Common Mistakes

Stopping after the first chain-rule step

For a multi-step composition, one chain-rule factor is not enough. If there are three nested layers, you should normally see three derivative contributions. Keep working inward until you reach the original variable.

Losing an intermediate function

Write the intermediate expression explicitly if necessary. For , don't jump directly from the original function to the final answer. The middle layer has its own derivative that must be included.

Expanding too early

Expanding a complicated nested expression can destroy the structure that makes the chain rule easy to see. Keep each layer intact, differentiate it, and simplify at the end.

Missing a negative sign

Functions such as cosine and certain inner expressions introduce negative signs. In a long chain, one missed sign can change the entire answer. Write each derivative factor separately before multiplying them together.

The Chain Rule as a Derivative "Pipeline"

There is a useful way to understand why the rule works. Suppose a quantity passes through several functions:

Nested-function pipeline
 →   →   → 

Each function changes the rate at which the quantity is changing. The chain rule multiplies those local rates together. That's why a deep composition produces a product of derivative factors.

Practice Problems

Question 1

Differentiate .

Show answer
Question 2

Differentiate .

Show answer
Question 3

Differentiate .

Show answer
Question 4

Differentiate .

Show answer
Question 5 (Combined Rules)

Differentiate .

Show answer

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon