Harmonic oscillator identity : show $ \sum_{k = 0}^{n-1} \phi_k(x)^2 = \phi_n'(x)^2 + (n - \frac{x^2}{4})\phi_n(x)^2 $ I am reading about Hermite polynomials in a math textbook and I am sure they are working too hard.
Let $H = p^2 + x^2$ be the quantum mechanical harmonic oscillator.  Or perhaps $H = \frac{1}{2m}p^2 + \frac{1}{2} m \omega^2 x^2$
Let $n$ be the eigenstates so that $H|n \rangle = (n + \frac{1}{2})|n \rangle$ and let $\phi_n(x) = \langle n | x \rangle$. Then I found the identities:
$$ \sum_{k = 0}^{n-1} \phi_k(x)^2 = \phi_n'(x)^2 + (n - \frac{x^2}{4})\phi_n(x)^2 
\neq \color{#999999}{ \langle \phi_n | \frac{d}{dx} \frac{d}{dx} | \phi_n \rangle 
+ \langle \phi_n |  (n - \frac{x^2}{4}) | \phi_n \rangle }$$
The identity looked a bit mysterious, but then I tried doing it in Bra-ket notation:
$$ \sum_{k = 0}^{n-1} \big\langle x \big| k \big\rangle \big\langle k \big| x \big\rangle = 
|\big\langle x \big| p \big| n \big\rangle|^2 
+  (n - \frac{x^2}{4})|\big\langle x \big| n \big\rangle|^2 \neq  \color{#999999}{\Big\langle n \Big| \Big(\underbrace{\frac{d^2}{dx^2} - \frac{x^2}{4}}_{p^2} +n\Big) \Big| n \Big\rangle }\tag{$\ast$}$$
I am totally botching the normalization here... can someone help me prove the identity $*$?

I got something, although coefficients differ. It may be just a matter of definitions, but correct me if I got any bungled. 
You need two things:

  
*
  
*The index raising and lowering identities for the $\phi_n$-s in position representation:
  $$
\begin{eqnarray}
\frac{1}{\sqrt{2}}\left(\sqrt{\frac{m\omega}{\hbar}}x + \sqrt{\frac{\hbar}{m\omega}} \frac{d}{dx} \right)\phi_n(x) &=& \sqrt{n}\;\phi_{n - 1}(x)\\
\frac{1}{\sqrt{2}}\left(\sqrt{\frac{m\omega}{\hbar}}x - \sqrt{\frac{\hbar}{m\omega}} \frac{d}{dx} \right)\phi_n(x) &=& \sqrt{n + 1}\;\phi_{n + 1}(x)
\end{eqnarray}
$$
  

Take into account the scaling of the $\phi_n$-s, 
$$
\phi_n(x) \equiv \phi_n(\xi) = \frac{a}{\sqrt{2^n n!}}e^{-\frac{1}{2}\xi^2}H_n(\xi),\;\;\;\text{for}\;\; a = \left(\frac{m\omega}{\pi\hbar}\right)^{1/4},\;\;\;\xi = \sqrt{\frac{m\omega}{\hbar}}x 
$$
and rewrite the identities in compact form,
$$
\begin{eqnarray}
\frac{1}{\sqrt{2}}\left(\xi \phi_n + \frac{d\phi_n }{d\xi}\right)&=& \sqrt{n}\;\phi_{n - 1}\\
\frac{1}{\sqrt{2}}\left(\xi \phi_n - \frac{d\phi_n }{d\xi}\right)&=& \sqrt{n + 1}\;\phi_{n + 1}
\end{eqnarray}
$$
If we multiply them side by side we get
$$
\frac{1}{2}\left(\xi^2\phi_n^2(\xi) - \left( \frac{d\phi_n }{d\xi}\right)^2 \right) = \sqrt{n(n+1)}\phi_{n-1}\phi_{n+1}
$$


  
*Turán's identity for Hermite polynomials:
  $$
H_n^2(\xi) - H_{n-1}(\xi)H_{n+1}(\xi) = (n-1)!\sum_{k=0}^{n-1}{\frac{2^{n-k}}{k!}H_k^2(\xi)}
$$
  

Multiply both sides by $\frac{a^2 e^{-\xi^2}}{2^n(n-1)!}$ and rearrange to get the corresponding identity in the $\phi_n$-s:
$$
n\left(\frac{ae^{-\xi^2/2}H_n(\xi)}{\sqrt{2^n n!}}\right)^2 - \sqrt{n(n+1)} \left(\frac{ae^{-\xi^2/2}H_{n-1}(\xi)}{\sqrt{2^{n-1}(n-1)!}}\right)\left(\frac{ae^{-\xi^2/2}H_{n+1}(\xi)}{\sqrt{2^{n+1}(n+1)!}}\right) = \sum_{k=0}^{n-1}{\left(\frac{ae^{-\xi^2/2}H_k}{\sqrt{2^k k!}}\right)^2}
$$
$$
\Rightarrow \;\; n\phi_n^2 -\sqrt{n(n+1)}\phi_{n-1}\phi_{n+1} = \sum_{k=0}^{n-1}{\phi_k^2}
$$
Now substitute the expression for $\sqrt{n(n+1)}\phi_{n-1}\phi_{n+1}$ obtained from the lowering and raising identities and obtain
$$
\sum_{k=0}^{n-1}{\phi_k^2} = \frac{1}{2}\left( \frac{d\phi_n }{d\xi}\right)^2 + \left(n - \frac{\xi^2}{2} \right) \phi_n^2 
$$
Revert the scaling if needed.
