<s>[INST] Find derivative $\frac{dy}{dx}$, given $y(x)=\sin^{-1}\left(\frac{5\sin x+4\cos x}{\sqrt{41}}\right)$ 
Find $\dfrac{dy}{dx}$ if $y=\sin^{-1}\bigg[\dfrac{5\sin x+4\cos x}{\sqrt{41}}\bigg]$

My Attempt
Put $\cos\theta=5/\sqrt{41}\implies\sin\theta=4/\sqrt{41}$
$$
y=\sin^{-1}\big[\sin(x+\theta)\big]\implies\sin y=\sin(x+\theta)\\
y=n\pi+(-1)^n(x+\theta)\\
\boxed{\frac{dy}{dx}=(-1)^n}
$$
But my reference gives the solution $y'=1$, am I missing something here ?
 [/INST] Rewriting,
$$\sin y=\dfrac{5\sin x+4\cos x}{\sqrt{41}}=\sin(x+\theta)\tag 1$$
with $\theta=\tan^{-1}\frac4{5}$ and recognize $y\in[-\frac\pi2,\frac\pi2]$, hence $\cos y \ge 0$,
$$\cos y= \text{sgn}[\cos(x+\theta) ]\cos(x+\theta) $$
Take the derivative of (1),
$$\> y' = \dfrac{\cos(x+\theta)}{\cos y} 
= \dfrac{\cos(x+\theta)}{\text{sgn}[\cos(x+\theta) ]\cos(x+\theta)} \\
=\text{sgn}[\cos(x+\theta) ]=
\begin{cases}
1, & x+\theta -2k\pi \in \left(-\frac{\pi}2,\frac{\pi}2\right]\\
-1, & x+\theta -2k\pi\in \left(\frac{\pi}2,\frac{3\pi}2\right]
\end{cases}
$$
which, as seen in the graph below, alternates at either -1 or 1 depending on the value of $x$.

</s>