Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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


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.


share|improve this question
You might find this question relevant: math.stackexchange.com/questions/6695 –  Mike Spivey Nov 1 '10 at 21:56
This is a duplicate of math.stackexchange.com/questions/6695/… –  Ross Millikan Nov 1 '10 at 21:58
It's not quite a copy, I'm asking a different question which although is similar, doesn't get answered in that thread. I didn't think it would be appropriate to ask a question in someone else's post. –  alexganose Nov 1 '10 at 22:06

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer
Ahh Brilliant! Thank you! I strangely tried submitting back t and then applying the log rules but that just confused me a little. This makes so much sense! Thank you! –  alexganose Nov 1 '10 at 22:34

Try writing $\sec x + \tan x$ in terms of $t$ and see if you can reorganize the two answers to agree. You may need to tweak the value of $C$ to do this.

share|improve this answer
Thank you! A bit of guidance without the full answer is also nice! Learning how to solve it not just the solution really useful. Thanks! –  alexganose Nov 1 '10 at 22:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.