Integral $\int \sqrt{\frac{x}{2-x}}dx$ $$\int \sqrt{\frac{x}{2-x}}dx$$
can be written as:
$$\int x^{\frac{1}{2}}(2-x)^{\frac{-1}{2}}dx.$$
there is a formula that says that if we have the integral of the following type:
$$\int x^m(a+bx^n)^p dx,$$ 
then:


*

*If $p \in \mathbb{Z}$ we simply use binomial expansion, otherwise:

*If $\frac{m+1}{n} \in \mathbb{Z}$ we use substitution $(a+bx^n)^p=t^s$
where $s$ is denominator of $p$;

*Finally, if $\frac{m+1}{n}+p \in \mathbb{Z}$ then we use substitution
$(a+bx^{-n})^p=t^s$ where $s$ is denominator of $p$.


If we look at this example:
$$\int x^{\frac{1}{2}}(2-x)^{\frac{-1}{2}}dx,$$
we can see that $m=\frac{1}{2}$, $n=1$, and $p=\frac{-1}{2}$ which means that we have to use third substitution since $\frac{m+1}{n}+p = \frac{3}{2}-\frac{1}{2}=1$ but when I use that substitution I get even more complicated integral with square root. But, when I tried second substitution I have this:
$$2-x=t^2 \Rightarrow 2-t^2=x \Rightarrow dx=-2tdt,$$ 
so when I implement this substitution I have:
$$\int \sqrt{2-t^2}\frac{1}{t}(-2tdt)=-2\int \sqrt{2-t^2}dt.$$
This means that we should do substitution once more, this time:
$$t=\sqrt{2}\sin y \Rightarrow y=\arcsin\frac{t}{\sqrt{2}} \Rightarrow dt=\sqrt{2}\cos ydy.$$
So now we have:
\begin{align*}
-2\int \sqrt{2-2\sin^2y}\sqrt{2}\cos ydy={}&-4\int\cos^2ydy = -4\int \frac{1+\cos2y}{2}dy={} \\
{}={}& -2\int dy -2\int \cos2ydy = -2y -\sin2y.
\end{align*}
Now, we have to return to variable $x$:
\begin{align*}
-2\arcsin\frac{t}{2} -2\sin y\cos y ={}& -2\arcsin\frac{t}{2} -2\frac{t}{\sqrt{2}}\sqrt\frac{2-t^2}{2}={} \\
{}={}&  -2\arcsin\frac{t}{2} -\sqrt{t^2(2-t^2)}.
\end{align*}
Now to $x$:
$$-2\arcsin\sqrt{\frac{2-x}{2}} - \sqrt{2x-x^2},$$
which would be just fine if I haven't checked the solution to this in workbook where the right answer is:
$$2\arcsin\sqrt\frac{x}{2} - \sqrt{2x-x^2},$$ 
and when I found the derivative of this, it turns out that the solution in workbook is correct, so I made a mistake and I don't know where, so I would appreciate some help, and I have a question, why the second substitution works better in this example despite the theorem i mentioned above which says that I should use third substitution for this example?

Let me try do derive that antiderivative. You computed:
$$f(x)=\underbrace{-2\arcsin\sqrt{\frac{2-x}{2}}}_{f_1(x)}\underbrace{-\sqrt{2x-x^2}}_{f_2(x)}.$$
The easiest term is clearly $f_2$:
$$f_2'(x)=-\frac{1}{2\sqrt{2x-x^2}}\frac{d}{dx}(2x-x^2)=\frac{x-1}{\sqrt{2x-x^2}}.$$
Now the messier term. Recall that $\frac{d}{dx}\arcsin x=\frac{1}{\sqrt{1-x^2}}$. So:
\begin{align*}
f_1'(x)={}&-2\frac{1}{\sqrt{1-\left(\sqrt{\frac{2-x}{2}}\right)^2}}\frac{d}{dx}\sqrt{\frac{2-x}{2}}=-2\frac{1}{\sqrt{1-\frac{2-x}{2}}}\cdot\frac{1}{\sqrt2}\frac{d}{dx}\sqrt{2-x}={} \\
{}={}&-2\sqrt{\frac2x}\cdot\frac{1}{\sqrt2}\cdot\frac{1}{2\sqrt{2-x}}\cdot(-1)=\frac{2}{\sqrt x}\frac{1}{2\sqrt{2-x}}=\frac{1}{\sqrt{2x-x^2}}.
\end{align*}
So:
$$f'(x)=f_1'(x)+f_2'(x)=\frac{x}{\sqrt{2x-x^2}}=\frac{x}{\sqrt x}\frac{1}{\sqrt{2-x}}=\frac{\sqrt x}{\sqrt{2-x}},$$
which is your integrand. So you were correct after all! Or at least got the correct result, but no matter how I try, I cannot find an error in your calculations.
As for the book's solution, take your $f$, and compose it with $g(x)=2-x$. You get the book's solution, right? Except for a sign. But then $g'(x)=-1$, so the book's solution is also correct: just a different change of variables, probably, though I cannot really guess which.
