<s>[INST] Finding eigenpairs of matrix A How do you find the eigenpairs of this? 

Given two matrices $A=\begin{bmatrix} a& b\\b&-a\end{bmatrix}$ and $B=\begin{bmatrix} a& -b\\b&a\end{bmatrix}$ where $b \neq 0$, find all eigenpairs of $A$ and $B$, and comment if the matrices are diagonalizable or not.

I plugged in the characteristic equation $\det(A-\lambda I)=0$ and is unable to solve for $\lambda $. I got $\lambda ^2-a^2-b^2=0$ and it won't let me factorize. Any idea?
 [/INST] The characteristic polynomial of
\begin{bmatrix} a & b \\ b & -a \end{bmatrix}
is indeed $\lambda^2-a^2-b^2$. The eigenvalues are $\sqrt{a^2+b^2}$ and $-\sqrt{a^2+b^2}$.
Since
$$A-\sqrt{a^2+b^2}\,I=
\begin{bmatrix}
a-\sqrt{a^2+b^2} & b \\
b & -a-\sqrt{a^2+b^2}
\end{bmatrix}
$$
has rank one, an eigenvector $\begin{bmatrix} x \\ y\end{bmatrix}$ satisfies
$$
\begin{bmatrix} a-\sqrt{a^2+b^2} & b \end{bmatrix}
\begin{bmatrix} x \\ y\end{bmatrix} = 0
$$
so we can take
$$
\begin{bmatrix} x \\ y\end{bmatrix}=
\begin{bmatrix} b \\ \sqrt{a^2+b^2}-a\end{bmatrix}
$$
and this is nonzero, so it is a basis for the eigenspace. The other eigenvectors are the non zero scalar multiples of this one.
Similarly for the other eigenvalue.
For the matrix
\begin{bmatrix} a & -b \\ b & a \end{bmatrix}
the characteristic polynomial is $\lambda^2-2a\lambda+(a^2+b^2)$, whose roots are
$a+ib$ and $a-ib$.
Assuming $a$ and $b$ real, the first matrix is diagonalizable, because it has distinct real eigenvalues. The second matrix is diagonalizable over the complex numbers, but not over the reals.
</s>