AP Calculus AB and BC

Integral of sec^2 x: Answer, Proof, and Mistakes

The integral of sec^2 x is tan x + C. It holds on any interval where tan x is defined, meaning between consecutive odd multiples of pi/2. No substitution or identity is needed: this is the derivative rule d/dx[tan x] = sec^2 x read backwards, and you confirm it by differentiating tan x + C.

∫sec⁡2x dx=tan⁡x+C\int \sec^2 x\,dx = \tan x + C

Why the integral of sec^2 x is tan x

Antidifferentiation is differentiation read backwards, so every basic integral you are expected to recall is a derivative rule you already know. The one behind this result comes from Unit 2, Topic 2.10 (Finding the Derivatives of Tangent, Cotangent, Secant, and/or Cosecant Functions).

ddx[tan⁡x]=sec⁡2x\frac{d}{dx}\left[\tan x\right] = \sec^2 x

Reading that statement right to left says tan⁡x\tan x is an antiderivative of sec⁡2x\sec^2 x. Every other antiderivative differs from it by a constant, so the indefinite integral carries +C+ C.

∫sec⁡2x dx=tan⁡x+C\int \sec^2 x\,dx = \tan x + C

Check it the way you should check every antiderivative, by differentiating the answer: ddx[tan⁡x+C]=sec⁡2x+0=sec⁡2x\frac{d}{dx}\left[\tan x + C\right] = \sec^2 x + 0 = \sec^2 x, which is the integrand you started with.

One constant per interval

tan⁡x\tan x breaks at every odd multiple of π2\frac{\pi}{2}, so no single antiderivative of sec⁡2x\sec^2 x is valid across an asymptote. The +C+ C is meant on one interval such as (−π2,π2)\left(-\frac{\pi}{2}, \frac{\pi}{2}\right), and a definite integral of sec⁡2x\sec^2 x only makes sense when the whole interval of integration sits between consecutive asymptotes.

Where this integral shows up on the AP exam

The rule itself belongs to Unit 6, Topic 6.8 (Finding Antiderivatives and Indefinite Integrals: Basic Rules and Notation). Unit 6 carries a weighting of 15 to 20 percent on both AB and BC, so the basic antiderivatives are worth recalling instantly rather than rederiving.

Most often it appears inside a composite, where substitution (Topic 6.9) returns it to the basic form. With u=3xu = 3x and du=3 dxdu = 3\,dx, a factor of 13\frac{1}{3} comes out front.

∫sec⁡2(3x) dx=13tan⁡(3x)+C\int \sec^2(3x)\,dx = \frac{1}{3}\tan(3x) + C

On a definite integral, the Fundamental Theorem of Calculus (Topic 6.7) evaluates tan⁡x\tan x at the endpoints. Both endpoints below sit inside (−π2,π2)\left(-\frac{\pi}{2}, \frac{\pi}{2}\right), so the theorem applies.

∫0π/4sec⁡2x dx=tan⁡π4−tan⁡0=1\int_0^{\pi/4} \sec^2 x\,dx = \tan\frac{\pi}{4} - \tan 0 = 1

It also arrives disguised. The identity tan⁡2x=sec⁡2x−1\tan^2 x = \sec^2 x - 1 turns ∫tan⁡2x dx\int \tan^2 x\,dx into this integral minus ∫1 dx\int 1\,dx, and separable differential equations in Unit 7 produce sec⁡2\sec^2 integrands whenever a tangent appears in the solution.

