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.

sec2xdx=tanx+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[tanx]=sec2x\frac{d}{dx}\left[\tan x\right] = \sec^2 x

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

sec2xdx=tanx+C\int \sec^2 x\,dx = \tan x + C

Check it the way you should check every antiderivative, by differentiating the answer: ddx[tanx+C]=sec2x+0=sec2x\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

tanx\tan x breaks at every odd multiple of π2\frac{\pi}{2}, so no single antiderivative of sec2x\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 sec2x\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=3dxdu = 3\,dx, a factor of 13\frac{1}{3} comes out front.

sec2(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 tanx\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π/4sec2xdx=tanπ4tan0=1\int_0^{\pi/4} \sec^2 x\,dx = \tan\frac{\pi}{4} - \tan 0 = 1

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

Common mistakes with the integral of sec^2 x

  • Answering secxtanx\sec x \tan x. That is the derivative of secx\sec x, so it is the integrand in secxtanxdx=secx+C\int \sec x \tan x\,dx = \sec x + C. The pair to memorize here is sec2x\sec^2 x with tanx\tan x.
  • Confusing it with secxdx\int \sec x\,dx, which is lnsecx+tanx+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. sec2(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πsec2xdx\int_0^{\pi} \sec^2 x\,dx is not tanπtan0=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 sec2x\sec^2 x as 1cos2x\frac{1}{\cos^2 x} and then guessing a logarithm. The rewrite is a true identity, but 1cos2x\frac{1}{\cos^2 x} is not of the form uu\frac{u'}{u}, so nothing logarithmic comes out of it.

Quick practice with sec^2 integrands

  1. sec2(5x)dx=15tan(5x)+C\int \sec^2(5x)\,dx = \frac{1}{5}\tan(5x) + C, with u=5xu = 5x.
  2. xsec2(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=2xdxdu = 2x\,dx.
  3. sec2xtanxdx=tan2x2+C\int \sec^2 x \cdot \tan x\,dx = \frac{\tan^2 x}{2} + C, with u=tanxu = \tan x and du=sec2xdxdu = \sec^2 x\,dx.
  4. 0π/3sec2xdx=tanπ3tan0=3\int_0^{\pi/3} \sec^2 x\,dx = \tan\frac{\pi}{3} - \tan 0 = \sqrt{3}.
  5. tan2xdx=(sec2x1)dx=tanxx+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 sec2xdx\int \sec^2 x\,dx the same as 1cos2xdx\int \frac{1}{\cos^2 x}\,dx?

Yes. Since secx=1cosx\sec x = \frac{1}{\cos x}, squaring gives sec2x=1cos2x\sec^2 x = \frac{1}{\cos^2 x}, so the two integrals are the same problem written two ways, and both equal tanx+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 sec2x\sec^2 x on its own is exactly ddx[tanx]\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 sec2(3x)\sec^2(3x).

What is tan2xdx\int \tan^2 x\,dx?

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

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

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