Ways to evaluate $\int \sec \theta \, \mathrm d \theta$

The standard approach for showing $\int \sec \theta \, \mathrm d \theta = \ln|\sec \theta + \tan \theta| + C$ is to multiply by $\dfrac{\sec \theta + \tan \theta}{\sec \theta + \tan \theta}$ and then do a substitution with $u = \sec \theta + \tan \theta$.

I like the fact that this trick leads to a fast and clean derivation, but I also find it unsatisfying: It's not very intuitive, nor does it seem to have applicability to any integration problem other than $\int \csc \theta \,\mathrm d \theta$. Does anyone know of another way to evaluate $\int \sec \theta \, \mathrm d \theta$?


Solution 1:

Another way is:

$$\int \sec x \,dx = \int \frac{\cos x}{\cos^2 x} \,dx = \int \frac{\cos x}{1-\sin^2 x} \,dx = \frac{1}{2} \int \left( \frac{1}{1-\sin x} + \frac{1}{1+\sin x} \right) \cos x dx $$ $$= \frac{1}{2} \log \left| \frac{1+\sin x}{1-\sin x} \right| + C.$$

It's worth noting that the answer can appear in many disguises. Another is $$\log \left| \tan \left( \frac{\pi}{4} + \frac{x}{2} \right) \right| $$

Solution 2:

A useful technique is to use the half angle formulas in terms of $\tan (\theta/2)$ in order to convert trigonometric (rational) functions into rational functions.

For example if $t = \tan(\theta/2)$ we have that $\sec \theta = \frac{1+t^2}{1-t^2}$

We have $2\,\mathrm dt = (1 + \tan^2(\theta/2))\,\mathrm d\theta$

And so

$$\int \sec \theta \,\mathrm d\theta = \int \frac{2\;\mathrm dt}{1-t^2}$$

Which can easily be evaluated.

Similarly we get

$$\int \csc \theta \,\mathrm d\theta = \int \frac{\mathrm dt}{t}$$

using $\csc \theta = \frac{1+t^2}{2t}$

Check this page out.

Solution 3:

Using the definitions $$\sec \theta = 1/\cos \theta \quad \text{and} \quad \cos \theta = (\exp(i \theta) + \exp(-i \theta))/2$$ gives $$\int \sec \theta \, d \theta = \int \frac{2 \, d \theta}{\exp(i \theta) + \exp(-i \theta)}.$$ The only insight needed is to find the substitution $u = \exp( i \theta )$ (what else is there to try?), leading to a multiple of $\int \frac{du}{1+u^2}$, the inverse tangent. Thus, in an essentially mechanical fashion you obtain the generic solution $$-2 i \arctan(\exp(i \theta)).$$ Unwinding this via the usual algebraic identities between exponential and trig functions not only shows it is equal to the usual solutions, but also reveals why half angles might be involved and where an offset of $\pi /4$ might come from (as in @Derek Jennings' answer): it's a constant of integration, of course.

Solution 4:

Here is a way an electrician solves the problem. Since $\cos(x)=\sin(\frac{\pi}{2} + x)$ it is easier consider the integral $$ I=\int \csc x \, dx = \int \dfrac1{\sin x} \, \mathrm dx$$

Now: $$ \frac1{\sin x} \, \mathrm dx= \frac1{2\sin \frac{x}{2}\cos\frac{x}{2}} \, \mathrm dx=\frac1{2\tan\frac{x}{2}\cos^2\frac{x}{2}} \, \mathrm dx =\frac{\mathrm d\tan\frac{x}{2}}{\tan\frac{x}{2}}=\mathrm d \ln \left | \tan\frac{x}{2} \right | $$

Thus $$I=\ln \left | \tan\frac{x}{2}\right | +C$$

Substituting $x$ with $\frac{\pi}{2}+x$ gives for the original integral:

$$\ln \left| \tan \left( \frac{\pi}{4} + \frac{x}{2} \right) \right|+C $$

Solution 5:

Instead of presenting another way of evaluating this integral, I justify a more general case in an approach which uses partial fractions and trigonometric identities, at the level of a Calculus class, I think:

$$\int \dfrac{1}{a+b\cos x}dx=\dfrac{1}{\sqrt{b^{2}-a^{2}}}\ln \left\vert \dfrac{\sqrt{a+b}+\sqrt{b-a}\tan x/2}{\sqrt{a+b}-\sqrt{b-a}\tan x/2}\right\vert \quad a\lt b.\quad (\ast)$$

Since

$$a+b\cos x=(a-b)+2b\cos ^{2}x/2,$$

we have

$$\dfrac{1}{a+b\cos x}=\dfrac{\sec ^{2}x/2}{(a-b)\sec ^{2}x/2+2b}=\dfrac{\sec ^{2}x/2}{(a-b)\sec ^{2}x/2+2b}=\dfrac{\sec ^{2}x/2}{a+b-(b-a)\tan ^{2}x/2}.$$

But

$$\dfrac{1}{a+b-(b-a)\tan ^{2}x/2}=$$

$$=\dfrac{1}{2\sqrt{a+b}}\left( \dfrac{1}{% \sqrt{a+b}-\sqrt{b-a}\tan x/2}+\dfrac{1}{\sqrt{a+b}+\sqrt{b-a}\tan x/2}% \right) .$$

Hence

$$\int \dfrac{1}{a+b\cos x}dx=$$

$$=\dfrac{1}{2\sqrt{a+b}}\int \left( \dfrac{\sec ^{2}x/2}{\sqrt{a+b}-\sqrt{b-a}\tan x/2}+\dfrac{\sec ^{2}x/2}{\sqrt{a+b}+% \sqrt{b-a}\tan x/2}\right) dx$$

$$=\dfrac{1}{\sqrt{b^{2}-a^{2}}}\ln \left\vert \dfrac{\sqrt{a+b}+\sqrt{b-a}% \tan x/2}{\sqrt{a+b}-\sqrt{b-a}\tan x/2}\right\vert .$$

Thus, we have your particular case

$$\int \dfrac{1}{\cos x}dx=\int \dfrac{1}{0+1\cos x}dx=\ln \left\vert \dfrac{% 1+\tan x/2}{1-\tan x/2}\right\vert . \qquad (\ast\ast)$$

From $\tan \dfrac{x}{2}=\dfrac{\sin x}{1+\cos x}$ and $\sec x+\tan x=\dfrac{1+\sec x+\tan x}{1+\sec x-\tan x}$ it follows that

$$\dfrac{1+\tan x/2}{1-\tan x/2}=\dfrac{1+\dfrac{\sin x}{1+\cos x}}{1-\dfrac{% \sin x}{1+\cos x}}=\dfrac{1+\cos x+\sin x}{1+\cos x-\sin x}=\sec x+\tan x$$

and, finally

$$\int \sec x\; dx=\ln \left\vert \sec x+\tan x\right\vert .$$