Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've looked at wolfram alpha for a possible solution, but it does something that makes no sense to me... It says to let $u=\tan(\frac{x}{2})$ with no clear reason as to why...

So what would be a first step to approaching this? I've thought of converting it to $\frac{\sec{x}}{\sec{x}+1}$, but that seems to be fruitless...

share|cite|improve this question
up vote 16 down vote accepted


share|cite|improve this answer

The substitution $t=\tan(x/2)$ is a universally effective method of integrating a rational function of $\cos x$ and/or $\sin x$. It is usually called the Weierstrass Substitution. Please see the link for details.

The procedure reduces the problem of integrating a rational function of $\cos x$ and/or $\sin x$ to integrating a rational function of $t$.

However, in many situations, including this one, there are more efficient ways to proceed.

The quickest, in this case, is the substitution suggested by M. Strochyk.

Another way would be to multiply top and bottom by $1-\cos x$. We end up with $$\int \frac{1-\cos x}{\sin^2 x}\,dx.$$ So we need $\int \csc^2 x\,dx$ and $\int \frac{\cos x}{\sin^2 x}\,dx$, both reasonably familiar.

share|cite|improve this answer
I'll definitely have to look into this method. I don't recall being taught it, but it looks like it might be very helpful in the future. – agent154 Mar 10 '13 at 20:03
The Weierstrass substitution always works. However, like an "all purpose" knife, it is not necessarily the best tool for every cutting task. – André Nicolas Mar 10 '13 at 20:07

The substitution $u = \tan(x/2)$ is a useful one to know. It transforms the integral of any rational function of $\sin(x)$ and $\cos(x)$ into the integral of a rational function of $u$.

share|cite|improve this answer

I will try to explain wolfram alpha's method. You can use the formula for $$\cos2x=\frac{1-\tan^2(x)}{1+\tan^2(x)}$$

And for this question which converts to $$\cos x=\frac{1-\tan^2(x/2)}{1+\tan^2(x/2)}$$ and now, You can substitute $Y=\tan \frac{x}{2}$ and use the method for partial fraction or otherwise to solve the problem further by already known methods.

And in the end after integration substitute back $Y=\tan \frac{x}{2}$

share|cite|improve this answer

Hint:$$u=\tan\left(\frac{x}{2}\right)$$ then $$\int\frac{1}{1+\cos{x}}\ dx=\int\frac{\frac{2}{1+u^2}}{1+\frac{1-u^2}{1+u^2}}\ du=\int du=u+c=\tan\left(\frac{x}{2}\right)+c$$

share|cite|improve this answer

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.