Integrating linear/trigonometric I have the following question-
$$\int \frac{x}{1+\cos x}\,\text{d}x$$
Do I do integration by parts or is there some other method?
Thanks for the help.
 A: Hint:
$$\begin{align}
\int\frac{x}{1+\cos{\left(x\right)}}\,\mathrm{d}x
&=\int\frac{x}{2\cos^{2}{\left(\frac{x}{2}\right)}}\,\mathrm{d}x\\
&=\frac12\int x\sec^{2}{\left(\frac{x}{2}\right)}\,\mathrm{d}x.\\
\end{align}$$
This form suggests that the probable next step is integration by parts.
A: There are different ways.
One way is to multiply top and bottom by $1-cosx$ This gives you a $x(1-cosx)$ in the numerator and a $sin^2x$ in the denominator. Now use partial fraction decomposition using the fact that both $sec^2x$ and $\frac{cosx}{sin^2x}$ can be anti derived twice in terms of elementary functions.
A: $\int \frac{x}{1+{cos}\,  x} dx= \int \frac{x}{2{cos}^{2}\frac{x}{2}} dx = \frac{1}{2}\int x \, {sec} ^{2}\frac{x}{2}dx$
Then integrate by parts. You should get
$x\, $tan$\frac{x}{2} + 2 \, $log$($cos$\frac{x}{2}) $ + constant
A: Notice, we have $$\int\frac{x}{1+\cos x}dx$$   $$=\int\frac{x}{1+\frac{1-\tan^2\frac{x}{2}}{1+\tan^2\frac{x}{2}}}dx$$
$$=\int\frac{x\left(1+\tan^2\frac{x}{2}\right)}{1+\tan^2\frac{x}{2}+1-\tan^2\frac{x}{2}}dx$$
$$=\int\frac{x\sec^2\frac{x}{2}}{2}dx$$
$$=\frac{1}{2}\int x\sec^2\frac{x}{2}dx$$
$$=\frac{1}{2}x \int \sec^2\frac{x}{2}-\frac{1}{2}\int\left( \int \sec^2\frac{x}{2} dx \right) dx$$
$$=\frac{1}{2}x 2\tan \frac{x}{2}-\frac{1}{2}\int 2\tan \frac{x}{2} dx$$
$$=x\tan \frac{x}{2}-2\ln\left|\sec \frac{x}{2}\right|+C$$
