Different ways of evaluating $\int_{0}^{\pi/2}\frac{\cos(x)}{\sin(x)+\cos(x)}dx$ My friend showed me this integral (and a neat way he evaluated it) and I am interested in seeing a few ways of evaluating it, especially if they are "often" used tricks. 
I can't quite recall his way, but it had something to do with an identity for phase shifting sine or cosine, like noting that $\cos(x+\pi/2)=-\sin(x)$ we get:
$$ I=\int_{0}^{\pi/2}\frac{\cos(x)}{\sin(x)+\cos(x)}dx=\int_{\pi/2}^{\pi}\frac{-\sin(x)}{-\sin(x)+\cos(x)}dx\\
$$
Except for as I have tried, my signs don't work out well. The end result was finding
$$ 2I=\int_{0}^{\pi/2}dx\Rightarrow I=\pi/4
$$
Any help is appreciated! Thanks. 
 A: $$\int_{0}^{a}{\frac{f(x)}{f(x)+f(a-x)}}dx=\frac{a}{2}$$
let $f(x)=\sin x$ and $a=\frac\pi2$
A: Let
\begin{equation}
I=\int_0^{\pi/2}\frac{\cos x}{\sin x+\cos x}\ dx
\end{equation}
and
\begin{equation}
J=\int_0^{\pi/2}\frac{\sin x}{\sin x+\cos x}\ dx
\end{equation}
then
\begin{equation}
I+J=\frac{\pi}{2}\tag1
\end{equation}
and
\begin{align}
I-J&=\int_0^{\pi/2}\frac{\cos x-\sin x}{\sin x+\cos x}\ dx\\[10pt]
&=\int_0^{\pi/2}\frac{1}{\sin x+\cos x}\ d(\sin x+\cos x)\\[10pt]
&=0\tag2
\end{align}
Hence, $$I=J=\frac\pi4$$by linear combinations $(1)$ and $(2)$.
A: Hint: Substitute $2i\sin(x)=e^{ix}-e^{-ix}$ and $2\cos(x)=e^{ix}+e^{-ix}$
$$ I=\int_{0}^{\pi/2}\frac{2\cos(x)}{2\sin(x)+2\cos(x)}dx=\int_{0}^{\pi/2}\frac{e^{ix}+e^{-ix}}{\frac{e^{ix}-e^{-ix}}{i}+e^{ix}+e^{-ix}}dx$$
Now substitute $u=e^{ix} \implies du = ie^{ix}dx=iudx$ 
$$ I=\int\frac{u+1/u}{\frac{u-1/u}{i}+u+1/u}\frac{du}{iu}$$

Alternative method:
$$ I=\int_{0}^{\pi/2}\frac{\cos(x)}{\sin(x)+\cos(x)}dx=\int_{0}^{\pi/2}\frac{1}{\tan(x)+1}dx$$
Substitute: $u=\tan(x) \implies du=(1+\tan^2(x))dx=(1+u^2)dx$ 
$$ I=\int\frac{1}{u+1}\frac{du}{1+u^2}$$
A: You're integrating on $[0, \pi/2]$ so replacing $x$ by $\pi/2 -x$ we see that $$I=\int_0^{\pi/2} \frac{\sin{x}}{\cos{x}+\sin{x}}dx.$$ Now sum this integral with the initial expression and notice that $2I=\pi/2$ hence...
