Getting two different answers on differentiating $\cos^{-1}(\frac{3x+4\sqrt{1-x^2}}{5})$ 
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?

$\cos^{-1}(\cos x)$ needn’t  always be equal to $x$. See the graph below for $\cos^{-1}(\cos x)$ :

When $x < 0$ then $\cos^{-1}(\cos x) = -x$.
 Now if $x < 0.6$ then $\beta >\alpha$ because $\cos^{-1} x$ is a decreasing function in $[-1, 1]$. So ideally there should be two cases, $x <   0.6$ and $x > 0.6$. Also note that in your substitution, you are perfectly entitled to restrict the values of $\alpha$ to $(0,\frac{\pi}{2})$ so there is nothing wrong in taking $\sin x =0.8$.
 As you will notice, there is a discontinuity in the graph at $x= 0.6$: 
