(a) Prove that, for all $\theta, \varphi, \psi$,
$$
Q=\left(\begin{array}{ccc}
\cos \varphi \cos \psi-\cos \theta \sin \varphi \sin \psi & \sin \varphi \cos \psi+\cos \theta \cos \varphi \sin \psi & \sin \theta \sin \psi \\
-\cos \varphi \sin \psi-\cos \theta \sin \varphi \cos \psi & -\sin \varphi \sin \psi+\cos \theta \cos \varphi \cos \psi & \sin \theta \cos \psi \\
\sin \theta \sin \varphi & -\sin \theta \cos \varphi & \cos \theta
\end{array}\right)
$$
is a proper orthogonal matrix. (b) Write down a formula for $Q^{-1}$.
Remark. It can be shown that every proper orthogonal matrix can be parameterized in this manner; $\theta, \varphi, \psi$ are known as the Euler angles, and play an important role in applications in mechanics and geometry, $[31 ;$ p. 147].