TITLE: Where does this trigonometric substitution go wrong?
QUESTION [8 upvotes]: $$I =\int\frac{1}{\sqrt{25-x^2}}dx$$

($\theta$ on left corner)
$$\tag 1 5\cos(\theta)=x$$
$$\tag 2 5\sin(\theta)=\sqrt{25-x^2}$$
$$\tag 1 -5\sin(\theta)\,d\theta=dx$$
$$I=\int\frac{1}{5\sin(\theta)} \cdot (-5) \sin(\theta) \, d\theta$$
$$I=\int-d\theta$$
$$\tag 1 \theta=\arccos(x/5)$$
$$I = -\arccos\left(\frac{x}{5}\right)+c$$
However, putting this integral into WA gives $\arcsin\left(\frac{x}{5}\right)+c$ and two are clearly not equivalent.

REPLY [6 votes]: It appears that $-\arccos \frac{x}{5} + C$ and $\arcsin \frac{x}{5} + C$ are the same collections of functions.  (Recall that an antiderivative is an infinite collection of functions differing only in vertical translation.  The "${}+C$" is to remind us that we have obtained a collection of functions.)
The plotted result is a consequence of the trigonometric reflection identity $\sin(\pi/2 - \theta) = \cos \theta$ in the form
$$  \sin(\theta - \pi/2) = -\cos \theta  $$so we see arcsine shifted $\pi/2$ units above minus arccosine.