Mathwords logoMathwords

derivative of tan x — Definition, Formula & Examples

The derivative of tan x is sec²x. This means that at any point where tan x is defined, the rate at which tan x changes equals the square of the secant of that angle.

If f(x)=tanxf(x) = \tan x, then f(x)=sec2xf'(x) = \sec^2 x for all xπ2+nπx \neq \frac{\pi}{2} + n\pi, where nn is any integer. This result follows from applying the quotient rule to sinxcosx\frac{\sin x}{\cos x} and using the Pythagorean identity sin2x+cos2x=1\sin^2 x + \cos^2 x = 1.

Key Formula

ddx[tanx]=sec2x\frac{d}{dx}[\tan x] = \sec^2 x
Where:
  • xx = Angle in radians (x must not equal π/2 + nπ for any integer n)

How It Works

Since tanx=sinxcosx\tan x = \frac{\sin x}{\cos x}, you can derive the result with the quotient rule. The numerator becomes cosxcosxsinx(sinx)=cos2x+sin2x=1\cos x \cdot \cos x - \sin x \cdot (-\sin x) = \cos^2 x + \sin^2 x = 1. The denominator is cos2x\cos^2 x. Dividing gives 1cos2x=sec2x\frac{1}{\cos^2 x} = \sec^2 x. You can also verify this by noting that sec2x=1+tan2x\sec^2 x = 1 + \tan^2 x, which is always positive — consistent with the fact that tanx\tan x is always increasing on each interval where it is defined.

Worked Example

Problem: Find the derivative of f(x) = 3tan(x) + x².
Differentiate each term: Apply the sum rule and constant multiple rule. The derivative of 3tan(x) uses the tan x derivative formula, and the derivative of x² uses the power rule.
f(x)=3sec2x+2xf'(x) = 3 \cdot \sec^2 x + 2x
Evaluate at x = 0: Substitute x = 0. Since sec(0) = 1/cos(0) = 1, you get sec²(0) = 1.
f(0)=3(1)2+2(0)=3f'(0) = 3(1)^2 + 2(0) = 3
Answer: f(x)=3sec2x+2xf'(x) = 3\sec^2 x + 2x, and the slope at x=0x = 0 is 33.

Why It Matters

This derivative appears constantly in calculus problems involving trigonometric functions — from related-rates problems in AP Calculus to integration by substitution where recognizing sec²x as the derivative of tan x lets you evaluate integrals directly.

Common Mistakes

Mistake: Writing the derivative as sec x · tan x instead of sec²x.
Correction: The derivative of sec x is sec x · tan x. The derivative of tan x is sec²x. Keep these two standard results distinct by remembering which function you started with.

Related Terms