Derivative of tan x
The derivative of tan x is sec²x, which equals 1/cos²x. It is always at least 1, so the tangent graph rises everywhere it is defined.
How to find the derivative of tan x
Method: quotient rule.
- 1Write tan x as a fraction: tan x = sin x / cos x.
- 2Apply the quotient rule: d/dx (f/g) = (f′g − fg′) / g².
- 3With f = sin x and g = cos x: (cos x · cos x − sin x · (−sin x)) / cos²x.
- 4Simplify the top: (cos²x + sin²x) / cos²x.
- 5Use the identity sin²x + cos²x = 1: this is 1/cos²x = sec²x.
What it means on the graph
At x = 0 the slope is exactly 1. Near the asymptotes at x = ±π/2, cos x approaches 0, so sec²x shoots up, matching how steep the tangent curve becomes there. The derivative is never below 1, and never negative.
Table of values
The derivative column uses the formula. The last column estimates the slope directly from the original function, as an independent check.
| x | tan x | sec²x | Slope, measured |
|---|---|---|---|
| −6/5 | −2.57215 | 7.61596 | 7.61596 |
| −π/4 | −1 | 2 | 2 |
| 0 | 0 | 1 | 1 |
| π/6 | √3/3 | 4/3 | 4/3 |
| π/4 | 1 | 2 | 2 |
| 6/5 | 2.57215 | 7.61596 | 7.61596 |
Second derivative
Differentiating once more gives:
The second derivative tells you which way the graph bends: positive means it curves upward, and negative means it curves downward.
Related derivatives
The same result with the chain or product rule. Each of these is checked numerically too.
| Function | Derivative |
|---|---|
tan(2x) | 2sec(2x)2 |
tan(x2) | 2xsec(x2)2 |
tan(x)2 | 2tan(x)sec(x)2 |
Common mistakes
- Writing sec x instead of sec²x. The exponent matters.
- Forgetting that sec²x and 1 + tan²x are the same thing, so your answer may look different from the back of the book but still be right.
Frequently asked questions
What is the derivative of tan x?
What is the second derivative of tan x?
Is the derivative of tan x sec²x or 1 + tan²x?
What is the second derivative of tan x?
Keep going
Type your own function into the derivative calculator and see every rule applied, step by step.