<s>[INST] Why do we take the positive square root only from $\sqrt{a^2-x^2}$ when integrating using trig substitutions? $$\int\frac{\mathrm dx}{x^2 \sqrt{16-x^2}}$$
when substituting $\,x=4\sin\theta ,\;\mathrm dx=4\cos\theta\, \mathrm d\theta,\,$ it becomes
$$\int\frac{4\cos\theta\, \mathrm d\theta}{4^2\sin^2\theta\sqrt{16-4^2\sin^2\theta}}$$
then
$$\frac{1}{4}\int\frac{\cos\theta \,\mathrm d\theta}{\sin^2\theta\times4\sqrt{1-\sin^2\theta}}$$
The question is why did we take the positive root of 16 and took it out? as $\sqrt{16} \;is \pm 4 $
 [/INST] With $x=4\sin\theta$ your integral becomes $\int\frac{4\cos\theta d\theta}{64\sin^2\theta|\cos\theta|}=\frac{1}{16}\int\frac{\operatorname{sgn}(\cos\theta)d\theta}{\sin^2\theta}$ with $\operatorname{sgn}y:=\frac{y}{|y|}$. Luckily, choosing $\theta$ to obtain $\sin\theta=\frac{x}{4}$ lets us arbitrarily choose whether $\cos\theta$ is $\sqrt{1-\frac{x^2}{16}}$ or $-\sqrt{1-\frac{x^2}{16}}$, so we can choose a constant $\operatorname{sgn}(\cos\theta)$ factor. Since $\sqrt{16-x^2}$ is real only if $|x|\le4$, the most convenient choice is $\theta=\arcsin\frac{x}{4}\in\left[-\frac{\pi}{2},\,\frac{\pi}{2}\right]$ so, on this half-period of $\theta$, $\theta$ is a monotonic function of $x$ with $\cos\theta\ge0$.
</s>