An $n \times n$ diagonal matrix $M$ and an $n \times n$ tridiagonal matrix $J$ are given. Suppose there is an orthogonal matrix $Q$ such that $Q^TJQ = M$. It has been said that
The eigenvectors of $J$ are the columns of $Q$
I am new to linear algebra and I can't understand why this statement is true. I would be appreciated if you explain this.
Update
The symmetric matrix $A$ and orthogonal matrix $Q$ are given as follow $$ A = \begin{pmatrix}1 & 2 & 2 \newline 2 & 1 & 2 \newline 2 & 2 & 1 \end{pmatrix} $$ $$ Q = \begin{pmatrix}-1/\sqrt 2 & -1/\sqrt 6 & 1/\sqrt 3 \newline 1/\sqrt 2 & -1/\sqrt 6 & 1/\sqrt 3 \newline 0 & \sqrt {2/3} & 1/\sqrt 3 \end{pmatrix} $$ The $Q^TAQ = $diag$(-1,-1,5) = M$. I expect the columns of $Q$ be the eigenvectors of $A$. The eigenvector matrix of $A$ is:
$$ E_{vec} = \begin{pmatrix}0.6206 & 0.5306 & 0.5774 \newline 0.1492 & -0.8027 & 0.5774 \newline -0.7698 & 0.2722 & 0.5774 \end{pmatrix} $$ and $Q$ in double format is $$ Q = \begin{pmatrix}-0.7071 & -0.4082 & 0.5774 \newline 0.7071 & -0.4082 & 0.5774 \newline 0 & 0.8165 & 0.5774 \end{pmatrix} $$
what is wrong here? the $E_{vec}$ and $Q$ must be the same while they are not
There are some unnecessary conditions, the statement is much more general. If $Q$ is orthogonal, then $Q^T=Q^{-1}$. So in fact $Q^{-1}JQ=M$ is a diagonal matrix.
The point is that given ANY $n\times n$ matrices $S, A, D$ such that $S$ is invertible and $D=S^{-1}AS$ is diagonal, then the eigenvectors of $A$ are the columns of $S$. To understand this, check out basis transformation: https://en.wikipedia.org/wiki/Change_of_basis