<s>[INST] How to find the rational form of a $2\times 2$ rotation matrix  Given the matrix 
$$A = \begin{pmatrix}
\cos x  &  \sin x\\  -\sin x  & \ \cos x \end{pmatrix}$$
I have to express it in rational form 
The characteristic polynomial is  $y^2 - 2y\cos x+1 $
Accordingly, the rational form $R$ if $x$  is neither $0$ or $2 \pi$ is 
$$ R = \begin{pmatrix}
0 &  -1\\ 1 & \ 2 \cos x\end{pmatrix}$$
Please suggest if it is correct. 
If $x = 0$ or $2 \pi$, then Min poly of $A = x-1$. 
Then, it seems the rational form is 
$$ R = [1]$$
Please help. 
 [/INST] The characteristic polynomial of
$$\left(\begin{array}{rr}
\cos\theta & \sin\theta\\
-\sin\theta & \cos\theta
\end{array}\right)$$
is, as you note, $t^2 -2(\cos\theta)t + 1$.
The discriminant of this polynomial is
$$4(\cos^2\theta) - 4 = 4(\cos^2\theta - 1).$$
Therefore, the discriminant is always nonpositive, and is equal to zero if and only if $\cos^2\theta = 1$, if and only if $\theta = n\pi$ for some $n\in\mathbb{Z}$.
In particular, if $\theta\neq n\pi$ then the characteristic polynomial is irreducible over $\mathbb{Q}$, so the minimal polynomial agrees with the characteristic polynomial, and so the rational canonical form is just the companion matrix of the characteristic polynomial (just as you wrote):
$$\left(\begin{array}{rr}
0 & -1\\
1 & 2\cos\theta
\end{array}\right).$$
If $\theta=n\pi$, then $A$ is one of the following matrices:
$$\begin{align*}
A &= \left(\begin{array}{rr}
1 & 0\\
0 & 1
\end{array}\right) &\text{if }n\text{ is even,}\\
A &=\left(\begin{array}{rr}
-1 & 0\\
0 & -1
\end{array}\right) &\text{if }n\text{ is odd.}
\end{align*}$$
Both of these matrices are already in rational canonical form. 
(Your error: the minimal polynomial is indeed $t-\cos\theta$ in this situation; since the characteristic polynomial is then the square of the minimal polynomial, the rational canonical form will have two blocks, each associated to a degree 1 polynomial; not just a single block. Remember that the exponent of the irreducible factor on the minimal polynomial gives you the size of the largest block, in this case $1\times 1$; but the sum of the sizes of the blocks has to add up to the exponent of the irreducible factor in the characteristic polynomial, in this case $2$. So you need two $1\times 1$ blocks here. )
</s>