<s>[INST] (Different) derivatives of $f(x) = \arcsin\left(\left(5 x + 12 \sqrt{1-x^2}\right)/13\right)$ via two different substitutions? We have been given a function to differentiate:

$$f(x) =  \arcsin \left(\frac{5x + 12\sqrt{1-x^2}}{13}\right)$$

My teacher told me the method to substitute $ x= \sin\vartheta$ which would simplify the argument of $\arcsin$ to $$\frac{5}{13}\sin \vartheta + \frac{12}{13}\cos \vartheta $$ and further into $\sin(\vartheta + \alpha)$ where $ \alpha =  \arctan\left(\frac{12}{5}\right)$ therefore the function gets reduced into $f(x) =  \arctan\left(\frac{12}{5}\right) + \arcsin(x)$ giving $$f'(x) =  \frac{1}{\sqrt{1-x^2}}$$. However when I substitute $x = \cos\vartheta $, the argument reduces to : $$\frac{5}{13}\cos\vartheta + \frac{12}{13}\sin\vartheta$$ and further into $\sin(\alpha + \vartheta)$ where $\alpha =  \arctan\left(\frac{5}{12}\right)$ but this time the function gets reduced to $$f(x) =  \arctan\left(\frac{5}{12}\right) + \arccos(x)$$
thus $$f'(x) =  \frac{-1}{\sqrt{1-x^2}}$$ Hence we obtain two different derivatives for the same function and I cannot understand why. I tried plotting the argument and different simplification and got that they are not always equal but cannot figure out the reason.
 [/INST] HINT.-$(5,12,13)$ is  a Pythagorean triple so what is the relation between $\arctan\left(\frac{12}{5}\right)$ and $\arctan\left(\frac{5}{12}\right)$?
</s>