The integral
$$\int\frac{dx}{\sqrt{4-x^2}}$$
I've found the variable
$$x=2\sin\theta$$
$$x^2=4\sin^2\theta$$
$$dx=2\cos\theta\,d\theta$$
Which gave me by substitution
$$\int\frac{2\cos\theta}{4-\sqrt{4\sin^2\theta}}\,d\theta$$ $$\int\frac{\cos\theta}{2-\sin\theta}\,d\theta$$ $$\frac{1}{2}\int \cos\theta \,d\theta-\int\frac{\cos\theta}{\sin\theta}\,d\theta$$ $$\frac{1}{2}\int \cos\theta \,d\theta-\int\cot\theta \,d\theta$$ $$= \frac{\sin\theta}{2}-\ln|\sin\theta| + C$$
Now if I look at the expected answer, it should be
$$\arcsin\left(\frac{x}{2}\right)+C$$
What am I missing ?
Your substitution is correct, but you should have $\sqrt{4-4\sin^2 \theta}$ in the denominator. You cannot break the square root as you have done. Moreover, $\frac{\cos\theta}{2-\sin\theta}$ is not the same as $\frac{1}{2}\cos\theta - \frac{\cos\theta}{\sin\theta}$. Try doing this with numbers; it won't work there, and it doesn't work here either.