<s>[INST] 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!
 [/INST] $$
I:=\int \frac{\sqrt{1-x}}{\sqrt{x}} d x
$$
Since $0 <x<1$, therefore let $x=\sin ^{2}\theta$, then  $d x=2 \sin \theta \cos \theta d\theta.$
$$\begin{aligned}
I &=\int \frac{\sqrt{\cos ^{2} \theta}}{\sqrt{\sin ^{2} \theta}} \cdot 2 \sin \theta \cos \theta d \theta =\int 2 \cos ^{2} \theta d\theta =\int(1+\cos 2 \theta) d \theta \\&=\theta+\frac{\sin 2 \theta}{2}+C=\theta+\sin \theta \cos \theta +C =\boxed{\sin ^{-1} \sqrt{x}+\sqrt{x(1-x)}+C}\end{aligned}
$$
</s>