Rotation matrix help So I am doing some exercises in Susan Lea's book Mathematics for Physicists, currently question 7 chapter 1: 


*Find the matrix that represents the transformation obtained by (a) rotating about the x-axis by $45^\circ$ counterclockwise and then (b) rotating about the y'-axis by $30^\circ$ clockwise. 


This is the relevant part of the question. The first part I get the correct rotation matrix.  For the second part I get this rotation matrix: 
$\left[\begin{array}{2}cos(-30)&cos(90)&cos(60)\\cos(90)&cos(0)&cos(90)\\cos(-120)&cos(90)&cos(-30)\end{array}\right]$
which is equivalent to :
$\left[\begin{array}{2}\frac{\sqrt3}{2}&0&\frac{1}{2}\\0&1&0\\-\frac{1}{2}&0&\frac{\sqrt3}{2}\end{array}\right]$
Whereas the book's solution is:
$\left[\begin{array}{2}\frac{\sqrt3}{2}&0&-\frac{1}{2}\\0&1&0\\
\frac{1}{2}&0&\frac{\sqrt3}{2}\end{array}\right]$
I believe there may be something wrong in my understanding. I am using the formula for a rotation matrix:
$\mathbf A
_{ij}  = cos(\theta_{ij})$ 
where $\theta_{ij}$ is the angle between the ith new axis and jth axis in the original system.
Can someone explain where I went wrong if I did.
 A: Your matrix is the right one. The matrix given by Susan Lea is incorrect.
The matrix for the transformation of coordinates from an initial cartesian right-handed system of coordinates $\;Ox_1x_2x_3\;$ to another cartesian right-handed system of coordinates $\;Ox'_1x'_2x'_3\;$ rotated with respect to the first around a direction $\;\mathbf{n}=\left(n_1,n_2,n_3\right),\Vert\mathbf{n}\Vert=1, \;$ through an angle $\;\theta\;$ (positive if counterclockwise with respect to $\;\mathbf{n}$) 
 is(1)

\begin{equation}
\mathbb{A}\left(\mathbf{n}, \theta\right)=
\begin{bmatrix}
         \cos\theta+(1-\cos\theta)n_1^2&(1-\cos\theta)n_1n_2+\sin\theta n_3&(1-\cos\theta)n_1n_3-\sin\theta n_2 \vphantom{\dfrac12}\\
         (1-\cos\theta)n_2n_1-\sin\theta n_3&\cos\theta+(1-\cos\theta)n_2^2&(1-\cos\theta)n_2n_3+\sin\theta n_1\vphantom{\dfrac12}\\
         (1-\cos\theta)n_3n_1+\sin\theta n_2&(1-\cos\theta)n_3n_2-\sin\theta n_1&\cos\theta+(1-\cos\theta)n_3^2\vphantom{\dfrac12}
      \end{bmatrix}
\tag{01}\label{eq01}
\end{equation}

So, the transformation matrices around axes $\;x_1,x_2,x_3\;$ through angles $\;\theta_1,\theta_2,\theta_3\;$ respectively are 
\begin{align}
\mathbb{A}\left(x_1, \theta_1\right)& =
\begin{bmatrix}
         \hphantom{-}1 &       \hphantom{-}0        & 0 \vphantom{\dfrac12}\\
         \hphantom{-}0 & \hphantom{-}\cos\theta_1   & \sin\theta_1\vphantom{\dfrac12}\\
         \hphantom{-}0 & -\sin\theta_1  & \cos\theta_1\vphantom{\dfrac12}
      \end{bmatrix}
\tag{02.1}\label{eq02.1}\\
\mathbb{A}\left(x_2, \theta_2\right)& =
\begin{bmatrix}
         \cos\theta_2 & \hphantom{-}0   & -\sin\theta_2\vphantom{\dfrac12}\\
         0 &      \hphantom{-}1   & \hphantom{-}0 \vphantom{\dfrac12}\\
         \sin\theta_2 & \hphantom{-}0  & \hphantom{-}\cos\theta_2\vphantom{\dfrac12}
      \end{bmatrix}
\tag{02.2}\label{eq02.2}\\
\mathbb{A}\left(x_3, \theta_3\right)& =
\begin{bmatrix}
         \hphantom{-}\cos\theta_3  & \sin\theta_3  & 0 \hphantom{-} \vphantom{\dfrac12}\\
         -\sin\theta_3 & \cos\theta_3  &  0 \hphantom{-}\vphantom{\dfrac12}\\
         \hphantom{-}0 &       \hphantom{-}0        &  1\hphantom{-} \vphantom{\dfrac12}\\
      \end{bmatrix}
\tag{02.3}\label{eq02.3}
\end{align}
After a careful look in above equations we note that in the cases of rotation around $\;x_1,x_3\;$ [equations \eqref{eq02.1},\eqref{eq02.3}] the term $\;\boldsymbol{+}\sin\theta_\jmath\;$ is up-right while the term $\;\boldsymbol{-}\sin\theta_\jmath\;$ is bottom-left. But in the case of $\;x_2$, equation \eqref{eq02.2}, we have the inverse : the term $\;\boldsymbol{+}\sin\theta_3\;$ is bottom-left while the term $\;\boldsymbol{-}\sin\theta_3\;$ is up-right. In this difference lies the error in Susan Lea, see Figure below (page extracted from  $^{\prime}$Student Solutions Manual for Mathematics for Physicists$^{\prime}$ by Susan Lea)

The corrected matrix $\;\mathbb{A}_2\;$ must be
\begin{equation}
\mathbb{A}_2=
    \begin{pmatrix}
         \cos\left(-30^\circ\right) & \hphantom{-}0   & -\sin\left(-30^\circ\right)\vphantom{\dfrac12}\\
         0 &      \hphantom{-}1   & \hphantom{-}0 \vphantom{\dfrac12}\\
         \sin\left(-30^\circ\right) & \hphantom{-}0  & \hphantom{-}\cos\left(-30^\circ\right)\vphantom{\dfrac12}
    \end{pmatrix}
    =
    \begin{pmatrix}
          \hphantom{-}\frac{\sqrt{3}}{2} & \hphantom{-}0   &  \hphantom{-}\frac{1}{2}\vphantom{\dfrac12}\\
          \hphantom{-}0 &      \hphantom{-}1   & \hphantom{-}0 \vphantom{\dfrac12}\\
         -\frac{1}{2} & \hphantom{-}0  & \hphantom{-}\frac{\sqrt{3}}{2}\vphantom{\dfrac12}
    \end{pmatrix}
\tag{03}\label{eq03}
\end{equation}

(1)
For the matrix of equation \eqref{eq01} see equation (08) in my answer there : Rotation of a vector. But since this matrix of equation (08) therein concerns the rotation of a vector (active view) we replace  $\;\theta\;$ by $\;\boldsymbol{-}\theta\;$ to get the matrix \eqref{eq01} herein in order to have the transformation of coordinates (passive view).

