matrix with Eigenvalue 1,2,3 Can anyone tell me a $3\times3$ matrix that has eigenvalues $1,2,3$ ( or any matrix with integer eigenvalues)?
I need to show the classroom how to calculate eigenvectors using Gauss-Jordan method. So diagonal elements just won't do it.
Please help me.
 A: General recipe: start by choosing desired eigenvalues $\lambda_i$ and desired eigenvectors $v_i$ orthogonal to one another. Then form matrices
$$D=\begin{pmatrix}
\lambda_1 & 0 & 0 \\
0 & \lambda_2 & 0 \\
0 & 0 & \lambda_3
\end{pmatrix}
\qquad
V=\begin{pmatrix}
\vert & \vert & \vert \\
v_1 & v_2 & v_3 \\
\vert & \vert & \vert
\end{pmatrix}$$
Using these, you can compute $M=V\cdot D\cdot V^{-1}$ which will have the desired eigenvectors and eigenvalues.
If you want $M$ itself to be integral as well, use the adjugate matrix instead of the inverse: $ M = V\cdot D\cdot \operatorname{adj}(V) $. The resulting matrix will have integral eigenvalues, but not neccessarily the ones you specified but a common multiple thereof. The common factor is $\det(V)$.
I tend to tune my eigenvectors by playing around until I have $\det(V)=\pm 1$. At that point, $V^{-1}=\pm V^T$ will be integral as well, and I can rely on the given eigenvalues. But this playing around may take some time, so if any integral eigenvalues will do, using the adjugate will likely be faster.
A: For any $d_1, d_2, d_3$, the diagonal matrix
$$
D = 
\begin{bmatrix}
d_1 & 0 & 0 \\
0 & d_2 & 0 \\
0 & 0 & d_3
\end{bmatrix}
$$
has eigenvalues $d_1, d_2, d_3$.  If you take any invertible matrix $P$, then
$$
A = P D P^{-1}
$$
has the same eigenvalues as $D$, and the columns of $P$ are the corresponding eigenvectors.
A: Here it is$$\begin{pmatrix}5&2&-2\\2&5&-2\\-2&-2&5
\end{pmatrix}$$
and $$\begin{pmatrix}1&0&0\\0&2&-2\\1&0&3
\end{pmatrix}$$
A: $$
\begin{pmatrix}
1&0&0\\
0&2&0\\
0&0&3
\end{pmatrix}
$$
 This is a matrix with eigenvalues as required.
A: (this is for $3 \times 3$ matrix example, but this method easily generalizes) Pick any set of $3$ orthonormal vectors $u,v,w$ so $u^Tu=v^Tv=w^Tw=1$ whereas $u^Tv=0$, $u^Tw=0$, $v^Tw=0$. Pick your favorite eigenvalues $a,b,c$ and write
$$ A = auu^T+bvv^T+cww^T. $$
If your orthonormal basis has normalization by $\sqrt{3}$ then just pick an e-value which has $3$ as a factor and the pesky fractions vanish and you can easily verify $u,v,w$ are e-vectors with e-values $a,b,c$ respective. To make this method quick you probably want to pick a favorite orthonormal basis and calculate the rank one $uu^T$, $vv^T$ and $ww^T$ matrices carefully for repeated use. I should have done this years ago. Basically, we're just reverse-engineering the spectral theorem.