Common mistakes with the integral of sec^2 x

  • Answering sec⁡xtan⁡x\sec x \tan x. That is the derivative of sec⁡x\sec x, so it is the integrand in ∫sec⁡xtan⁡x dx=sec⁡x+C\int \sec x \tan x\,dx = \sec x + C. The pair to memorize here is sec⁡2x\sec^2 x with tan⁡x\tan x.
  • Confusing it with ∫sec⁡x dx\int \sec x\,dx, which is ln⁡∣sec⁡x+tan⁡x∣+C\ln\left|\sec x + \tan x\right| + C. The square is exactly what makes this integral immediate.
  • Losing the inside factor on a composite. ∫sec⁡2(3x) dx=13tan⁡(3x)+C\int \sec^2(3x)\,dx = \frac{1}{3}\tan(3x) + C; without the 13\frac{1}{3} the derivative comes back three times too large.
  • Dropping +C+ C on an indefinite integral. It is a scored detail on free response, and it is the difference between one function and the whole family.
  • Integrating straight through an asymptote. ∫0πsec⁡2x dx\int_0^{\pi} \sec^2 x\,dx is not tan⁡π−tan⁡0=0\tan \pi - \tan 0 = 0, because the integrand is unbounded at x=π2x = \frac{\pi}{2} inside the interval, so the Fundamental Theorem does not apply and the integral diverges.
  • Rewriting sec⁡2x\sec^2 x as 1cos⁡2x\frac{1}{\cos^2 x} and then guessing a logarithm. The rewrite is a true identity, but 1cos⁡2x\frac{1}{\cos^2 x} is not of the form u′u\frac{u'}{u}, so nothing logarithmic comes out of it.

Quick practice with sec^2 integrands

  1. ∫sec⁡2(5x) dx=15tan⁡(5x)+C\int \sec^2(5x)\,dx = \frac{1}{5}\tan(5x) + C, with u=5xu = 5x.
  2. ∫xsec⁡2(x2)dx=12tan⁡(x2)+C\int x\sec^2\left(x^2\right)dx = \frac{1}{2}\tan\left(x^2\right) + C, with u=x2u = x^2 and du=2x dxdu = 2x\,dx.
  3. ∫sec⁡2x⋅tan⁡x dx=tan⁡2x2+C\int \sec^2 x \cdot \tan x\,dx = \frac{\tan^2 x}{2} + C, with u=tan⁡xu = \tan x and du=sec⁡2x dxdu = \sec^2 x\,dx.
  4. ∫0π/3sec⁡2x dx=tan⁡π3−tan⁡0=3\int_0^{\pi/3} \sec^2 x\,dx = \tan\frac{\pi}{3} - \tan 0 = \sqrt{3}.
  5. ∫tan⁡2x dx=∫(sec⁡2x−1)dx=tan⁡x−x+C\int \tan^2 x\,dx = \int \left(\sec^2 x - 1\right)dx = \tan x - x + C.

Every answer on this page is machine checked

An automated test differentiates the antiderivative above and confirms it returns the integrand. A wrong sign or a missing factor fails the build, so it cannot reach you.

Frequently asked questions

Is ∫sec⁡2x dx\int \sec^2 x\,dx the same as ∫1cos⁡2x dx\int \frac{1}{\cos^2 x}\,dx?

Yes. Since sec⁡x=1cos⁡x\sec x = \frac{1}{\cos x}, squaring gives sec⁡2x=1cos⁡2x\sec^2 x = \frac{1}{\cos^2 x}, so the two integrals are the same problem written two ways, and both equal tan⁡x+C\tan x + C.

Why does this integral not need substitution?

Because the integrand is already a derivative you have memorized. Substitution is for composites, and sec⁡2x\sec^2 x on its own is exactly ddx[tan⁡x]\frac{d}{dx}\left[\tan x\right], so you can write the answer down. Reach for substitution only when the argument is something other than a bare xx, such as sec⁡2(3x)\sec^2(3x).

What is ∫tan⁡2x dx\int \tan^2 x\,dx?

Use the Pythagorean identity tan⁡2x=sec⁡2x−1\tan^2 x = \sec^2 x - 1 first. Then ∫tan⁡2x dx=∫sec⁡2x dx−∫1 dx=tan⁡x−x+C\int \tan^2 x\,dx = \int \sec^2 x\,dx - \int 1\,dx = \tan x - x + C. There is no basic rule for tan⁡2x\tan^2 x itself, so the rewrite is the whole move.

What is ∫sec⁡2(ax) dx\int \sec^2(ax)\,dx for a constant aa?

For any nonzero constant aa, ∫sec⁡2(ax) dx=1atan⁡(ax)+C\int \sec^2(ax)\,dx = \frac{1}{a}\tan(ax) + C. The substitution u=axu = ax gives du=a dxdu = a\,dx, which is where the 1a\frac{1}{a} comes from.