# Quantization of the Klein-Gordon equation, sign problem

In Peskin and Schroeder, they quantize the Klein-Gordon field in the following way. They write the Fourier transform of $$\phi(x,t)$$ $$\phi(x,t)=\int \frac{d^3 p}{(2\pi)^3}e^{ipx}\phi(p,t)$$ after that they say that the Klein-Gordon equation reduces to $$\left(\frac{\partial^2}{\partial t^2}+\omega_p\right)\phi(p,t)=0$$ We have an harmonic oscillator for each $$p$$. They recall how to quantize an harmonic oscillator saying that for the following Hamiltonian $$H=\frac{1}{2}p^2+\frac{1}{2}\omega^2 \phi^2$$ we have $$\phi=\frac{1}{\sqrt{2\omega}}(a+a^{\dagger})$$ and that we have therefore $$\phi(x)=\int \frac{d^3 p}{(2\pi)^3}\frac{1}{\sqrt{2\omega_p}}(a_p e^{ipx}+a_p ^\dagger e^{-ipx})\, .$$

What I don't understand is that we should have $$\phi(p)=\frac{1}{\sqrt{2\omega_p}}(a_p + a_p ^\dagger)$$ and then remplacing in the Fourier expansion $$\phi(x)=\int \frac{d^3 p}{(2\pi)^3}\frac{1}{\sqrt{2\omega_p}}(a_p+a_p ^\dagger)e^{ipx}$$ by this method if we are doing an analogy with a single harmonic oscillator. I understand that this can’t be correct but I don't see why, with this particular method we have this result. I understand that by solving the Klein-Gordon equation you get both types of plane wave but I’m having trouble understanding this particular method of quantizing the field.

To connect to the simple harmonic oscillator, note that the simplest Lorentz-invariant equation of motion a field can satisfy is
$$\square \phi = (\partial_t^2 - \vec \nabla^2) \phi = 0$$

Classical solutions are plane waves, e.g.
$$\phi (t, \vec x) = a_p (t) e^{i \vec p \cdot \vec x}$$
where
$$(\partial_t^2 + \vec p \cdot \vec p) a_p (t) = 0$$
which is the equation of motion of a harmonic oscillator,
but also
$$\phi^* (t, \vec x) = a_p^* (t) e^{-i \vec p \cdot \vec x}$$

A general solution is
$$\phi (t, \vec x) = \int \frac{d^3p}{(2 \pi)^3} [a_p (t) e^{i \vec p \cdot \vec x} + a_p^* (t) e^{-i \vec p \cdot \vec x}]$$
or explicitating $$a_p (t) = a_p e^{-i \omega_p t}$$
$$\phi (x) = \int \frac{d^3p}{(2 \pi)^3} (a_p e^{-i p x} + a_p^* e^{i p x})$$
where
$$\eta_{\mu \nu} = diag(1, -1, -1, -1)$$ metric tensor in Minkowski spacetime
$$p^\mu = (\omega_p, \vec p)$$
$$\omega_p = |\vec p|$$
$$x^\mu = (t, \vec x)$$