7

Day 7

Chain Rule And Trig Derivatives


The Chain Rule

Whenever you differentiate a composite function — a function stuffed inside another function — you need the chain rule. It's arguably the single most-used rule on the entire AP exam, since almost every 'real' problem involves some kind of composition.

Core Theorem
If f(u)f(u) is differentiable at u=g(x)u=g(x) and g(x)g(x) is differentiable at xx, then the composite fgf \circ g is differentiable at xx, and (fg)(x)=f(g(x))g(x)(f \circ g)'(x) = f'(g(x)) \cdot g'(x), or equivalently dydx=dydududx\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}.
Watch the TikTok ExplanationChain Rule Made Simple
Step-by-Step SOP
  1. 1

    Identify Outside and Inside

    Decide which operation is applied last (the outside) and what it's being applied to (the inside).
  2. 2

    Differentiate the Outside, Keep the Inside Unchanged

    Apply the appropriate rule to the outside function, substituting the inside expression back in without simplifying it yet.
  3. 3

    Multiply by the Inner Derivative

    Multiply your result by the derivative of the inside function. If the inside itself is a composition, repeat the whole process on it.

Practice Exercises


Example 01Easy
Differentiate y=(x31)100y = (x^3 - 1)^{100}.
NEED A HINT?
The 'outside' function is (something)100^{100} and the 'inside' function is x31x^3-1.
SHOW DETAILED EXPLANATION

Step 1: Identify Outside and Inside

Outside: u100u^{100}. Inside: u=x31u = x^3-1.

Step 2: Differentiate the Outside, Keep the Inside

100(x31)99100(x^3-1)^{99}.

Step 3: Multiply by the Derivative of the Inside

y=100(x31)993x2=300x2(x31)99y' = 100(x^3-1)^{99} \cdot 3x^2 = 300x^2(x^3-1)^{99}.
Example 02Medium
Differentiate y=(2x+1)5(x32x+1)4y = (2x+1)^5(x^3-2x+1)^4.
NEED A HINT?
This needs BOTH the product rule and the chain rule — differentiate each factor with the chain rule, then combine with the product rule.
SHOW DETAILED EXPLANATION

Step 1: Differentiate Each Factor with the Chain Rule

ddx(2x+1)5=5(2x+1)42=10(2x+1)4\frac{d}{dx}(2x+1)^5 = 5(2x+1)^4 \cdot 2 = 10(2x+1)^4. ddx(x32x+1)4=4(x32x+1)3(3x22)\frac{d}{dx}(x^3-2x+1)^4 = 4(x^3-2x+1)^3(3x^2-2).

Step 2: Apply the Product Rule

y=10(2x+1)4(x32x+1)4+(2x+1)54(x32x+1)3(3x22)y' = 10(2x+1)^4(x^3-2x+1)^4 + (2x+1)^5 \cdot 4(x^3-2x+1)^3(3x^2-2).

Step 3: Factor (Optional)

Both terms share (2x+1)4(x32x+1)3(2x+1)^4(x^3-2x+1)^3, so this could be factored out — but on the AP exam, leaving it unsimplified like above still earns full credit.
Example 03Hard
Differentiate h(x)=x2+x3+13h(x) = \sqrt[3]{x^2 + \sqrt{x^3+1}}.
NEED A HINT?
This is a chain rule inside a chain rule — peel one layer at a time, from the cube root inward to the square root.
SHOW DETAILED EXPLANATION

Step 1: Rewrite as a Power

h(x)=(x2+(x3+1)1/2)1/3h(x) = \left(x^2 + (x^3+1)^{1/2}\right)^{1/3}.

Step 2: Differentiate the Outermost Layer

h(x)=13(x2+(x3+1)1/2)2/3ddx[x2+(x3+1)1/2]h'(x) = \frac{1}{3}\left(x^2+(x^3+1)^{1/2}\right)^{-2/3} \cdot \frac{d}{dx}\left[x^2+(x^3+1)^{1/2}\right].

Step 3: Differentiate the Inner Expression (Another Chain Rule)

ddx[x2+(x3+1)1/2]=2x+12(x3+1)1/2(3x2)\frac{d}{dx}\left[x^2+(x^3+1)^{1/2}\right] = 2x + \frac{1}{2}(x^3+1)^{-1/2}(3x^2).

