Question given in my book asks to find $\frac{dy}{dx} $ from the following equation.$$y=\cos^{-1}\left(\frac{3x+4\sqrt{1-x^2}}{5}\right)$$
My Attempt:
Starting with substitutions,
Putting $\frac35=\cos\alpha\implies \frac45 = \sin\alpha$.
Putting $x = \cos\beta\implies \sqrt{1-x^2} = \sin\beta$.
$$\begin{align}&y=\cos^{-1}\Big(\frac{3x+4\sqrt{1-x^2}}{5}\Big)\\ \implies& y = \cos^{-1}\Big(\frac{3}{5}x + \frac{4}{5}\sqrt{1-x^2}\Big)\\\implies& y = \cos^{-1}(\cos\alpha\cos\beta + \sin\alpha \sin \beta)\\\implies& y = \cos^{-1}[\cos(\alpha-\beta )] \tag{1}\\\implies& y = \alpha-\beta\\\implies& y = \cos^{-1}\left(\frac35\right) - \cos^{-1}(x)\\\implies&\color{blue}{\boxed{ \dfrac{dy}{dx} =\frac{1}{\sqrt{1-x^2}}}}.\end{align}$$
But, if I consider $(1.)$ again, $$y = \cos^{-1}\left[\cos\color{red}{(\alpha-\beta)}\right]$$
This is also equals to, $$\cos^{-1}\left[\cos\color{red}{(\beta - \alpha)}\right].$$differentiating this, will give the negative of the answer which I got earlier.
My book shows that $\frac{-1}{\sqrt{1-x^2}}$ is correct. But why?
I think the mistakes lie in the very first step of substitution i.e.,$\frac35=\cos\alpha$ doesn't imply $\frac45 = \sin\alpha$. It should be $\sin\alpha = \pm \frac45$.
Similary $x = \cos\beta$ doesn't imply $\sqrt{1-x^2} = \sin\beta$ instead $\sin\beta = \pm \sqrt{1-x^2}$.
But how can I make sure that in the equation $(1.)$, $(\alpha - \beta)$ lies in the principal branch of the inverse cosine function?

