Integrating sec²x, sec x tan x and tan x

Three tan-family facts, run in reverse.

sec²x integrates to tan x

By the quotient rule, tan x = (sin x)/(cos x) differentiates to (cos x × cos x − sin x × (−sin x))/cos²x = (cos²x + sin²x)/cos²x = 1/cos²x, which is sec²x.

Read backwards, ∫ sec²x dx = tan x + C. The integral of sec²x from 0 to π/4 is tan(π/4) − tan 0 = 1 − 0 = 1.

A multiple of x inside divides out as usual: ∫ sec²(3x) dx = (tan 3x)/3 + C. Check: (tan 3x)/3 differentiates to (3 sec²(3x))/3.

xy

The gold curve is y = sec²x, shaded from x = 0 to x = π/4, where its height is 2. The plain curve is y = tan x, which starts at 0 and reaches 1 at x = π/4. That height, 1, is the shaded area.

sec x tan x integrates to sec x

sec x = (cos x)⁻¹, so by the chain rule it differentiates to −(cos x)⁻² × (−sin x) = (sin x)/(cos²x). That is 1 / cos x times (sin x)/(cos x), which is sec x tan x.

So ∫ sec x tan x dx = sec x + C. The integral of sec x tan x from 0 to π/3 is sec(π/3) − sec 0 = 2 − 1 = 1.

The cosecant versions come the same way, each with a minus: cot x differentiates to −cosec²x and cosec x to −cosec x cot x. So ∫ cosec²x dx = −cot x + C and ∫ cosec x cot x dx = −cosec x + C.

tan x is a logarithm

tan x is not on the list of derivatives, but it is a fraction: tan x = (sin x)/(cos x). The denominator cos x differentiates to −sin x, so the numerator is minus the derivative of the denominator.

A derivative over its function integrates to a log, and the minus comes outside: ∫ tan x dx = −ln|cos x| + C. Check: −ln|cos x| differentiates to −(−sin x)/(cos x) = tan x.

The integral of tan x from 0 to π/3 is −ln(cos(π/3)) + ln(cos 0) = −ln ½ + 0 = ln 2 ≈ 0.693.

cot x = (cos x)/(sin x) has the derivative of its denominator on top exactly, so there is no minus: ∫ cot x dx = ln|sin x| + C.

xy

The gold curve is y = tan x, shaded from x = 0 to x = π/3. The plain curve is y = −ln(cos x), which starts at 0; its height at x = π/3 is ln 2 ≈ 0.693, the shaded area.

Two answers that are one

Some books give ∫ tan x dx = ln|sec x| + C instead. It is the same function. A minus in front of a log turns the inside upside down, since −ln a = ln(1 / a). So −ln|cos x| = ln|1 / cos x|, and 1 / cos x = sec x.

tan²x and sec x

tan²x is not a derivative either, but the identity 1 + tan²x = sec²x turns it into one: tan²x = sec²x − 1, so ∫ tan²x dx = tan x − x + C. From 0 to π/4 that is 1 − π/4 ≈ 0.215.

sec x itself needs a trick. Multiply it by (sec x + tan x)/(sec x + tan x), which is 1: the integrand becomes (sec²x + sec x tan x)/(sec x + tan x). The numerator is exactly the derivative of the denominator, so ∫ sec x dx = ln|sec x + tan x| + C. From 0 to π/4 that is ln(√2 + 1) − ln 1 ≈ 0.881.

The usual mistakes

Giving the derivative instead of the integral. sec x tan x is what sec x differentiates to, so it cannot be the integral of sec²x.

Mixing up the family. sec²x integrates to tan x and sec x tan x to sec x; differentiating each answer checks which is which.

Losing the minus on tan x. ln|cos x| differentiates to −tan x, so ∫ tan x dx = −ln|cos x| + C.

Adding a minus to cot x. cos x is the derivative of sin x, sign and all, so ∫ cot x dx = ln|sin x| + C.

Treating ln|sec x| and −ln|cos x| as different answers. They differ only in how they are written.

Practice Integrating sec²x, sec x tan x and tan x in the app