# Evaluating the trigonometric integral $\int\frac{\cos x}{1 + \cos x} \,dx$

$$\int\frac{\cos x}{1 + \cos x} \,dx$$

How do I go about tackling this problem? I tried doing integration by parts but that didn't work, I tried using substitution but that didn't work either so I'm not sure how to go about solving this.

Any help would be much appreciated.

• The "standard substitution" (usually the first thing to try) is $t=\tan\frac{x}{2}$. That takes you to $\int\frac{1-t^2}{1+t^2}\ dt$. Write the integrand as $-1+\frac{2}{1+t^2}$ and the rest is obvious. – almagest May 15 '16 at 12:36
• @almagest ... I would say that $t=\tan\frac{x}{2}$ not "the first thing to try" since it will usually be longer than any other method which is applicable. But if no other method works, then you have to try it. – GEdgar May 15 '16 at 13:07
• @GEdgar Well these things are a matter of taste. The snag about hunting around for elegant solutions is that it can end up taking much longer. – almagest May 15 '16 at 13:14

Hint $\cos(x)=\frac{1-\tan^2(x/2)}{1+\tan^2(x/2)}$ so the integral reduces to $0.5\int (1-\tan^2(x/2))dx$ where we can then use identity $\tan^2(x/2)=\sec^2(x/2)-1$ to get the final integral which is $x-\tan(x/2)+C$

• I was thinking about this approach too! According to Mathematica the answer should be $x-\tan(x/2)$ though, but I don't yet see how you made a wrong step. – Jasper May 15 '16 at 12:30
• Sorry I ignored $0.5$ let me edit – Archis Welankar May 15 '16 at 12:38
• See derivative of $tan(x/2)$ is $sec^2(x/2).0.5$ so this 0.5 and above one cancels giving the answer – Archis Welankar May 15 '16 at 12:40
• Now the answer is the same as Mathematica's, but I don't see how $0.5\int 1- \tan^2(...) = 0.5\int 1- (\tan^2(...)-1)$ becomes $2x$. – Jasper May 15 '16 at 12:41
• Oh you're right! My bad :P – Jasper May 15 '16 at 12:41

Hint Here's one method: Rewrite the integrand as $$\frac{\cos x}{1 + \cos x} = 1 - \frac{1}{1 + \cos x},$$ so that the integral becomes $$\int \frac{\cos x}{1 + \cos x} \,dx= \int \left(1 - \frac{1}{1 + \cos x}\right) dx = x - {\int \frac{dx}{1 + \cos x}} .$$ Now, the remaining integral can be handled by exploiting the Pythagorean identity: $$\frac{1}{1 + \cos x} = \frac{1}{1 + \cos x} \cdot \frac{1 - \cos x}{1 - \cos x} = \frac{1 - \cos x}{1 - \cos^2 x} = \frac{1 - \cos x}{\sin^2 x} .$$

Additional hint Now, $${\int \frac{1 - \cos x}{\sin^2 x} dx} = \int \frac{dx}{\sin^2 x} - \int \frac{\cos x}{\sin^2 x} \,dx .$$ The first integral is elementary, and the second can be handled with a straightforward substitution.

• the second one is elementary too. $$\int - \cot x \csc x dx = \csc x + C$$ – Aritra Das May 15 '16 at 13:30

$$\int \frac{\cos \left(x\right)}{1+\cos \left(x\right)}dx$$ Apply integral substitution: $\color{green}{u=\tan \left(\frac{x}{2}\right)\quad \:dx=\frac{2}{1+u^2}du}$ $$\int \frac{\cos \left(x\right)}{1+\cos \left(x\right)}dx\color{red}{=\int \frac{2}{u^2+1}du-\int \:1du}$$ Now it's easy...

Note that $$\frac{\cos x}{1+\cos x}=\frac{2\cos^2\frac{x}{2}-1}{2\cos^2\frac{x}{2}}$$ $$=1-\frac{1}{2}\sec^2\frac{x}{2}$$ $$\implies \int \frac{\cos x dx}{1+\cos x}=\int \left(1-\frac{1}{2}\sec^2\frac{x}{2}\right)dx$$ $$=x-\tan\frac{x}{2}+\mathbb C$$