Step 4: Combine

h(x)=13(x2+x3+1)2/3(2x+3x22x3+1)h'(x) = \frac{1}{3}\left(x^2+\sqrt{x^3+1}\right)^{-2/3}\left(2x + \frac{3x^2}{2\sqrt{x^3+1}}\right).
Example 04AB/BC Standard
Let F(x)=f(xf(f(x)))F(x) = f(xf(f(x))). Given f(1)=2,f(2)=3,f(3)=6,f(1)=4,f(2)=5,f(3)=6f(1)=2, f(2)=3, f(3)=6, f'(1)=4, f'(2)=5, f'(3)=6, find F(1)F'(1).
NEED A HINT?
Work from the outside in, and at every step, evaluate the 'inside' expressions first so you know exactly which f-values and f'-values to use.
SHOW DETAILED EXPLANATION

Step 1: Differentiate the Outer Layer

Let u(x)=xf(f(x))u(x) = xf(f(x)), so F(x)=f(u(x))F(x) = f(u(x)) and F(x)=f(u(x))u(x)F'(x) = f'(u(x)) \cdot u'(x).

Step 2: Differentiate u(x) with the Product Rule

u(x)=xf(f(x))    u(x)=f(f(x))+xf(f(x))f(x)u(x) = x \cdot f(f(x)) \implies u'(x) = f(f(x)) + x \cdot f'(f(x))f'(x).

Step 3: Evaluate All Pieces at x = 1

f(1)=2f(1)=2, so f(f(1))=f(2)=3f(f(1)) = f(2) = 3. Then u(1)=1f(f(1))=13=3u(1) = 1 \cdot f(f(1)) = 1 \cdot 3 = 3. Also f(f(1))=f(2)=5f'(f(1)) = f'(2) = 5 and f(1)=4f'(1)=4.

Step 4: Compute u'(1)

u(1)=f(f(1))+1f(f(1))f(1)=3+(5)(4)=23u'(1) = f(f(1)) + 1 \cdot f'(f(1))f'(1) = 3 + (5)(4) = 23.

Step 5: Compute F'(1)

F(1)=f(u(1))u(1)=f(3)23=623=138F'(1) = f'(u(1)) \cdot u'(1) = f'(3) \cdot 23 = 6 \cdot 23 = 138.
Common Pitfalls
  • Forgetting the Inner DerivativeThe most common chain rule mistake is stopping after differentiating the outside function and forgetting to multiply by the derivative of the inside — e.g. writing ddx(x31)100=100(x31)99\frac{d}{dx}(x^3-1)^{100} = 100(x^3-1)^{99} without the trailing 3x2\cdot 3x^2.
  • Nested Compositions Need Multiple PassesWhen a function is nested three or four layers deep, you must apply the chain rule once per layer — peel one layer, multiply by its inner derivative, then repeat on what's left inside.

Derivatives of the Six Trigonometric Functions

The six trig derivatives should be memorized cold — once you have them down, differentiating any trig expression is just a matter of combining them with the chain, product, and quotient rules you already know.

Core Theorem
ddxsinx=cosx\frac{d}{dx}\sin x = \cos x
ddxcosx=sinx\frac{d}{dx}\cos x = -\sin x
ddxtanx=sec2x\frac{d}{dx}\tan x = \sec^2 x
ddxcotx=csc2x\frac{d}{dx}\cot x = -\csc^2 x
ddxsecx=secxtanx\frac{d}{dx}\sec x = \sec x \tan x
ddxcscx=cscxcotx\frac{d}{dx}\csc x = -\csc x \cot x
Watch the TikTok ExplanationDerivative of Trigonometric Functions
Step-by-Step SOP
  1. 1

    Recall the Base Derivative

    Identify which of the six trig functions is on the outside and recall its exact derivative, including sign.
  2. 2

    Chain Rule for the Argument

    If the argument isn't simply xx, multiply by the derivative of that argument — repeating for each additional layer of nesting.
  3. 3

    Watch for Disguised Powers

    Notation like sin2x\sin^2 x or sec3x\sec^3 x means the trig function is raised to a power — treat it as an outer power function wrapped around the trig function.

Practice Exercises


