I have a rotation matrix $M$ (so I know that $M M^T = 1$). I retrieve the angles with the formulae: $$ \begin{array}{lll} \alpha & = & {\rm atan2}(M_{1 2}, M_{1 1}) \\ \beta & = & {\rm atan2}(- M_{1 3}, \sqrt{1 - M_{1 3}^2}) \\ \gamma & = & {\rm atan2}(M_{2 3}, M_{3 3}) \\ \end{array} $$
I have my three matrices $$R_x = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos(\gamma) & \sin( \gamma) \\ 0 & -\sin(\gamma) & \cos( \gamma) \end{bmatrix}$$
$$R_y = \begin{bmatrix} \cos(\beta) & 0 & -\sin(\beta) \\ 0 & 1 & 0 \\ \sin(\beta) & 0 & \cos(\beta) \end{bmatrix}$$ $$R_z = \begin{bmatrix} \cos(\alpha) & \sin(\alpha) & 0 \\ -\sin(\alpha) & \cos(\alpha) & 0 \\ 0 & 0 & 1 \end{bmatrix}$$
Now I want to prove that when $0 < \cos(\beta)$ we have
$$ M = R_x R_y R_z$$
I made it for the simple cases ($M_{1 1}$, $M_{1 2}$, $M_{1 3}$, $M_{2 3}$, $M_{3 3}$) but I am stuck on the remaining cases. For example, how can I prove that $$M_{2 1} = \cos(\alpha) \sin(\beta) \sin(\gamma) - \sin(\alpha) \cos(\gamma)$$
Solution
Ok after thinking over it is sufficient to multiply both sides by $\cos^2(\beta)$. This leads to $$M_{2 1} (1 - M_{1 3}^2) = - M_{1 1} M_{2 3} M_{1 3} - M_{1 2} M_{2 2}$$ which can easily be checked.