Difficult integral with trigonometric substitution: $\int\frac{\sqrt{1-x}}{\sqrt x}dx$

This is the integral I am talking about

$$\int\frac{\sqrt{1-x}}{\sqrt x}dx$$

As you can tell I tried substitution $u = \sqrt x$, and from there I went to $u = \sin{\theta}$ like here.

$$\newcommand{\dd}{\; \mathrm{d}} \int \frac{\sqrt{1-x}}{\sqrt x} \dd x= \begin{vmatrix} u=\sqrt x \\ \dd u = \frac1{2\sqrt x}\end{vmatrix} = 2\int \sqrt{1-u^2} \dd u = \begin{vmatrix} u=\sin\theta \\ \theta = \arcsin u \\ \dd u = \cos\theta \dd\theta \end{vmatrix} = 2\int \sqrt{1-\sin^2\theta} \cos\theta \dd\theta = 2\int \cos^2\theta \dd\theta= 2\int \frac{1+\cos2\theta}2 \dd\theta = \int \dd\theta + \int\cos2\theta \dd\theta = \theta + \frac12 \sin2\theta + C = \arcsin u + \frac12 \sin(2\arcsin u) + C = \arcsin \sqrt x + \frac12 \sin(2\arcsin \sqrt x) + C$$

Anyways, you can see I entered this answer and was wrong and I have no idea why. I even tried to go back and substitute in cosine instead of sine since in this case they were equivalent and I still got the answer wrong, any help is appreciated thank you!

Consdering, just as you apparently did, $$I=\int \frac{\sqrt{1-x}}{\sqrt{x}}\,dx$$ First $$x=u^2\implies dx=2u\,du\implies I=2\int \sqrt{1-u^2}\,du$$ Second $$u=\sin(t)\implies du=\cos(t)\,dt \implies I=2\int \cos^2(t) dt=\int (1+\cos(2t))\,dt$$ $$I=t+\frac{1}{2} \sin (2 t)+C$$ Now, back to $x$ $$t=\sin^{-1}(u)=\sin^{-1}(\sqrt x) \implies I=\sin ^{-1}(\sqrt x)+\frac 12\sin ^{-1}\left(2\sin ^{-1}(\sqrt x)\right)+C$$ which could simplify to $$I=\sqrt{(1-x) x}+\sin ^{-1}\left(\sqrt{x}\right)+C$$
• @AleksandrDiamond It may help to write the integral as $t+\sin t\cos t+C$ before back-substitution. – Mike Feb 12 '17 at 9:29