$\int_0^{\pi} \frac{x \sin x}{2 + \cos x}dx$ Problem : $$\int_0^{\pi} \frac{x \sin x}{2 + \cos x}dx$$

I tried $x=\pi - t$ but this just made integrand more messy
because its denominator isn't $2 + \cos x$.
I want to try this without $\tan(x/2)=t$ (like symmetric or etc.)
Thanks for help.
 A: @Crostul has already done the most difficult part of the question.  I'll show you the tabular method which organizes stuff well.




S
D
I




$+$
$x$
$\sin x / (2 + \cos x)$


$-$
$1$
$-\ln(2 + \cos x)$




\begin{align}
\int_0^{\pi} \frac{x \sin x}{2 + \cos x}\,\mathrm{d}x &= [-x\ln(2+\cos x)]_0^\pi + \int_0^\pi \ln(2 + \cos x)\,\mathrm{d}x \\
&= -\pi\ln(2+\cos\pi) + 0 + \int_0^\pi \ln(2 + \cos x)\,\mathrm{d}x \\
&= 2\pi \ln\frac{1+\sqrt3}2 \tag1 \label1
\end{align}
\eqref{1} comes from Evaluation of $\int_{0}^{\pi}\log(2+\cos x)dx$.
A: The present answer is quite applicable and straightforward but I want to interpret my way of solving this kind of question.
Let us start with the substitution: $$ \bbox[yellow] { 2+\cos (x)=\frac{4-\cos^2 (x)}{2-\cos (x)} }$$ This is followed by: $$\int_{0}^{\pi} \frac{(2-\cos (x))\space x \sin (x)}{4-\cos^2 (x)} dx = \int_{0}^{\pi} \frac{2x \sin (x)}{4-\cos^2 (x)} dx-\int_{0}^{\pi} \frac{x \cos (x) \sin (x)}{4-\cos^2 (x)} dx$$ The evaluation of the first part of the integral comes from the lemma: $$\int_{0}^{\pi} x f(\sin (x)) dx=\frac{\pi}{2} \int_{0}^{\pi} f(\sin (x))dx$$ If we set $f(\sin (x))$ to be $\frac{2\sin(x)}{3+\sin^2(x)}$: $$\int_{0}^{\pi} x f(\sin(x))dx=\frac{\pi}{2} \int_{0}^{\pi} \frac{2 \sin(x)}{3+\sin^2(x)} dx=\frac{\pi}{2} \int_{0}^{\pi} \frac{2\sin(x)}{4-\cos^2 (x)} dx$$ We can integrate it using the method of substitution: $$\begin{align} y=\frac{\cos(x)}{2}\rightarrow -\frac{\pi}{2} \int_{\frac{1}{2}} ^{-\frac{1}{2}} \frac{dy}{1-{y^2}}
&=\Biggl[-\frac{\pi}{2}\tanh^{-1}y\Biggl]^{-\frac{1}{2}}_{\frac{1}{2}} \\
&=-\frac{\pi}{2} \tanh^{-1}\Biggl(-\frac{1}{2}\Biggl)+\frac{\pi}{2}\tanh^{-1}\Biggl(\frac{1}{2}\Biggl) \\
&=\pi \tanh^{-1} \Biggl(\frac{1}{2}\Biggl) \\
&= \frac{\pi}{2} \ln(3) \end{align}$$
If we apply integration by parts for the second integral: $$\begin{align} \int_{0}^{\pi}\frac{x \sin(x) \cos(x)}{4-\cos^2(x)}dx
&=\Biggl[x\frac{\ln(8-2\cos^2(x))}{2}\Biggl]_{0}^{\pi}-\frac{1}{2}\int_{0}^{\pi} \ln(8-2\cos^2(x))dx \\
&= \frac{\pi}{2} \ln(6)-\frac{1}{2} \int_{0}^{\pi}\ln(8-2\cos^2(x))dx \\
&= \frac{\pi}{2} \ln(6)-\frac{1}{2} \int_{0}^{\pi} \ln(2)+\ln(2-\cos(x))+\ln(2+\cos(x)) dx \end{align}$$ The final result is: $$\begin{align}
& \frac{\pi}{2} \ln(3)-\frac{\pi}{2}\ln(6)+\frac{\pi}{2} \ln(2)+\frac{1}{2}\int_{0}^{\pi} \ln(2-\cos(x))dx+\frac{1}{2} \int_{0}^{\pi} \ln(2+\cos(x))dx  \\ 
&= \pi \ln\Biggl(\frac{1+\sqrt{3}}{2}\Biggl)\space+\space \pi \ln\Biggl(\frac{1+\sqrt{3}}{2}\Biggl)  \\
&= 2\pi \ln\Biggl(\frac{1+\sqrt{3}}{2}\Biggl)  \end{align}$$
