I was solving this problem from a calculus textbook and I got stuck at this particular problem. I tried to put it into Integral Calculator after I was unable to solve it, but now I wonder if there is an easier way.
What is the easiest way to solve the following indefinite integral: $$\int \frac{x dx}{1 + \cos x}, x \in (-\pi, \pi)$$
Thank you very much.
Use $$\cos x=2\cos^2\frac x2-1,$$ then \begin{align*} \int\frac x{1+\cos x}dx&=\int\frac x{2\cos^2 \frac x2}dx\\[3pt] &=\int x\sec^2\frac x2\cdot \frac12dx\\[3pt] &=\int x\cdot d\left(\tan \frac x2\right)\\[3pt] &=x\tan \frac x2-\int\tan \frac x2dx\tag{P}\\[3pt] &=x\tan \frac x2+2\log\left(\cos \frac x2\right)+C \end{align*} Where (P) is integration by parts.