Example 01Easy
Differentiate y=sin(x2)y = \sin(x^2).
NEED A HINT?
The outside function is sin()\sin(\cdot) and the inside is x2x^2 — apply the chain rule.
SHOW DETAILED EXPLANATION

Step 1: Differentiate sin(u), Keep u

cos(x2)\cos(x^2).

Step 2: Multiply by the Inner Derivative

y=cos(x2)2x=2xcos(x2)y' = \cos(x^2) \cdot 2x = 2x\cos(x^2).
Example 02Medium
Differentiate y=sin2xy = \sin^2 x.
NEED A HINT?
Read sin2x\sin^2 x as (sinx)2(\sin x)^2 — the outside function is (something)2^2, and the inside is sinx\sin x.
SHOW DETAILED EXPLANATION

Step 1: Rewrite Clearly

y=(sinx)2y = (\sin x)^2.

Step 2: Differentiate the Outside, Keep the Inside

2(sinx)12(\sin x)^1.

Step 3: Multiply by the Inner Derivative

y=2sinxcosxy' = 2\sin x \cdot \cos x (which can also be written as sin(2x)\sin(2x) using the double-angle identity).
Example 03Hard
Differentiate g(t)=tan(5sin2t)g(t) = \tan(5 - \sin 2t).
NEED A HINT?
Two layers of chain rule: first peel off tan()\tan(\cdot), then peel off sin()\sin(\cdot) inside it.
SHOW DETAILED EXPLANATION

Step 1: Differentiate the Outer tan Layer

sec2(5sin2t)ddt(5sin2t)\sec^2(5-\sin 2t) \cdot \frac{d}{dt}(5-\sin 2t).

Step 2: Differentiate the Inner Expression

ddt(5sin2t)=cos(2t)2=2cos2t\frac{d}{dt}(5-\sin 2t) = -\cos(2t) \cdot 2 = -2\cos 2t (chain rule again on sin2t\sin 2t).

Step 3: Combine

g(t)=2cos(2t)sec2(5sin2t)g'(t) = -2\cos(2t)\sec^2(5-\sin 2t).
Example 04AB/BC Standard
Differentiate f(x)=sin(cos(tanx))f(x) = \sin(\cos(\tan x)).
NEED A HINT?
Three layers deep — peel sin, then cos, then tan, multiplying by each inner derivative in turn.
SHOW DETAILED EXPLANATION

Step 1: Peel the Outermost sin Layer

cos(cos(tanx))ddx[cos(tanx)]\cos(\cos(\tan x)) \cdot \frac{d}{dx}[\cos(\tan x)].

Step 2: Peel the cos Layer

ddx[cos(tanx)]=sin(tanx)ddx[tanx]=sin(tanx)sec2x\frac{d}{dx}[\cos(\tan x)] = -\sin(\tan x) \cdot \frac{d}{dx}[\tan x] = -\sin(\tan x)\sec^2 x.

Step 3: Combine All Layers

f(x)=cos(cos(tanx))(sin(tanx)sec2x)=sec2xsin(tanx)cos(cos(tanx))f'(x) = \cos(\cos(\tan x)) \cdot \left(-\sin(\tan x)\sec^2 x\right) = -\sec^2 x \sin(\tan x)\cos(\cos(\tan x)).
Common Pitfalls
  • Cofunctions Carry a Negative Signcos\cos, cot\cot, and csc\csc (the 'co-' functions) all have negative derivatives, while sin\sin, tan\tan, and sec\sec do not. Mixing up which three get the minus sign is a very common slip.
  • sin²x Is Still a Composite FunctionStudents often forget the chain rule applies to sin2x\sin^2 x since it 'looks like' a basic trig function — remember it's really (sinx)2(\sin x)^2, requiring the extra factor of cosx\cos x.

Derivatives of Inverse Functions

Sometimes you need the derivative of an inverse function f1f^{-1} without ever solving for its formula explicitly — the inverse function theorem lets you get it directly from ff itself, just by finding one matching input/output pair.

