[Math] Integral of $\frac1{\cos x}$ using t substitution

calculusintegrationtrigonometry

Okay, so I'm trying to find $ \int \frac1{\cos x}\mathrm{d}x$ using the substitution $t = \tan\left(\frac{x}{2}\right)$.

I sub in the trig identity for $\sec$ as $\frac{1+t^2}{1-t^2}$ and then rearrange and substitute $\frac{\mathrm{d}t}{\mathrm{d}x} = \frac12 \left(1+ \tan^2\left(\frac{x}{2}\right)\right)$ so I am left with

$\frac2{1-t^2}$

I then used partial fractions to find

$\frac2{1-t^2} = \frac1{1+t} + \frac1{1-t}$

and therefore integrating I get

$\int \frac1{\cos x}dx = \ln(t+1) – \ln(t-1)$

But subbing in $t = \tan\left(\frac{x}{2}\right)$ doesn't seem to get me anywhere close to the solution that I want to find, which is:

$ \int \frac1{\cos x}\mathrm{d}x = \ln(\sec x + \tan x) + C$

Any help on this would be greatly appreciated.

Thanks!

Best Answer

The problem equivocates to proving that $\left|\frac{t+1}{t-1}\right| = |\sec x + \tan x|$, where $t=\tan\frac x2$.

Using the fact that $\tan\frac x2 = \frac{1-\cos x}{\sin x}$, we get

$$\frac{t+1}{t-1} = \frac{1+\sin x-\cos x}{1-\sin x-\cos x} = \frac{\sec x+\tan x-1}{\sec x-\tan x-1}.$$

In addition, $$\begin{align}(\sec x+\tan x)(-1+\sec x-\tan x) &= -\sec x - \tan x +(\sec^2x-\tan^2x)\\ &= -(\sec x+\tan x-1),\end{align}$$ which is what we wanted.

Related Question