# Easiest way to solve this integral [closed]

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.

## closed as off-topic by Carl Mummert, John B, user223391, colormegone, zz20sApr 30 '16 at 0:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Carl Mummert, John B, Community, colormegone, zz20s
If this question can be reworded to fit the rules in the help center, please edit the question.

• Please improve the question by including key context: why would someone want to solve the integral? In other words, what is the motivation for looking at the integral in the first place? There are an infinite number of possible integrals, and even the ones that are of interest could arise in different situations. So the best questions on this site include the background of their problem, not just a statement of an integral to evaluate. – Carl Mummert Apr 29 '16 at 19:39

## 2 Answers

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.

• That's cool, thanks! – Gogis Apr 29 '16 at 19:27

Multiplying by $\displaystyle\frac{1-\cos x}{1-\cos x}$ gives $\displaystyle\int\frac{x(1-\cos x)}{\sin^2x}dx=\int x\left(\csc^2x -\csc x\cot x\right) dx$.

Now integrate by parts, with $u=x$ and $dv=(\csc^2x-\csc x \cot x) dx$ and $v=\csc x-\cot x$ to get

$\hspace{.3 in}\displaystyle x(\csc x-\cot x)+\ln|\sin x|-\ln|\csc x-\cot x|+C$

$\hspace{.3 in}\displaystyle=\frac{x\sin x}{1+\cos x}+\ln(1+\cos x)+C$