Core Theorem
Inverse Function Theorem: if f(x)f'(x) exists on an interval II and is never 00, then f1f^{-1} is differentiable, and (f1)(b)=1f(f1(b))(f^{-1})'(b) = \frac{1}{f'(f^{-1}(b))}.
Watch the TikTok ExplanationDerivative of Inverse Functions
Step-by-Step SOP
  1. 1

    Find the Matching Input First

    Solve f(a)=bf(a) = b to identify a=f1(b)a = f^{-1}(b) before applying the inverse function theorem.
  2. 2

    Apply (f⁻¹)'(b) = 1/f'(a)

    Compute f(a)f'(a) using ordinary differentiation rules, then take its reciprocal.
  3. 3

    For Second Derivatives, Differentiate g'(x) Again

    Treat g(x)=[f(g(x))]1g'(x) = [f'(g(x))]^{-1} as its own function and apply the chain rule to get g(x)g''(x).

Practice Exercises


Example 01Medium
If f(x)=x32f(x) = x^3 - 2, find ddxf1(x)x=6\frac{d}{dx}f^{-1}(x)\Big|_{x=6}.
NEED A HINT?
First find the input aa such that f(a)=6f(a)=6 — that's f1(6)f^{-1}(6) — then apply the inverse function theorem.
SHOW DETAILED EXPLANATION

Step 1: Find f⁻¹(6) by Solving f(a) = 6

a32=6    a3=8    a=2a^3 - 2 = 6 \implies a^3 = 8 \implies a = 2, so f1(6)=2f^{-1}(6) = 2.

Step 2: Find f'(x) and Evaluate at a = 2

f(x)=3x2    f(2)=12f'(x) = 3x^2 \implies f'(2) = 12.

Step 3: Apply the Inverse Function Theorem

(f1)(6)=1f(f1(6))=1f(2)=112(f^{-1})'(6) = \frac{1}{f'(f^{-1}(6))} = \frac{1}{f'(2)} = \frac{1}{12}.
Example 02Hard
Let gg be the inverse of f(x)=x3+3x+1f(x) = x^3+3x+1. Find g(5)g'(5) and g(5)g''(5).
NEED A HINT?
First find g(5)g(5) by solving f(a)=5f(a)=5 (try small integers). Then find g(5)g'(5) from the inverse function theorem, and differentiate that formula again for g(5)g''(5).
SHOW DETAILED EXPLANATION

Step 1: Find g(5) by Solving f(a) = 5

a3+3a+1=5    a3+3a4=0a^3+3a+1=5 \implies a^3+3a-4=0. Testing a=1a=1: 1+34=01+3-4=0 ✓, so g(5)=1g(5)=1.

Step 2: Find f'(x) and f''(x)

f(x)=3x2+3f'(x) = 3x^2+3, so f(1)=6f'(1) = 6. f(x)=6xf''(x) = 6x, so f(1)=6f''(1) = 6.

Step 3: Find g'(5)

g(5)=1f(g(5))=1f(1)=16g'(5) = \frac{1}{f'(g(5))} = \frac{1}{f'(1)} = \frac{1}{6}.

Step 4: Differentiate g'(x) = [f'(g(x))]⁻¹ Again for g''(x)

