Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

The integral of sec x

The integral of sec x is ln|sec x + tan x| + C. The trick is to multiply by (sec x + tan x)/(sec x + tan x), which turns the integral into a simple u-substitution.

By the Calcist team · Updated October 26, 2026 · About a 4-minute read

The answer

∫ sec x dx = ln|sec x + tan x| + C

The derivation, step by step

  1. Multiply by a clever form of 1.
    ∫ sec x dx = ∫ sec x · (sec x + tan x)/(sec x + tan x) dx = ∫ (sec²x + sec x tan x)/(sec x + tan x) dx
  2. Notice the numerator is the derivative of the denominator. Let u = sec x + tan x. Since d/dx sec x = sec x tan x and d/dx tan x = sec²x, du = (sec x tan x + sec²x) dx.
  3. Substitute. The integral becomes ∫ du / u = ln|u| + C.
  4. Substitute back: ln|sec x + tan x| + C.

Check by differentiating: d/dx ln|sec x + tan x| = (sec x tan x + sec²x)/(sec x + tan x) = sec x (tan x + sec x)/(sec x + tan x) = sec x. ✓

Example: a definite integral

∫0π/4 sec x dx = ln|sec(π/4) + tan(π/4)| − ln|sec 0 + tan 0| = ln(√2 + 1) − ln(1) = ln(√2 + 1) ≈ 0.8814

Related integrals

IntegralResult
∫ sec x dxln|sec x + tan x| + C
∫ csc x dxln|csc x − cot x| + C
∫ tan x dxln|sec x| + C
∫ cot x dxln|sin x| + C
∫ sec²x dxtan x + C
∫ sec x tan x dxsec x + C
∫ sec³x dx(1/2) sec x tan x + (1/2) ln|sec x + tan x| + C
∫ csc³x dx−(1/2) csc x cot x + (1/2) ln|csc x − cot x| + C

The integral of csc x

The same trick works: multiply by (csc x − cot x)/(csc x − cot x). With u = csc x − cot x, du = (−csc x cot x + csc²x) dx, which is exactly the new numerator, so ∫ csc x dx = ln|csc x − cot x| + C. You may also see it written as −ln|csc x + cot x| + C. The two forms are equal, because (csc x − cot x)(csc x + cot x) = csc²x − cot²x = 1.

The integral of sec³x

sec³x needs integration by parts with u = sec x and dv = sec²x dx. After rewriting tan²x as sec²x − 1, the original integral appears on both sides; solving for it gives

∫ sec³x dx = (1/2)(sec x tan x + ln|sec x + tan x|) + C

Higher powers follow the reduction formula:

∫ secnx dx = (1/(n − 1)) tan x secn−2x + ((n − 2)/(n − 1)) ∫ secn−2x dx

Where it shows up

The integral of sec x appears whenever a substitution leaves sec θ, as in trig substitution with x = a tan θ: ∫ dx/√(1 + x²) becomes ∫ sec θ dθ. Check any of these with the integral calculator, or confirm by differentiating with the derivative calculator.

Sources: Paul's Online Notes: Integrals Involving Trig Functions; OpenStax Calculus Volume 2, Table of Integrals.

Every worked example on this page was checked with Calcist's own engine and an independent reference.

Questions people ask

What is the integral of sec x?

ln|sec x + tan x| + C.

How do you integrate sec x?

Multiply by (sec x + tan x)/(sec x + tan x). The numerator becomes the derivative of the denominator, so u = sec x + tan x gives ∫ du/u = ln|u| + C.

What is the integral of csc x?

ln|csc x − cot x| + C, which is the same as −ln|csc x + cot x| + C.

What is the integral of sec³x?

(1/2) sec x tan x + (1/2) ln|sec x + tan x| + C, found with integration by parts.