Triangulation of matrices Suppose that $A$ is some triangularizable matrix in $M_n(\mathbb R)$. The usual approach I know of to find a triangular matrix similar to it is to find bases for all the eigenspaces, then find their union. If the union does not form a basis of $\mathbb R^n$, then we would add some extra elements from the canonical basis of $\mathbb R^n$ to that union to form a basis of $\mathbb R^n$. Afterwards, we would consider the transition matrix from the canonical basis to that new basis, etc. Now according to the choice of the extra elements, and according to the order of the elements, we would get a different triangular matrix each time. If one is asked to find a certain triangular matrix which $A$ is similar to it, how can one know beforehand the particular choices which will yield that matrix?
For instance, if the eigenvalues of a $A$ are $1,2,3$ each with multiplicity two, how can I find the triangular matrix that has these eigenvalues organized on the diagonal as: $1, 3, 2, 2, 3, 1$, without having to perform trial-error attempts?
Thank you.
 A: To expand on Stanislav's comment : in your example, you will get 
a Jordan Normal form as follows :
$$
J=\left(
\begin{array}{cccccc}
1 & a & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 2 & b & 0 & 0 \\
0 & 0 & 0 & 2 & 0 & 0 \\
0 & 0 & 0 & 0 & 3 & c \\
0 & 0 & 0 & 0 & 0 & 3 \\
\end{array}
\right)
$$
So this gives you a basis $(e_1,e_2,\ldots,e_6)$ such that
$fe_1=e_1,fe_2=e_2+ae_1,fe_3=2e_3,fe_4=2e_4+e_3$ etc.
Then, to have $1,3,2,2,3,1$ on your diagonal, consider the
basis $(e_1,e_5,e_3,e_4,e_6,e_2)$. 
A: Finding the eigenvectors is a good first step.
If you have too few eigenvectors (i.e., the algebraic multiplicity of at least one eigenvalue is strictly greater than its geometric multiplicity), a good thing to do is to look for generalized eigenvectors.
Let's say your matrix is $A$ and you have one of $A$'s eigenvalues $\lambda$ with algebraic multiplicity $n$ and geometric multiplicity $m < n$, with the corresponding eigenvectors $v_1, \dots, v_m$. You want to fill this out with generalized eigenvectors $w_1, \dots w_l$ so that $m + l = n$.
You do this by picking an eigenvector $v_k$ and solving the equation
$$(A-\lambda I)w = v_k$$
the vector $w$ will, if it exists, then satisfy
$$Aw = Aw - \lambda w + \lambda w = (A - \lambda I) w + \lambda w = v_k + \lambda w$$
making it a good choice for a basis for triangulation.
Once you have found a generalized eigenvector $w$, you might have to find another generalized eigenvector $w'$ satisfying
$$(A - \lambda I)w' = w$$
or you might have to restart with another (non-generalized) eigenvector $v_k$.
A certain eigenvector $v_k$ gives rise to a chain of generalized eigenvectors $v_k, w_1, w_2, \dots, w_{r-1}$ satisfying
$$(A-\lambda I)w_i = w_{i-1}$$
$$(A-\lambda I)w_1 = v_k$$
$$(A-\lambda I)v_k = 0$$
and will correspond to an $r \times r$ block in the triangular matrix having the shape
$$\begin{pmatrix}
\lambda & 1 \\
& \lambda & 1 \\
& & \ddots & \ddots \\
& & & \lambda & 1
\end{pmatrix}$$
but note that the chain might only contain one vector, $v_k$. But there will always be enough generalized eigenvectors to an eigenvalue $\lambda$ so that you can fill out to a basis.
This is basically how the basis for changing to Jordan normal form is computed.
