Calculus I › Differentiation rules › full formula sheet
The derivative of tan x
Tangent’s derivative is secant squared — not a new fact, just the quotient rule applied to sin/cos.
Notation: sec x = 1/cos x. d/dx[tan(u)] = sec²(u)·u′. tan is undefined at π/2 + kπ — so is its derivative.
Before this lesson: Quotient rule · Derivative of sin x · Derivative of cos x
Where it comes from
Tangent isn’t a new function — it’s tan x = sin x/cos x. So its derivative isn’t a new fact either: it’s the quotient rule, and you already did it on the quotient page. Run the chant “low d-high minus high d-low, over low-low”:
Before reading on: tan x = sin x/cos x, and you know the quotient rule plus both trig derivatives. Before the computation runs — do you expect a square, a product, or something else?
The wrong guess to kill: d/dx [tan x] = sec x tan x?? That’s secant’s derivative. Test at x = 0: tan x ≈ x near 0, so the slope is 1; sec²(0) = 1 ✓, but sec(0) tan(0) = 1·0 = 0 ✗. Dead on arrival.
Derivation
The derivation is the quotient-rule computation above — here it is as a clean proof, plus the alternate form:
Domain note: tan is undefined at π/2 + kπ (vertical asymptotes), and sec² blows up at exactly the same points — a derivative can’t exist where the function doesn’t.
How to use it
The procedure:
- Plain tan x → sec²x.
- Something inside? Chain: d/dx [tan(u)] = sec²(u)·u′. Example: d/dx [tan(3x)] = 3 sec²(3x).
- Powers of tan chain too: d/dx [tan³x] = 3 tan²x·sec²x (power rule outside, tan rule inside).
- Choose your form: sec²x and 1 + tan²x are interchangeable — use 1 + tan²x when the problem already speaks tan.
Judgment calls
Forgot the formula? Re-derive it from sin/cos in 30 seconds — that’s faster and safer than guessing. Don’t confuse with secant’s derivative: d/dx [sec x] = sec x tan x (a product, no square) vs. d/dx [tan x] = sec²x (a square, no tan factor).
Worked examples
Four problems, easiest first. sec² is the star; the chain rule is the co-star.
Example 1 — d/dx [tan(2x)]
- Layers: outer tan u, inner u = 2x.
- Outside: sec²(2x). Inside’s derivative: 2.
- Multiply: = 2 sec²(2x).
Your turn: d/dx [tan(4x)]
Answer: 4 sec²(4x)
Layers: outer tan u, inner u = 4x. Outside: sec²(4x). Inside’s derivative: 4. Multiply: 4 sec²(4x).
Example 2 — d/dx [x tan x] (product)
- Structure: multiplied — product rule: f = x, g = tan x.
- Derivatives: f′ = 1, g′ = sec²x.
- Assemble: = tan x + x sec²x.
Your turn: d/dx [x² tan x] (product)
Answer: 2x tan x + x² sec²x
Product rule: f = x², g = tan x. f′ = 2x, g′ = sec²x. Assemble: 2x tan x + x² sec²x = x(2 tan x + x sec²x).
Example 3 — d/dx [tan³x] (power of tan)
- Rewrite: (tan x)³ — outer u³, inner tan x.
- Outside: 3 tan²x. Inside’s derivative: sec²x.
- Multiply: = 3 tan²x sec²x.
Your turn: d/dx [tan²x] (power of tan)
Answer: 2 tan x sec²x
Rewrite: (tan x)² — outer u², inner tan x. Outside: 2 tan x. Inside’s derivative: sec²x. Multiply: 2 tan x sec²x.
Example 4 — sanity check at x = 0: d/dx [tan x] = sec²x
- Formula: sec²(0) = 1/cos²(0) = 1/1 = 1.
- Geometry: near 0, tan x ≈ x (the line y = x hugs the curve), so slope 1. Matches ✓
- Alternate form: 1 + tan²(0) = 1 + 0 = 1. Both forms agree ✓
Your turn: Sanity check at x = π/4: d/dx [tan x] = sec²x
Answer: 2
Formula: sec²(π/4) = 1/cos²(π/4) = 1/(1/2) = 2. Alternate form: 1 + tan²(π/4) = 1 + 1 = 2. Both agree — and 2 > 1, steeper than at 0, as the graph shows.
Memorization tips
- It’s the quotient rule in disguise: tan = sin/cos. If the formula ever slips your mind, re-derive it in 30 seconds — safer than guessing.
- “Tan gives sec-squared”: square, no tan factor. Secant’s rule is the mirror: product sec tan, no square. One chant each, never swapped.
- The x = 0 test: tan’s slope at 0 is 1. sec²(0) = 1 ✓, sec(0) tan(0) = 0 ✗. Five seconds, decisive.
- Two forms, one rule: sec²x = 1 + tan²x. Pick whichever matches the problem’s language.
- Chains multiply: tan(3x) → 3 sec²(3x); tan³x → 3 tan²x sec²x. The inside always contributes.
- Domain travels along: tan dies at π/2 + kπ, and so does sec². Never evaluate the derivative where tan is undefined.
Final challenge
Five mixed questions — the sec² form, the 1+tan² form, and chains. Score 5/5 and it’s yours.
← Back to the Calculus I formula sheet
How to learn a formula here
- Read each section in order — every section ends with a short quiz. Take it before moving on; the questions test exactly what you just read.
- Work the examples with the answers covered, then uncover one step at a time and compare.
- Finish with the final challenge — five mixed questions including the classic traps.
- Retake what you miss — every quiz reshuffles each attempt, and every answer explains itself.
Frequently asked questions
What is the derivative of tan x?
d/dx[tan x] = sec²x. It’s the quotient rule applied to tan x = sin x/cos x: [(cos)(cos) − (sin)(−sin)]/cos² = 1/cos² = sec²x.
Is there another form of the answer?
Yes: sec²x = 1 + tan²x (divide cos²+sin² = 1 by cos²). Use 1 + tan²x when the problem already contains tan — it often simplifies better.
How do I avoid confusing it with secant’s derivative?
d/dx[tan x] = sec²x (a square, no tan factor) vs. d/dx[sec x] = sec x·tan x (a product, no square). The x = 0 test separates them: tan’s slope is 1, sec·tan gives 0.
What is d/dx[tan(3x)]?
3sec²(3x). Chain rule: sec²(3x) for the outside, times the inside’s derivative 3.
What if I forget the formula on an exam?
Re-derive it from sin x/cos x with the quotient rule — about 30 seconds. That’s the advantage of understanding over memorizing: the proof is always with you.
More from the codex
Support the codex
This page is free, with no account and no ads. If it helped you learn, consider supporting the indie dev behind it.
Questions or a bug to report? Email [email protected].