AP Calculus AB and BC
Derivative of tan x: Answer, Proof, and Mistakes
The derivative of tan x is sec^2 x, which equals 1/cos^2 x. It holds everywhere tan x is defined, meaning every x except odd multiples of pi/2 (where cos x = 0). You get it by applying the quotient rule to tan x = sin x / cos x, using the Pythagorean identity sin^2 x + cos^2 x = 1.
The proof, by the quotient rule
Rewrite the tangent as a quotient of sine and cosine, then differentiate with the quotient rule. Recall that and .
The two negatives in make a positive, so the numerator becomes , which equals by the Pythagorean identity.
Same answer, two forms
means , and since , that is exactly . Both forms name the same result. It holds only where , so it excludes , the odd multiples of where is undefined.
Where it shows up on the AP exam
The College Board lists this derivative directly in Unit 2, Topic 2.10, Finding the Derivatives of Tangent, Cotangent, Secant, and/or Cosecant Functions. Unit 2, Differentiation: Definition and Fundamental Properties, makes up 10 to 15% of the AB exam and 5 to 10% of BC.
The derivation leans on Topic 2.9, The Quotient Rule, and the ingredients come from Topic 2.7, Derivatives of cos x, sin x, e^x, and ln x. On the exam you rarely differentiate a bare ; it usually sits inside a composite that needs the chain rule from Unit 3, Topic 3.1.
- Chain-rule composites such as or , where the answer is times for inside function .
- Related rates and motion problems where an angle changes, so a term is differentiated with respect to time.
- Tangent-line and slope questions that ask for at a point when contains .
- Free-response work that expects you to recognize instantly, without pausing to re-derive it.
Common mistakes
| Mistake | Why it is wrong |
|---|---|
| Writing | That is the derivative of , not . The tangent gives . |
| The chain rule is missing. The inner derivative makes it . | |
| Reading as | means , a squared output, not a squared input. |
| Numerator | A sign slip. Since , the term is , so the sum gives . |
| Using the formula at | Both and are undefined there. Check the domain before you evaluate. |
Chain-rule composites, quick practice
Every composite follows one pattern: differentiate the outer tangent to , then multiply by , the derivative of the inside function .
For a product such as , pair this with the product rule: .
Check yourself, not just the answer
Type derivatives and get graded on mathematical equivalence, with rule-level hints when you miss, in the Derivative Practice Checker.
Frequently asked questions
Is the derivative of or ?
Both, because they are the same expression. Since , squaring gives . Use whichever form fits the rest of your work.
Why is the derivative of always positive?
Wherever it is defined, is divided by a nonzero square, so it is always positive, never zero or negative. And since , dividing by it gives . Either way the slope is positive, which is the calculus reason is increasing on every interval between its asymptotes.
What is the second derivative of ?
Differentiate with the chain rule: .
Where is not differentiable?
At the odd multiples of , that is for any integer . There , so has a vertical asymptote and is not even defined, let alone differentiable.