How to solve $\int\frac{dx}{\sqrt{4-x^2}}$ with trigonometric substitution? 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 ?
 A: Substitution of $x=2\sin\theta$ implies that $\sqrt{4-x^2}=\sqrt{4-4\sin^2\theta}=2\cos\theta$.  Then,
$$\int \frac{dx}{\sqrt{4-x^2}}=\int \frac{\cos\theta d\theta}{\cos\theta}=\theta+C$$
where $C$ is a constant of integration.  But, $\theta=\arcsin\left(\frac{x}{2}\right)$.  So,
$$\int \frac{dx}{\sqrt{4-x^2}}=\arcsin\left(\frac{x}{2}\right)+C$$
A: 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.
A: Your big mistake is that you apparently thought that $\sqrt{4-4\sin^2\theta}$ is the same as $4-\sqrt{4\sin^2\theta}$.  Nothing is correct after that.
A: Do you need to use trigonometric substitution? Because you can solve it easier using regular substitution. First:
$$\int{\frac{dx}{\sqrt{4(1-\frac{x^2}{4})}}}=\frac{1}{2}\int{\frac{dx}{\sqrt{1-(\frac{x}{2})^2}}}$$
We use substitution $\frac{x}{2}=t ; \frac{dx}{2}=dt$.
Now we have:
$$\int{\frac{dt}{\sqrt{1-t^2}}}=arcsint=arcsin\frac{x}{2}+c$$
