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 ?

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$$
