Integral of sec² x: Formula, Derivation and Examples
The integral of sec² x is tan x + C. See why it follows from the derivative of tan x, the sec²(ax) form, related integrals like tan² x and csc² x, and examples.
Trigonometric integrals Updated 3 min read
At a glance
- Antiderivative
- \tan x + C
- Also written
- \int\dfrac{1}{\cos^2 x}\,dx = \tan x + C
- Linear form
- \int\sec^2(ax + b)\,dx = \dfrac{1}{a}\tan(ax + b) + C
- Cosecant partner
- \int\csc^2 x\,dx = -\cot x + C
- From 0 to π/4
- 1
On this page
The integral of \sec^2 x is \tan x + C. It is a direct reversal of the derivative of \tan x, so there is nothing to compute, only a fact to recognise.
Graph of sec² x and its antiderivative
The smallest value of \sec^2 x is 1, at x = 0. That matches the slope of \tan x at the origin.
Derivation
- Recall the derivative of tan x: \frac{d}{dx}\tan x = \sec^2 x.
- So \tan x is an antiderivative of \sec^2 x.
- Add C: \int\sec^2 x\,dx = \tan x + C.
If you have forgotten why \frac{d}{dx}\tan x = \sec^2 x, apply the quotient rule to \frac{\sin x}{\cos x}:
Check by differentiating
Definite integrals
Any interval that reaches \pm\frac{\pi}{2} gives a divergent improper integral, because \tan x \to \infty.
Substitution variants
Example 1. \int\sec^2(5x)\,dx = \frac{1}{5}\tan(5x) + C.
Example 2. \int x\sec^2(x^2)\,dx = \frac{1}{2}\tan(x^2) + C, with u = x^2.
Example 3. \int\sec^2 x\,e^{\tan x}\,dx = e^{\tan x} + C, with u = \tan x.
Example 4. \int\frac{\sec^2 x}{\tan x}\,dx = \ln\lvert\tan x\rvert + C, since the top is the derivative of the bottom.
Related integrals
The six "square" and "product" trig integrals come straight from the six trig derivatives:
| Integral | Answer | Comes from |
|---|---|---|
| \int\sec^2 x\,dx | \tan x + C | (\tan x)' = \sec^2 x |
| \int\csc^2 x\,dx | -\cot x + C | (\cot x)' = -\csc^2 x |
| \int\sec x\tan x\,dx | \sec x + C | (\sec x)' = \sec x\tan x |
| \int\csc x\cot x\,dx | -\csc x + C | (\csc x)' = -\csc x\cot x |
| \int\tan^2 x\,dx | \tan x - x + C | \tan^2 x = \sec^2 x - 1 |
The last row is worked out on the integral of tan² x page, and the third row on the integral of sec x tan x page.
Worked example: two correct answers
Find \int\sec^2 x\tan x\,dx.
- With u = \tan x, du = \sec^2 x\,dx: the answer is \frac{\tan^2 x}{2} + C.
- With u = \sec x, du = \sec x\tan x\,dx: the integrand is \sec x\cdot(\sec x\tan x), so the answer is \frac{\sec^2 x}{2} + C.
Both are right. Since \sec^2 x = \tan^2 x + 1, the two answers differ only by the constant \frac{1}{2}, which C absorbs.
Common mistakes
- Using the power rule: \frac{\sec^3 x}{3}. The power rule needs the derivative of the inside, \sec x\tan x, to be present. It is not.
- Answering 2\sec x\cdot\sec x\tan x. That is the derivative of \sec^2 x.
- Confusing it with \int\sec x\,dx. That one is \ln\lvert\sec x + \tan x\rvert + C. See the integral of sec x.
- Forgetting to divide by a in \int\sec^2(ax)\,dx.
Practise on trig integral problems.
Practice it now
Sine, cosine, eˣ and 1/x
Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.
Practice this lesson