How do I compute the generalized eigenvectors for an eigenvalue with algebraic multiplicity 2? Consider the case in which I have the matrix:
$\begin{pmatrix}
-1 & 1\\ 
 0& -1
\end{pmatrix}$
which has as eigenvalue $\lambda=-1$, with algebraic multiplicity 2. I am trying to compute the eigenvectors as:
$(A-\lambda I)u=0$
and I find $u=\begin{pmatrix}
1\\ 
0
\end{pmatrix}$ . So it has geometric multiplicity 1.
Can someone please show me how to compute the generalized eigenvectors?

An eigenvector of $A$ with eigenvalue $\lambda$ is any (non-zero if your definition requires it) solution to $(A-\lambda I_n)\vec{x}=\vec{0}.$
Let's now consider if this is not the case, that is, if we have some $\vec\mu$ where  $(A-\lambda I_n)\vec{\mu}=\vec{x},$ then this would mean that the image of $\vec \mu$ under $(A-\lambda I_n)$ is an eigenvector of $A.$
So, to compute generalized eigenvectors you'll want to find solutions to $(A-\lambda I_n)^2 \vec{\mu} =\vec{0},$ for this $2\times 2$ matrix. Computing a basis for the solution space to the previous equation will yield a single non-zero vector, and you may use this to create a linearly independent set of generalized eigenvectors.
