Derivative of tan(x)
The derivative of the tangent is $\dfrac{d}{dx}\tan x = \sec^2 x = \dfrac{1}{\cos^2 x} = 1+\tan^2 x$. It exists wherever $\tan x$ is defined, i.e. for $x \neq \frac{\pi}{2} + k\pi$.
See the derivative of tan(x) step by step in the calculator →
📈 Graph of tan(x) and its derivative
🔍 Why is the derivative of tan(x) equal to $\sec^2 x$?
Use $\tan x = \frac{\sin x}{\cos x}$ and the quotient rule:
Simplifying the numerator with $\sin^2x+\cos^2x = 1$ gives $\frac{1}{\cos^2 x} = \sec^2 x$; dividing it term by term instead gives $1 + \tan^2 x$.
🔗 Derivative of tan(x) with an inner function
If the argument is a function $u(x)$, the chain rule adds the inner derivative:
✏️ Worked examples
⚠️ Common mistakes
Writing $\sec x$ instead of $\sec^2 x$.
Confusing $\tan^{-1} x$ (arctan) with $\cot x$.
❓ Frequently asked questions
Is the derivative of tan(x) sec²(x) or 1/cos²(x)?
Both – they are the same function, and also equal to $1+\tan^2 x$.
What is the second derivative of tan(x)?
$2\sec^2 x\tan x$ – see the derivative of sec²(x).
Why is tan(x) always increasing?
Its derivative $\sec^2 x$ is a square that is never smaller than $1$, so the slope is positive everywhere on its domain.