<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] I assume that the reason for the "paradox" was clarified already in comments, but possibly there is still a need to go a little bit deeper into details:
Your error has its root in the assumption:
$$
\arcsin(\sin x)=x.
$$
However the equality is valid only in the range $-\frac\pi2\le x\le \frac\pi2$ whereas the correct expression for all real $x$ is:
$$
\arcsin(\sin x)=(-1)^m\left(x-m\pi\right),\quad\text{with}\quad m=\left\lfloor\frac{x}\pi+\frac12\right\rfloor.\tag1
$$
In view of this the expression resulting from the substitution $x=\sin\vartheta$ reads:
$$\arcsin\left(\sin\left(\vartheta+\arcsin\frac{12}{13}\right)\right)=\begin{cases}
\frac\pi2-\arcsin\frac5{13}+\vartheta;& \vartheta\le \arcsin\frac{5}{13}\\
\frac\pi2+\arcsin\frac{5}{13}-\vartheta;& \vartheta\ge \arcsin\frac{5}{13}
\end{cases}
$$
or
$$
f(x)=\begin{cases}
\frac\pi2-\arcsin\frac5{13}+\arcsin x;& x\le\frac{5}{13}\\
\frac\pi2+\arcsin\frac{5}{13}-\arcsin x;& x\ge\frac{5}{13}.
\end{cases}
$$
Now it should be obvious that the derivative is discontinuous at $x=\frac5{13}$ taking the values
$$
f'(x)=\pm\frac1{\sqrt{1-x^2}},
$$
to the left and to the right from the point $x=\frac5{13}$. 
The same result will be obtained with the substitution $x=\cos\vartheta$ as well.
</s>