# Matrix whose eigenvectors are Hermite polynomials

I first constructed a symmetric matrix as the Laplacian operator, and its eigenvectors are a series of harmonics functions as expected. I programmed it and convinced myself. The matrix looks like: $$\left(\begin{array}{ccc} 1& -1 & 0 & 0 & 0 \\ -1& 2 & -1 & 0 & 0 \\ 0& -1 & 2 & -1 & 0 \\ 0& 0 & -1 & 2 & -1 \\ 0& 0 & 0 & -1 & 1\end{array}\right)$$ multiplying this matrix with $\{x_0, x_1, x_2, x_3, x_4\}$ leads to $\{x_0-x_1, -x_0+2x_1-x_2,-x_1+2x_2-x_3,..\}$; The term $-x_{i-1}+2x_i-x_{i+1}$ is equivalent to the second order derivative (in the Laplacian) on a discrete 1-dimensional domain: $(x_i-x_{i-1})-(x_{i+1}-x_i)$.

Everything works fine until I try to construct the matrix for Hermite polynomials. Wiki says the operator is $$L[u]=u''-xu'=-\lambda u.\tag1$$ I think the matrix for the first derivative should be $$\left( \begin{array}{ccc} 1& -1 & 0 & 0 & 0 \\ 0& 1 & -1 & 0 & 0 \\ 0& 0 & 1 & -1 & 0 \\ 0& 0 & 0 & 1 & -1 \\ 0& 0 & 0 & 0 & 0\end{array}\right)$$ however, combining this new matrix with the Laplacian matrix (according to $(1)$) does not produce the expected eigenvectors.

Another source derives polynomial from the operator $$H=-\frac12\frac{d^2}{dx^2}+\frac12x^2,$$ but what are the matrix entries for $x^2$?

Any help? Thanks!