g(x)=f(g(x))g(x)[f(g(x))]2g''(x) = -\frac{f''(g(x))\,g'(x)}{[f'(g(x))]^2}, so g(5)=f(1)g(5)[f(1)]2=61636=136g''(5) = -\frac{f''(1)\cdot g'(5)}{[f'(1)]^2} = -\frac{6\cdot\frac{1}{6}}{36} = -\frac{1}{36}.
Common Pitfalls
  • You Don't Need the Explicit Inverse FormulaThe whole point of the inverse function theorem is to avoid solving for f1(x)f^{-1}(x) symbolically — just find the specific input value a=f1(b)a=f^{-1}(b) numerically, then use f(a)f'(a).
  • The Second Derivative Isn't Just 1/f''(a)g(x)g''(x) requires differentiating g(x)=[f(g(x))]1g'(x) = [f'(g(x))]^{-1} with the chain and power rules — it is NOT simply 1f(a)\frac{1}{f''(a)}.

Derivatives of Inverse Trig Functions

The six inverse trig derivatives are a separate set of memorized formulas, built once from implicit differentiation and then reused forever — they show up constantly wrapped inside chain rule and product rule problems.

Core Theorem
ddxsin1x=11x2\frac{d}{dx}\sin^{-1}x = \frac{1}{\sqrt{1-x^2}}, ddxcos1x=11x2\frac{d}{dx}\cos^{-1}x = \frac{-1}{\sqrt{1-x^2}}
ddxtan1x=11+x2\frac{d}{dx}\tan^{-1}x = \frac{1}{1+x^2}, ddxcot1x=11+x2\frac{d}{dx}\cot^{-1}x = \frac{-1}{1+x^2}
ddxsec1x=1xx21\frac{d}{dx}\sec^{-1}x = \frac{1}{|x|\sqrt{x^2-1}}, ddxcsc1x=1xx21\frac{d}{dx}\csc^{-1}x = \frac{-1}{|x|\sqrt{x^2-1}}
Step-by-Step SOP
  1. 1

    Recall the Base Formula

    Identify which of the six inverse trig derivatives applies, including its sign.
  2. 2

    Chain Rule the Argument

    Multiply by the derivative of whatever is inside the inverse trig function.
  3. 3

    Combine with Product/Quotient Rules as Needed

    If the inverse trig function is multiplied, divided, or raised to a power alongside other terms, layer in the product, quotient, or power rule around it.

Practice Exercises


Example 01Medium
Differentiate f(x)=xarctan(x)f(x) = x\arctan(\sqrt{x}).
NEED A HINT?
This needs both the product rule (for xx times arctan()\arctan(\cdot)) and the chain rule (for x\sqrt{x} inside the arctan).
SHOW DETAILED EXPLANATION

Step 1: Apply the Product Rule

f(x)=arctan(x)+xddx[arctan(x)]f'(x) = \arctan(\sqrt{x}) + x\cdot\frac{d}{dx}\left[\arctan(\sqrt{x})\right].

Step 2: Differentiate arctan(√x) with the Chain Rule

ddxarctan(x)=11+x12x\frac{d}{dx}\arctan(\sqrt{x}) = \frac{1}{1+x}\cdot\frac{1}{2\sqrt{x}}.

Step 3: Combine and Simplify

f(x)=arctan(x)+x2x(1+x)=arctan(x)+x2(1+x)f'(x) = \arctan(\sqrt{x}) + \frac{x}{2\sqrt{x}(1+x)} = \arctan(\sqrt{x}) + \frac{\sqrt{x}}{2(1+x)}.
Example 02Hard
Differentiate y=1sin1(x2)y = \dfrac{1}{\sin^{-1}(x^2)}.
NEED A HINT?
Rewrite as [sin1(x2)]1[\sin^{-1}(x^2)]^{-1} and use the chain rule, remembering the inverse sine derivative also needs its own chain rule for the x2x^2 inside.
SHOW DETAILED EXPLANATION

Step 1: Rewrite as a Power

y=[sin1(x2)]1y = \left[\sin^{-1}(x^2)\right]^{-1}.

Step 2: Differentiate the Outer Power

y=[sin1(x2)]2ddx[sin1(x2)]y' = -\left[\sin^{-1}(x^2)\right]^{-2}\cdot\frac{d}{dx}\left[\sin^{-1}(x^2)\right].

Step 3: Differentiate sin⁻¹(x²) with the Chain Rule

ddxsin1(x2)=2x1x4\frac{d}{dx}\sin^{-1}(x^2) = \frac{2x}{\sqrt{1-x^4}}.

Step 4: Combine

y=2x1x4[sin1(x2)]2y' = -\frac{2x}{\sqrt{1-x^4}\left[\sin^{-1}(x^2)\right]^2}.
Common Pitfalls
  • Cofunction Derivatives Are Just Negativescos1x\cos^{-1}x, cot1x\cot^{-1}x, and csc1x\csc^{-1}x have exactly the same derivative formulas as sin1x\sin^{-1}x, tan1x\tan^{-1}x, and sec1x\sec^{-1}x respectively, just with a minus sign — don't re-derive them from scratch.
  • Inverse Trig Arguments Still Need the Chain Ruleddxsin1(x2)11x4\frac{d}{dx}\sin^{-1}(x^2) \neq \frac{1}{\sqrt{1-x^4}} alone — you must still multiply by the derivative of the inside, 2x2x.
Gary Chang

Gary Chang

Calculus Educator

5+ Years of Calculus Teaching Experience | AP Calculus Specialist. Dedicated to helping students master calculus through step-by-step logic and clear visualizations.