$\int^{\frac{\pi}{2}}_0 \frac{\sin x}{\sin x+\cos x+1}dx$ What results?
$$\int^{\frac{\pi}{2}}_0 \frac{\sin x}{\sin x+\cos x+1}dx$$
my try : $u= \tan \frac{x}{2 } $
but : What is the short way?
 A: Hint... You can write the integral as $$I=\int_0^\frac{\pi}{2} \frac{\sin\frac x2}{\sin\frac x2+\cos \frac x2} dx$$
Then consider $$J=\int_0^\frac{\pi}{2} \frac{\cos\frac x2}{\sin\frac x2+\cos \frac x2} dx$$
Now work out $J-I$ and $J+I$
A: \begin{eqnarray}
\sin x+\cos x+1 &=& 1+\sin x+\cos x \\
  &=& (\sin\frac{x}{2}+\cos\frac{x}{2})^2+(\cos^2\frac{x}{2}-\sin^2\frac{x}{2}) \\
  &=& (\sin\frac{x}{2}+\cos\frac{x}{2})2\cos\frac{x}{2}
\end{eqnarray}
We have by substitution $x=\dfrac{\pi}{2}-u$
\begin{eqnarray}
\int^{\frac{\pi}{2}}_0 \frac{\sin u}{\sin u+\cos u+1}du
&=&
\int^{\frac{\pi}{2}}_0 \frac{\cos x}{\sin x+\cos x+1}dx\\
&=&
\int^{\frac{\pi}{2}}_0 \frac{\cos^2\frac{x}{2}-\sin^2\frac{x}{2}}{(\sin\frac{x}{2}+\cos\frac{x}{2})2\cos\frac{x}{2}}dx\\
&=&
\frac12\int^{\frac{\pi}{2}}_0 \frac{(\cos\frac{x}{2}-\sin\frac{x}{2})}{\cos\frac{x}{2}}dx\\
&=&
\frac12\int^{\frac{\pi}{2}}_0 1-\tan\frac{x}{2}dx\\
&=&
\frac{\pi}{4}+\ln\cos\frac{x}{2}\Big|_0^\frac{\pi}{2}\\
&=&
\color{blue}{\frac{\pi}{4}-\frac12\ln2}
\end{eqnarray}
