How to prove $\int_0^\pi \frac{dx}{2+2\sin x+\cos x}=\log3$? How can we prove that: $$\int_0^\pi \frac{dx}{2+2\sin x+\cos x}=\log3$$
I don't have any ideas, the $f(\pi-x)$ thing doesn't work as well. Please help :)
 A: $$
\begin{aligned}
&\int_0^\pi\frac{1}{2+2\sin x+\cos x}dx  
\\=& \int_0^\pi \frac{dx}{2[\cos^2(x/2)+\sin^2(x/2)]+4\cos(x/2)\sin(x/2) + \cos^2(x/2)-\sin^2(x/2)}\\
=&\int_0^\pi\frac{dx}{3\cos^2(x/2)+4\cos(x/2)\sin(x/2)+\sin^2(x/2)}\\
=&\int_0^\pi \frac{\sec^2(x/2)dx}{\tan^2(x/2)+4\tan(x/2)+3}\\
=&\int_0^\infty \frac{2du}{u^2+4u+3}
\end{aligned}
$$
A: Hint: I am sure this trick works: $t = \tan(\frac{x}{2})$
A: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
$\ds{\int_{0}^{\pi}{\dd x \over 2 + 2\sin\pars{x} + \cos\pars{x}} = \ln\pars{3}:
     \ {\large ?}}$.

\begin{align}&\color{#66f}{\large\int_{0}^{\pi}{\dd x \over 2 + 2\sin\pars{x} + \cos\pars{x}}}
=\int_{0}^{\pi}
{\sec\pars{x}\,\dd x \over 2\bracks{\sec\pars{x} + \tan\pars{x}} + 1}
\\[3mm]&=\ \overbrace{\int_{0}^{\pi}
{1 \over \sec\pars{x} + \tan\pars{x}}\,{\sec^{2}\pars{x} + \sec\pars{x}\tan\pars{x}\over
2\bracks{\sec\pars{x} + \tan\pars{x}} + 1}\,\dd x}
^{\color{#c00000}{\ds{\mbox{Set}\quad t \equiv \sec\pars{x} + \tan\pars{x}}}}\
=\ \int_{1}^{-1}{\dd t \over t\pars{2t + 1}}
\\[3mm]&=\int_{1}^{-1}\pars{{1 \over t} - {1 \over t + 1/2}}\,\dd t
=\left.\ln\pars{\verts{t \over t + 1/2}}\right\vert_{1}^{-1}
\\[3mm]&=\ln\pars{\verts{-1 \over -1 + 1/2}}
-\ln\pars{\verts{1 \over 1 + 1/2}}
=\ln\pars{2} - \ln\pars{2 \over 3} = \color{#66f}{\large\ln\pars{3}} 
\end{align}

It was implicit the splitting of the integral which leads to a principal value.
The logarithmic divergence in both sides of $\ds{t = 0}$  $\ds{\pars{~\mbox{or/and}\ x = \pi/2~}}$
cancels each other.
A: As suggested by 8 pi r, use Weierstrass substitution which, using $t = \tan(\frac{x}{2})$, gives $$\sin(x)=\frac{2t}{1+t^2}$$ $$\cos(x)=\frac{1-t^2}{1+t^2}$$ $$dx=\frac{2dt}{1+t^2}$$ Replace and simplify the integrand; you will directly arrive to tetori's last integral.
To finish, think about partial fraction decomposition and get two simple integrals.
