TITLE: Evaluate $ \int^{\frac{\pi}{2}}_0 \frac{\sin x}{\sin x+\cos x}\,dx $ using substitution $t=\frac{\pi}{2}-x$
QUESTION [4 upvotes]: 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?

REPLY [1 votes]: 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)}. $$
{"set_name": "stack_exchange", "score": 4, "question_id": 364923}