Calculus I › Differentiation rules › full formula sheet

d/dx [tan x] = sec2xSay it: the derivative of tangent of x is secant squared of x.

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?

d/dx [sin x/cos x]
=
[cos x·cos x − sin x·(−sin x)] / cos²x
f = sin x, g = cos x. The double negative is the crux: −sin x·(−sin x) = +sin²x.
=
(cos²x + sin²x) / cos²x = 1/cos²x
Pythagoras: cos² + sin² = 1.
=
sec²x
Since sec x = 1/cos x. That’s the whole rule — no memorization needed if you can re-derive it.

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:

d/dx [tan x]
=
d/dx [sin x/cos x]
Step 1 — definition of tan. Everything follows from sine and cosine.
=
[(cos x)(cos x) − (sin x)(−sin x)] / cos²x
Step 2 — quotient rule. f′g − fg′ with f = sin x, g = cos x.
=
1/cos²x = sec²x
Step 3 — Pythagoras + definition of sec. ∎
sec²x
=
1 + tan²x
Alternate form: divide cos²+sin² = 1 by cos²: 1 + tan² = sec². Useful when the answer already contains tan.

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:

  1. Plain tan x → sec²x.
  2. Something inside? Chain: d/dx [tan(u)] = sec²(u)·u′. Example: d/dx [tan(3x)] = 3 sec²(3x).
  3. Powers of tan chain too: d/dx [tan³x] = 3 tan²x·sec²x (power rule outside, tan rule inside).
  4. 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).

Common mistake: writing d/dx [tan x] = sec x tan x. That’s secant’s derivative. The x = 0 test separates them: tan’s slope is 1, sec tan gives 0.

Worked examples

Four problems, easiest first. sec² is the star; the chain rule is the co-star.

Example 1 — d/dx [tan(2x)]

  1. Layers: outer tan u, inner u = 2x.
  2. Outside: sec²(2x). Inside’s derivative: 2.
  3. Multiply: = 2 sec²(2x).
Common mistake: 2 sec(2x) tan(2x) — that’s the chain applied to secant’s rule. tan’s rule gives a square, not a product.
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)

  1. Structure: multiplied — product rule: f = x, g = tan x.
  2. Derivatives: f′ = 1, g′ = sec²x.
  3. Assemble: = tan x + x sec²x.
Common mistake: tan x + x sec x tan x (secant’s rule smuggled in). Say “tan gives sec-squared” as you substitute.
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)

  1. Rewrite: (tan x)³ — outer u³, inner tan x.
  2. Outside: 3 tan²x. Inside’s derivative: sec²x.
  3. Multiply: = 3 tan²x sec²x.
Common mistake: 3 tan²x and stop — the inner tan still needs differentiating. Two layers, two factors.
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

  1. Formula: sec²(0) = 1/cos²(0) = 1/1 = 1.
  2. Geometry: near 0, tan x ≈ x (the line y = x hugs the curve), so slope 1. Matches ✓
  3. Alternate form: 1 + tan²(0) = 1 + 0 = 1. Both forms agree ✓
Common mistake: trusting a memorized formula over a 5-second check. When two candidates compete (sec² vs sec tan), the x = 0 test picks the winner instantly.
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

  1. 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.
  2. Work the examples with the answers covered, then uncover one step at a time and compare.
  3. Finish with the final challenge — five mixed questions including the classic traps.
  4. 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