<s>[INST] Integral $\int \frac{\sqrt{\sin x}}{\sqrt{\sin x} + \sqrt{\cos x}} dx$ We have to evaluate the following integral:
$$\int \frac{\sqrt{\sin x}}{\sqrt{\sin x} + \sqrt{\cos x}} dx$$
I tried this:
I multiplied both the numerator and denominator by $\sec x$
And substituted $\tan x = t$.
But after that I got stuck.
The book where this is taken from gives the following as the answer: $$\ln(1+t)-\frac14\ln(1+t^4)+\frac1{2\sqrt2}\ln\frac{t^2-\sqrt2t+1}{t^2+\sqrt2t+1}-\frac12\tan^{-1}t^2+c$$ where $t=\sqrt{\cot x}$
 [/INST] $\displaystyle \mathcal{I} = \int\frac{\sqrt{\sin x}}{\sqrt{\sin x}+\sqrt{\cos x}}dx = \int \frac{\sqrt{\tan x}}{1+\sqrt{\tan x}}dx$
substitute $\tan x= t^2$ and $\displaystyle dx = \frac{1}{1+t^4}dt$
$\displaystyle \mathcal{I}= \int\frac{t}{(1+t)(1+t^4)}dt = \frac{1}{2}\int\frac{\bigg((1+t^4)+(1-t^4)\bigg)t}{(1+t)(1+t^4)}dt$ 
$\displaystyle = \frac{1}{2}\int\frac{t}{1+t}dt+\frac{1}{2}\int\frac{(t-t^2)(1+t^2)}{1+t^4}dt$
$\displaystyle = \frac{1}{2}\int \frac{(1+t)-1}{1+t}dt+\frac{1}{2}\int \frac{t+t^3-(t^2-1)-t^4-1}{1+t^4}dt$
$\displaystyle =-\frac{t}{2}+\frac{1}{2}\ln|t+1|+\frac{1}{4}\int\frac{2t}{1+t^4}+\frac{1}{2}\int\frac{t^3}{1+t^4}dt-\frac{1}{2}\int \frac{t^2-1}{1+t^4}dt-\frac{1}{2}t+\mathcal{C}$
all integrals are easy except $\displaystyle \mathcal{J} = \int\frac{t^2-1}{1+t^4}dt = \int\frac{1-t^{-2}}{\left(t+t^{-1}\right)^2-2}dt = \int\frac{(t-t^{-1})'}{(t-t^{-1})^2-2}dt$
</s>