How to derive this expression for the free scalar field in QFT? (Peskin & Schroeder) In the introductory text to quantum field theory by Peskin & Schroeder, they state that in analogy to the simple harmonic oscillator in quantum mechanics, the free scalar field can be expressed as:
$$\phi(\vec{x}) = \int \frac{d^3 p}{(2\pi)^3} \frac{1}{\sqrt{2 \omega_p}} \left( a_p e^{i \vec{p}\cdot\vec{x}} + a^{\dagger}_p e^{-i \vec{p}\cdot\vec{x}} \right) \tag{2.25}$$
In quantum mechanics $\phi$ would be written as:
$$\phi = \frac{1}{\sqrt{2 \omega_p}} \left( a + a^{\dagger} \right)$$
I can see the similarities between the two expressions, as well as the fact that one may expand the free Klein-Gordon field as:
$$\phi(\vec{x},t) = \int \frac{d^3 p}{(2\pi)^3} e^{i \vec{p}\cdot\vec{x}} \phi(\vec{p},t).\tag{2.20b} $$
However I don't get how to reach the final expression given above, especially the exponential with negative sign in the second term. It's probably just a small thing that I am not seeing, but I would be thankful if somebody could give me a hint.
 A: I'll adopt the abbreviation $kx:=k_0x^0-\mathbf{k}\cdot\mathbf{x}$.
The Klein-Gordon equation $(\square +m^2)\phi=0$ can be solved by a Fourier transform. Writing $\phi(x)=\int d^4ke^{-ikx}\tilde{\phi}(k)$ we get $(k^2-m^2)\tilde{\phi}(k)=0$, i.e. $\tilde{\phi}(k)=\tilde{\varphi}(k)\delta(k^2-m^2)$ for some function $\tilde{\varphi}(k)$. Using$$\delta(k^2-m^2)=\dfrac{\delta(k_0-\omega_\mathbf{k})+\delta(k_0+\omega_\mathbf{k})}{2\omega_\mathbf{k}}$$gives$$\phi(x)=\int\dfrac{d^3k}{(2\pi)^32\omega_\mathbf{k}}(a_+(k)e^{-ikx}+a_-^\ast(k)e^{ikx})$$with$$a_+(k):=(2pi)^3\tilde{\varphi}(\omega_\mathbf{k},\,\mathbf{k}),\,a_-(k):=(2pi)^3\tilde{\varphi}^\ast(-\omega_\mathbf{k},\,\mathbf{k}).$$For real $\phi$, $a_-=a_+^\dagger$, so defining $a:=a_+$ we're done. (You have an erroneous $\sqrt{}$ sign in the Lorentz-invariant integration operator.) Note in particular your $e^{i\mathbf{k}\cdot\mathbf{x}}$ coefficient of $a_k$ is $e^{i(k_0x^0-kx)}$, but I've absorbed the $e^{ik_0x^0}$ factor into my definition of $a_k$ to make the above result's Lorentz-invariance manifest.
