Issues on solving $\int^\frac{\pi}{2}_0\frac{\sqrt{\sin(x)}}{\sqrt{\sin(x)}+\sqrt{\cos(x)}}\,dx$ $$\int^\frac{\pi}{2}_0\frac{\sqrt{\sin(x)}}{\sqrt{\sin(x)}+\sqrt{\cos(x)}}\,dx$$ I was trying to solve this yesterday and did the following: divide num and den by $\sqrt{\sin x}$ $$\int^\frac{\pi}{2}_0\frac{1}{1+\sqrt{\cot(x)}}\,dx$$ I did the u-sub $u=\sqrt{\cot(x)}$ such that $du=\frac{-\csc^2(x)}{2\sqrt{\cot(x)}}\,dx$ $$-2\int^0_{+\infty}\frac{\sqrt{\cot x}}{(1+u)\csc^2x}\,du$$ flipping the bounds and using $\csc^2x=1+\cot^2x$ $$\int^{+\infty}_0\frac{u}{(1+u)(1+u^4)}\,du$$ then did partial fractions and according to wolfram alpha the partial fractions are correct: \begin{align} 2\left[\int^{+\infty}_0 \vphantom{\int^{+\infty} \frac{\frac12}{u^4}} \right. & \frac{-\frac12}{1+u}\,du+\int^{+\infty}_0\frac{\frac12 u^3}{1+u^4}\,du \\[8pt]
& \left. {} +\int^{+\infty}_0\frac{-\frac12 u^2}{1+u^4}\,du+\int^{+\infty}_0\frac{\frac12 u}{1+u^4}\,du+\int^{+\infty}_0\frac{\frac12}{1+u^4}\,du\right]\end{align} but I want to stop here since I don't think I've committed any mistakes but somehow the first 2 integrals do diverge? And the initial integral does converge so I don't know what have I done incorrectly (if I have)
 A: What you did is correct, except for a missing factor of $2$ in the integral.  It should be $$\int^{+\infty}_0\frac{2u}{(1+u)(1+u^4)}du$$
Before splitting the integrand into partial fractions, it would be well to factor the denominator into polynomials of degree at most $2$. $$u^4+1=(u^2+1)^2-2u^2=(u^2+\sqrt2u+1)(u^2-\sqrt2u+1)$$
Then there should be no trouble computing the indefinite integral, but I did it in WolframAlpha.  It's easy to see that the antiderivative goes to $0$ at $\infty$ and that the value at $0$ is $-\frac\pi4$.
EDIT
In response to OP's comment.
The issue of convergence of the individual integrals is irrelevant.  We want to compute $$
\lim_{x\to\infty}\int^{x}_0\frac{2u}{(1+u)(1+u^4)}du$$
If we look at the indefinite integral in WolframAlpha we see the terms $\log(1+x^4)$ and $-4\log(1+x)$.  Neither of these expressions has a limit at $\infty$ but
$$\lim_{x\to\infty}\log(1+x^4)-4\log(1+x)=\lim_{x\to\infty}\log\frac{1+x^4}{(1+x)^4}=0$$
A: \begin{align}
& \int^{\pi/2}_0\frac{\sqrt{\sin x}}{\sqrt{\sin x}+\sqrt{\cos x}}\,dx \\[12pt]
= {}& \int_{\pi/2}^0 \frac{\sqrt{\cos u}}{\sqrt{\cos u} +\sqrt{\sin u}} \, (-du) \\[8pt]
& u=\frac\pi2-x, \qquad du = -dx.
\end{align}
Therefore
$$
\int^{\pi/2}_0\frac{\sqrt{\sin x}}{\sqrt{\sin x}+\sqrt{\cos x}}\,dx = \int^{\pi/2}_0\frac{\sqrt{\cos x}}{\sqrt{\sin x}+\sqrt{\cos x}}\,dx
$$
and the sum of these two is $\displaystyle \int_0^{\pi/2} 1\,dx.$
