When we integrate certain integrals, such as
$$\int \frac{x^2}{\sqrt{16-x^2}} dx$$
We can make a substitution like $x = 4 \sin \theta$
Then we can simplify the above integral to the following: $$8 \theta - 8 \sin \theta \cos \theta + C$$
I then learned we can use a right angled triangle to find alternate expressions for $\frac{x}{4} = \sin \theta$ such as $\frac{\sqrt{16-x^2}}{4} = \cos \theta$ and substitute theta to find the answer $8 \arcsin \frac{x}{4} - \frac{x}{2} \sqrt{16-x^2} + C$
But clearly when I graph the two functions
$$y=\arcsin \left(\frac{x}{4}\right)$$
and
$$y=\arccos \left(\frac{\sqrt{16-x^2}}{4}\right)$$
They are only equal for $x \ge 0$ according to https://www.desmos.com/calculator
Whats going on here? Why does this work? Why can we make this equivalent triangle substitution when the functions clearly arent equal to each other on $x < 0$?