I calculated correlation function $C(t)=\langle x(t)x(0)\rangle$ for ground state of Simple Harmonic Oscillator (SHO) in two different methods. But the results do not match.
First Attempt:
From Heisenberg equations of motion, $$\mathbf{X}(t)=\mathbf{X}(0)\cos(\omega t)+\frac{\mathbf{P}(0)}{m \omega} \sin(\omega t)$$
So, calculated the required terms,
$$\langle 0|\mathbf{X}^2(0)|0\rangle =\frac{\hbar}{2 m \omega}$$ and
$$\langle 0| \mathbf{P}(0) \mathbf{X}(0) |0\rangle =-~\frac{i \hbar}{2} $$
Using the above two terms and the equation of $\mathbf{X}(t)$ I obtain, $$\langle 0| \mathbf{X}(t)\mathbf{X}(0)|0\rangle =\frac{\hbar}{2 m \omega} \exp(-~i\omega t)$$
This is the required correlation function.
Second Method:
I attempted to solve it using explicit ground state wave function in position basis. In this case, I obtain,
$$\int \psi_0^*(x)\ x^2 \psi_0(x)~ \mathrm{d}x =\frac{\hbar}{2m \omega},$$ which is similar to the first calculation.
Again,
$$\int \psi_0^*(x)\ x (-~i \hbar)\frac{\partial}{\partial x} \psi_0 ~\mathrm{d}x=0,$$ which DOES NOT match with the first method.
And hence, using expression for $X(t)$ like the first method I obtained,
$$\langle X(t)X(0)\rangle =\frac{\hbar}{2m \omega} \cos (\omega t)$$
So method 1 and method 2 does not match. But are not they supposed to match up? I can not figure out where I am making mistake. Any help figuring out the mistakes will be very much appreciated.