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}$

$$\displaystyle\int\frac{\sqrt{\sin x}dx}{\sqrt{\sin x}+\sqrt{\cos x}}\;=\;\int\frac{dx}{1+\sqrt{\cot x}},\\  
\displaystyle\cot x=z^{2} \;\;\Rightarrow\;\; -(1+z^{2})dx=2zdz,\\
\displaystyle\int\frac{dx}{1+\sqrt{\cot x}} \;=\; -\int\frac{2zdz}{(1+z^{2})(1+z)} \;=\; -2\int\frac{z(z-1)dz}{z^{4}-1}.\\
\displaystyle\frac{z}{z^{4}-1}\;=\;\frac{1}{2}\left( \frac{z}{z^{2}-1}-\frac{z}{z^{2}+1} \right),\\
\displaystyle\frac{z^{2}}{z^{4}-1}\;=\;\frac{1}{2}(\frac{1}{z^{2}-1}+\frac{1}{z^{2}+1}),\\
\displaystyle\frac{z^{2}-z}{z^{4}-1}=\frac{1}{2}(\frac{1-z}{z^{2}-1})+\frac{1}{2}(\frac{1}{z^{2}+1}+\frac{z}{z^{2}+1})=-\frac{1}{2(z+1)}+\frac{1}{2}(\frac{1}{z^{2}+1}+\frac{z}{z^{2}+1}).\\
\displaystyle-2\int\frac{z(z-1)dz}{z^{4}-1}\;=\;\ln\left| z+1 \right|-\arctan{z}-\ln\sqrt{z^{2}+1}+c,\\
\displaystyle\int\frac{\sqrt{\sin x}dx}{\sqrt{\sin x}+\sqrt{\cos x}}\;=\;\ln\left(\frac{\sqrt{\cot{x}}+1}{\sqrt{\cot{x}+1}} \right)-\arctan{\sqrt{\cot{x}}}+c.$$
