# Find the eigenvalues and eigenvectors of the matrix with all diagonal elements as $d$ and rest $1$

A matrix has all elements 1 except the diagonal elements. It is an $n\times n$ matrix. What are the eigenvectors and eigenvalues ?

Solving book problems in Strang book and stuck on this one and I have no idea where to begin ?

-
Hint: try it for a $2x2$ amd $3x3$. Do you see a pattern that you can generalize and prove? –  Amzoti Feb 20 '13 at 19:48

Denote the matrix as $M$.
Let $J$ be the matrix with all entries $1$.
The matrix $J$ has rank $1$ therefore only one non zero eigenvalue which is $n$ with corresponding eigenvector $(1,1,\ldots,1)^T$ (what are the eigenvectors corresponding to the eigenvalue(s) $0$?).

Now note that $M=J+(d-1)I_n$ and that for any matrix $A\in\mathbb R^{n\times n}, \ x\in\mathbb R^n$ and $r\in\mathbb R$ if $Ax=\lambda x$ then $(A+rI_n)x=(\lambda+r)x$.

-
Nitpicking: $J$ has rank 1. –  karakfa Feb 20 '13 at 21:22
@karakfa: Thanks! –  P.. Feb 21 '13 at 5:37

An obvious eigenvector is $(1,\ldots,1)^T$ with eigenvalue $d+n-1$. Other almost as obvious eigenvectors are $(1,0,\ldots,0,-1,0,\ldots,0)^T$ with eigenvalue $d-1$. Since this gives $n$ linearly independant eigenvectors, we are done. (In fact, any vector orthogonal to $(1,\ldots,1)^T$ is an eigenvector with eigenvalue $d-1$).

-

Just use row reduction to get the matrix into row echelon form. The entries on the diagonal will be the eigenvalues. If you have to do this for the general case, you'll probably get something that looks like $\lambda_1 = a_{1,1}$, $\lambda_2 = a_{2,2,} - 1/a_{1,1}$, etc.. The eigenvectors should be easy to get from there.

-