Evaluate $ \int^{\frac{\pi}{2}}_0 \frac{\sin x}{\sin x+\cos x}\,dx $ using substitution $t=\frac{\pi}{2}-x$ This problem is given on a sample test for my calculus two class. $$ \int^{\frac{\pi}{2}}_0 \frac{\sin x}{\sin x+\cos x}\,dx $$ I can find the value of this integral using other substitutions which lead to partial fractions but the prof added a hint to use the substitution $$t=\frac{\pi}{2}-x $$ so I've been trying to figure out how to do it his way but am pretty lost. Any ideas?
 A: Hint: Do the substitution, and stop.  You will get that our integral is equal to another integral over the same interval. Add them!
Symmetry solves problems. 
A: HINT: $\sin\left(\frac{\pi}2-x\right)=\cos x$, and $\cos\left(\frac{\pi}2-x\right)=\sin x$. Look at the sum of your original integral and the new one.
A: $I = \int_0^{\pi/2} \frac{\sin x}{\sin x+ \cos x}\mathrm{d}x$. On the other hand, with the substitution $t = \frac{\pi}{2} - x$, we obtain
\begin{align}
I & = \int_0^{\pi/2} \frac{\sin (\frac{\pi}{2}-t)}{\sin (\frac{\pi}{2}-t)+ \cos (\frac{\pi}{2}-t)}\mathrm{d}t \\
& = \int_0^{\pi/2} \frac{\cos t}{\sin t+ \cos t}\mathrm{d}t \\
& = \int_0^{\pi/2} \frac{\cos x}{\sin x+ \cos x}\mathrm{d}x \\
\end{align}
as $\sin(\frac{\pi}{2}-t) = \cos t$ and $\cos(\frac{\pi}{2}-t) = \sin t$. 
Adding the "original" form of $I$ and this new form, we have
\begin{align}
2I = \int_0^{\pi/2} \frac{\sin x + \cos x}{\sin x+ \cos x}\mathrm{d}x = \int_0^{\pi/2} \mathrm{d}x = \frac{\pi}{2},
\end{align}
from which we obtain $I = \frac{\pi}{4}$, and say to ourselves, "Hmm that is cool."
A: There is an easy way to solve. Let
$$ A=\int_0^{\frac{\pi}{2}}\frac{\sin x}{\sin x+\cos x}dx, B=\int_0^{\frac{\pi}{2}}\frac{\cos x}{\sin x+\cos x}dx. $$
Then
$$ A+B=\frac{\pi}{2} $$
and
$$ A-B=\int_0^{\frac{\pi}{2}}\frac{\sin x-\cos x}{\sin x+\cos x}dx=\int_0^{\frac{\pi}{2}}\frac{-d(\sin x+\cos x)}{\sin x+\cos x}=-\ln(\sin x+\cos x)\big|_0^{\frac{\pi}{2}}=0. $$
From this, we have
$$ A=B=\frac{\pi}{4}. $$
Generally, I can use this method to compute (for $a,b>0$)
$$ A=\int_0^{\frac{\pi}{2}}\frac{\sin x}{a\sin x+b\cos x}dx, B=\int_0^{\frac{\pi}{2}}\frac{\cos x}{a\sin x+b\cos x}dx. $$
It is easy to see
$$ aA+bB=\frac{\pi}{2} $$
and
\begin{eqnarray*}
aB-bA&=&\int_0^{\frac{\pi}{2}}\frac{-b\sin x+a\cos x}{a\sin x+b\cos x}dx\\
&=&\int_0^{\frac{\pi}{2}}\frac{d(a\sin x+b\cos x)}{a\sin x+a\cos x}\\
&=&\ln(a\sin x+b\cos x)\big|_0^{\frac{\pi}{2}}\\
&=&\ln a-\ln b.
\end{eqnarray*}
From this, we have
$$ A=\frac{a\pi-2b\ln\frac{a}{b}}{2(a^2+b^2)},B=\frac{b\pi+2a\ln\frac{a}{b}}{2(a^2+b^2)}. $$
