Computing $\langle0|T[Q(t_2)Q(t_1)]|0\rangle$ Given Hamiltonian $H=\frac{P^2}{2}+\frac{\omega^2}{2}Q^2$, compute $\langle0|T[Q(t_2)Q(t_1)]|0\rangle$, where $T$ is the time-ordering of the product, $|0\rangle$ is the ground state. Now set $\hbar=m=1$ and define
$$ Q(t)=e^{iHt}Qe^{-iHt} $$
and
$$Q|q\rangle=q|q\rangle $$
Apparently a hint to this question is that $H|n\rangle=\left(n+\frac{1}{2}\right)\omega |n\rangle$ and
$$Q=\frac{1}{\sqrt{2\omega}}(a+a^{\dagger})$$
Now I cannot see how to approach this question. The form $\langle0|T[Q(t_2)Q(t_1)]|0\rangle$ would suggest using the Feynman formula
$$\langle0|T[Q(t_2)Q(t_1)]|0\rangle=\frac{1}{Z}\int Dq \underline{q}(t_1)\underline{q}(t_2)e^{i\int_{\infty}^{\infty}dt L(\underline{q},\underline{\dot{q}})}$$
but this does correspond to the hint, nor can I see where to go with this.
What is the right approach to this question?
 A: No, the easy way to do this is to not use that formula -- which incidentally is part of a completely different formulation of quantum mechanics. The $q$s and $\dot{q}$s up inside the path integral are classical c-number valued paths, whose interference will give the quantum content in correlation functions. The problem you're being asked to solve seems to be aimed at teaching the canonical formalism, where observables are written in terms of creation and annihilation operators. The difference between the two perspectives is something that confused me quite a bit when I was first learning QFT. 
You have everything you need to answer the question already. Perhaps it will be easier if you initially calculate $\langle 0 | T[Q(0)(Q(0)]|0\rangle$: then you'll see quite clearly that writing $Q$ in terms of creation and annihilation operators makes the matrix element easy to compute.
Then in order to do the general case you need to deal with the time ordered product, which means you'll have to break up the expression in two "cases" -- that's perfectly fine -- or you can use Heaviside step functions. No matter what you choose to do, you'll have a Hamiltonian in the exponential, but the action of the Hamiltonian on number eigenstates is simple, and you'll be able to find the answer by direct computation.
