Let $A\in \mathsf{GL}(4,\mathbb{R})$ be the following matrix:
$$A=\begin{pmatrix}\cos a&-\sin a&0&0\\ \sin a&\cos a&0&0\\0&0&\cos b&-\sin b\\0&0&\sin b&\cos b\end{pmatrix}$$
Assume that $A$ has finite order, i.e. $a$ and $b$ are rational multiples of $\pi$.
The problem is to give necessary conditions on the characteristic polynomial of $A$ to make it integer, i.e. $P_A(\lambda)\in\mathbb{Z}[\lambda]$
The characteristic polynomial is $P_A(\lambda)=\lambda^4-2\lambda^3(\cos a+\cos b)+\lambda^2(2+4\cos a\cos b)-2\lambda(\cos a+\cos b)+1$ (it is a symmetric polynomial).
Now we want that
\begin{cases}2(\cos a+\cos b)\in\mathbb{Z}\\4\cos a\cos b\in \mathbb{Z}\end{cases}
Question: In this case I've solved the system by hand and found the possible values of $a$ and $b$ but I wonder if there is a more efficient way to do this, or if there is some deeper theory involved, because I want to generalize to higher values (for example when there are three blocks, $a$, $b$, $c$ and so on). I see that in someway elementary symmetric polynomials appear but I don't know if this helps.
Any comment or suggestion will be appreciated!