For which $a$ and $b$ is this matrix diagonalizable? For which $a$ and $b$ is this matrix diagonalizable?
$$A=\begin{pmatrix} a & 0 & b \\ 0 & b & 0 \\ b & 0 & a  \end{pmatrix}$$
How to get those $a$ and $b$? I calculated eigenvalues and eigenvectors, but don't know what to do next?
 A: That is a symmetric matrix: it is always diagonalizable over a field with characteristic$\;\neq2\;$. Not only that: it is orthogonally diagonalizable.
A: Calculating the eigenvalues, $b, b+a, a-b,$ one can then easily calculate their respective eigenvectors.  For eigenvalue $b,$
\begin{equation}
\begin{pmatrix} a-b&0&b\\0&0&0\\b&0&a-b \end{pmatrix}\begin{pmatrix} 0\\1\\0\end{pmatrix} = \begin{pmatrix} 0\\0\\0\end{pmatrix},
\end{equation}
There may be special cases, such as if $a = 0,$ then the vector $\begin{pmatrix} 1\\0\\1\end{pmatrix}$ works too.
Likewise for $a+b,$
\begin{equation}
\begin{pmatrix} -b&0&b\\0&-a&0\\b&0&-b \end{pmatrix}\begin{pmatrix} 1\\0\\1\end{pmatrix} = \begin{pmatrix} 0\\0\\0\end{pmatrix},
\end{equation}
And last for $a-b,$
\begin{equation}
\begin{pmatrix} b&0&b\\0&2b-a&0\\b&0&b \end{pmatrix}\begin{pmatrix} 1\\0\\-1\end{pmatrix} = \begin{pmatrix} 0\\0\\0\end{pmatrix}.
\end{equation}
Because no assumptions about the values of $a$ and $b$ were made along the way, this operator must be diagonalizable (which we already knew from symmetry), with an eigenbasis \begin{equation} \begin{pmatrix} 0\\1\\0\end{pmatrix}, \begin{pmatrix} 1\\0\\-1\end{pmatrix}, 
\text{ and } 
\begin{pmatrix} 1\\0\\1\end{pmatrix}\end{equation}

Note that if one remembers that matrices of the form $\begin{pmatrix} a & b\\ b& a \end{pmatrix} $ have the eigenbasis $\begin{pmatrix} 1 & 1\\ 1& -1 \end{pmatrix},$
then from a quick glance at the original matrix, you can already "know" the eigenvectors since this $2 \times 2$ is hidden within it.
A: Matrix A has 3 eigenvalues a-b, a+b and b. In order for them to be distinguishable, following conditions should be met. $$b \ne 0$$ $$a \ne 0$$ $$a \ne 2b$$
