# Indefinite Integration of sec x

How to find the indefinite integration of sec x: example and its solution.

## Example

Multiply cos x
to both of the numerator and the denominator.

Set sin x = t.

Then cos x dx = dt.

Derivative of sin x

Substitute [sin x] with [t].
And substitute [cos x dx] with [dt].

Then (given) = ∫ 1/(1 - t2) dt.

Integration by substitution (Part 1)

Change the function to make (constant)/(linear) form
by using partial fraction decomposition.

Set 1/(1 + t)(1 - t) = A/(1 - t) + B/(1 - t)
and compare both sides' numerators
to find A and B.

A = B = 1/2

So 1/(1 + t)(1 - t) = (1/2)(1/[1 - t]) + (1/2)(1/[1 - t])
= (1/2)(1/[1 - t] + 1/[1 - t]).

So (given) = ∫ (1/2)(1/[1 - t] + 1/[1 - t]) dt.

Integrate the integral.

Don't forget to change the sign of the latter term,
due to the (-) in (1 - t).

Linear change of variable rule

Indefinite integration of 1/x

Put sin x in t-s.

Then (given) = (1/2) ln |(1 + sin x)/(1 - sin x)| + C.

But let's go further to see the practical formula.

Multiply (1 + sin x)/(1 + sin x).

Denominator
(1 - sin x)(1 + sin x) = 1 - sin2 x

Product of a sum and a difference

Take the square exponents
out from both of the numerator and the denominator.

Power of a quotient

Take the exponent out from the ln.

Logarithms of powers

Split the fraction into two parts.

1/cos x = sec x
sin x/cos x = tan x

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

This answer is the practical formula
that is widely used in various fields.