Finding eigenvalues from a matrix that has constant a. Given the matrix $$A= \left[
\begin{array}{ccc}
  2&0&1\\
  1&1&a\\
  0&0&1
\end{array}
\right] $$
Find all the eigenvalues of A.
My approach:
$\det( λI-A) = 0 =$
$$
\begin{vmatrix}
  λ-2&0&-1\\
  -1&λ-1&-a\\
  0&-a&λ-1
\end{vmatrix}
$$
However, after solving it, $ λ^3 -4 λ^2+(5-a^2) λ+(2a^2-2-a)=0$. How do I proceed to solve it further to obtain my eigenvalues?
 A: Assuming the matrix is correct, 
 $$det(\lambda I-A)=
\begin{vmatrix}
  λ-2&0&-1\\
  -1&λ-1&-a\\
  0&0&λ-1
\end{vmatrix} =(\lambda-1)\begin{vmatrix}  λ-2&0\\
  -1&λ-1\end{vmatrix} =(\lambda-1)^2(\lambda-2)
$$ and so, eigenvalues are $\lambda=2$ simple, and $\lambda=1$ double.
A: A matrix is singular amongst other things if it has a zero row or column, or if two rows or columns are linearly dependent. Subtracting $\lambda$ from diagonal elements just changed the diagonal.
I can see that I can change the $1$ in the bottom row to a zero by a suitable choice of $\lambda$ and if the top left entry were $0$ the bottom row would be a multiple of the top one. So I can read two eigenvalues off straight away. Then the trace - the sum of the diagonal entries - is the sum of the eigenvalues.
Now either that solves the problem without doing the computations, or - if the computation is expected - it acts as a robust check on your arithmetic.

I have assumed that the matrix first given is right. One of the zeros in the bottom row will appear in any sub-product of the determinant which involves $a$ so you can tell that the determinant will be independent of $a$.
This is to encourage you to look at the matrix for clues (columns will do as well as rows) which will either act as a check on your computations or give you short-cuts.
A: You’ve made an error in computing the determinant: it should be $\lambda^3-4\lambda^2+5\lambda-2$. However, it’s not necessary to go through all of that for this particular matrix.  
A matrix and its transpose have the same eigenvalues, so we can examine the rows of the matrix. From the last row, we have the left eigenvector $(0,0,1)$ with eigenvalue $1$. If you add the first and third rows, you get $(2,0,2)$, but left-multiplying a matrix by $(1,0,1)$ performs this addition, so we have another eigenvector/eigenvalue pair: $(1,0,1)$ and $2$. The trace of a matrix is equal to the sum of its eigenvalues, so we can find the last eigenvalue “for free:” it’s $4-2-1=1$. With a bit of practice, you’ll be able to spot things like this.
A: Hint: 
$$
\left[
\begin{array}{ccc}
  2&0&1\\
  1&1&a\\
  0&0&1
\end{array}
\right]
=
P\left[
\begin{array}{ccc}
  2&1&1\\
  0&1&a\\
  0&0&1
\end{array}
\right] P^{-1}
$$
Where $P$ is a permutation matrix.
