Why can the Klein-Gordon field be Fourier expanded in terms of ladder operators? Using the plane wave ansatz
$$\phi(x) = e^{ik_\mu x^\mu}$$
the solution to the Klein-Gordon equation $(\Box + m^2) \phi(x) =0$ can be written as a sum of solutions, since the equation is linear and the superposition principle holds, as
$$\phi(x) = \sum_{{k}} \left( Ae^{ik_\mu x^\mu} + Be^{-ik_\mu x^\mu} \right).$$ 
How does one find the coefficients? More exactly, why does it turn out they are the annihilation and creation operators with the factor $1/\sqrt{2E}$?
The various books and sources I've checked just confused me even more. Peskin and Schroeder just plug in the integral equation (Fourier modes) by analogy with the harmonic oscillator solution. Schwartz gives a very strange reason that the energy factor is just for convenience. In Srednicki the author writes it as $f(k)$ without an explicit form. In Mandl and Shaw, they just state the equation without any justification. 
My best guess is that those come from the quantization process, but how does one do it in this case explicitly?  
 A: Let us start with the ansatz (I'll assume mostly plus metric signature)
\begin{equation}
  \hat\phi(x) = \int \frac{\mathrm{d}^3 \mathbf{k}}{(2\pi)^{3/2}}\left(\hat A_\mathbf{k} e^{i k\cdot x} + \hat B_\mathbf{k}e^{-ik\cdot x}\right)
\end{equation}
where $\hat A_\mathbf{k}$ and $\hat B_\mathbf{k}$ are some arbitrary operators and $k^0 = E_k$. We first note that $\phi$ is a real field which means that we must have $B_\mathbf{k} = A_\mathbf{k}^\dagger$. Also a quantum field must obey the equal time commutation relation
\begin{equation}
  \left[ \hat \phi(\mathbf{x},t),\hat{\dot\phi} (\mathbf{y},t)\right] = i\delta(\mathbf{x-y}).
\end{equation}
Plugging our ansatz into this relation we get the condition
\begin{equation}
  2E_k \left[\hat A_\mathbf{k}, \hat A_\mathbf{k'}^\dagger \right] = \delta(\mathbf{k-k'}) 
\end{equation}
This is just the ladder operator commutation relation with an extra normalization factor. For convenience we can define a rescaled operator $\hat a_\mathbf{k} \equiv \sqrt{2E_k}\hat A_\mathbf{k}$ which has the conventional commutation relation.
Detailed calculation
Taking the time derivative of the field we get
\begin{equation}
 \hat{\dot \phi}(x) = \int \frac{\mathrm{d}^3 \mathbf{k}}{(2\pi)^{3/2}}\left(-iE_k\hat A_\mathbf{k} e^{-i E_kt + i\mathbf{k\cdot x}} + iE_k\hat A_\mathbf{k}^\dagger e^{i E_kt - i\mathbf{k\cdot x}}\right).
\end{equation}
Then the commutator between the field and its time derivative (more generally its conjugate) is
\begin{eqnarray}
\left[ \hat \phi(\mathbf{x},t),\hat{\dot\phi} (\mathbf{y},t)\right] = \int \frac{\mathrm{d}^3 \mathbf{k}\mathrm{d}^3 \mathbf{k'}}{(2\pi)^{3}}\left\{iE_{k'}\left[\hat A_\mathbf{k},\hat A_\mathbf{k'}^\dagger\right] e^{-i(E_k-E_{k'})t+i(\mathbf{k\cdot x - k'\cdot y)}} + iE_k\left[\hat A_\mathbf{k'},\hat A_\mathbf{k}^\dagger\right] e^{i(E_k-E_{k'})t-i(\mathbf{k\cdot x - k'\cdot y)}}\right\} = \int \frac{\mathrm{d}^3 \mathbf{k}\mathrm{d}^3 \mathbf{k'}}{(2\pi)^{3}}\left\{iE_{k'}\left[\hat A_\mathbf{k},\hat A_\mathbf{k'}^\dagger\right] e^{-i(E_k-E_{k'})t} + iE_k\left[\hat A_\mathbf{-k'},\hat A_\mathbf{-k}^\dagger\right] e^{i(E_k-E_{k'})t}\right\}e^{i(\mathbf{k\cdot x - k'\cdot y)}}
\end{eqnarray}
where we have used the fact that operators commute with themselves and changed variables $\mathbf{k\rightarrow -k}$, $\mathbf{k'\rightarrow -k'}$ in the second term. This should be equal to the delta function
\begin{equation}
 i\delta(\mathbf{x-y}) = i \int \frac{\mathrm{d}^3 \mathbf{k}}{(2\pi)^3}e^{i\mathbf{k\cdot(x-y)}}  = i \int \frac{\mathrm{d}^3 \mathbf{k}\mathrm{d}^3 \mathbf{k'}}{(2\pi)^3}\delta(\mathbf{k-k'})e^{i(\mathbf{k\cdot x - k'\cdot y)}}
\end{equation}
which means we must have
\begin{equation}
 \left[\hat A_\mathbf{k},\hat A_\mathbf{k'}^\dagger\right] + \left[\hat A_\mathbf{-k'},\hat A_\mathbf{-k}^\dagger\right] = \frac{\delta(\mathbf{k-k'})}{E_k}
\end{equation}
to which $\left[\hat A_\mathbf{k},\hat A_\mathbf{k'}^\dagger\right]=\delta(\mathbf{k-k'})/2E_k$ is the solution. 
A: The action functional of the real scalar field is:
$$ \mathcal{A} = \frac{1}{2} \int\mathrm{d}^4 x \left(\partial_a \phi \partial^a \phi - m^2 \phi^2 \right) = \int \mathrm{d}t \int \frac{d^3 \mathbf{k}}{(2\pi)^3} \frac{1}{2}\left[ |\dot{q}_{\mathbf{k}}|^2 - \omega^2_{\mathbf k}|q_{\mathbf k}|^2 \right]$$
where the second equality refers to an infinite number of harmonic oscillators, related to the scalar field by a spatial Fourier transform:
$$ \phi(t,\mathbf x) = \int \frac{\mathrm{d}^{3}\mathbf{p}}{(2\pi)^3}\;q_{\mathbf{p}}(t)e^{i\mathbf{p}\cdot\mathbf{x}}$$
Note that we're operating in the Heisenberg picture, where only operators evolve in time and not states. The quantization problem of the field has now been reduced to quantization of harmonic oscillators.
Expressing the harmonic oscillator in terms of creation and annihilation operators, which is a different basis:
$$ q(t) = \frac{1}{\sqrt{2\omega}}\left[a(t) + a^{\dagger}(t) \right] $$
The time evolution of the creation and annihilation operators can be found by solving Heisenberg's equation of motion, yielding the result for the harmonic oscillator:
$$ q_{\mathbf p}(t) = \frac{1}{\sqrt{2\omega_{\mathbf p}}}\left[a_{\mathbf p}e^{-i\omega_{\mathbf p}t} + a^{\dagger}_{-\mathbf p}e^{i\omega_{\mathbf p}t} \right] $$
where the $-\mathbf p$ subscript in the second operator is introduced for later convenience. Substituting this into the field expression as a Fourier transform:
$$ \phi(t,\mathbf x) = \int \frac{\mathrm{d}^{3}\mathbf{p}}{(2\pi)^3}\frac{e^{i\mathbf{p}\cdot\mathbf{x}}}{\sqrt{2\omega_{\mathbf p}}}\left[a_{\mathbf p}e^{-i\omega_{\mathbf p}t} +  a^{\dagger}_{-\mathbf p}e^{i\omega_{\mathbf p}t} \right] =  \int \frac{\mathrm d^3{\mathbf p}}{(2\pi)^3}\frac{1}{\sqrt{2\omega_{\mathbf p}}}\left[a_{\mathbf p} e^{-ip_{\mu}x^{\mu}} + a_{\mathbf p}^{\dagger}e^{ip_{\mu}x^{\mu}}\right]$$
by flipping the sign of $\mathbf p$ in the second term.
A: You might feel more comfortable if we run the reasoning 'in reverse' a bit. I'm basically just recounting what all the standard texts do, but without jumping ahead in the interpretation. 


*

*We begin with the canonically quantized Klein-Gordon field $\phi(\mathbf{x})$ and its conjugate momentum $\pi(\mathbf{x})$, so that $[\phi(\mathbf{x}), \pi(\mathbf{y})] \propto i \delta(\mathbf{x}-\mathbf{y})$.

*We know that generally physics is nicer in Fourier space, especially for free fields where plane waves are classical solutions, so we define the Fourier transforms $\phi(\mathbf{p})$ and $\pi(\mathbf{p})$. 

*By analogy with the harmonic oscillator, we suspect that the quantity 
$$a_{\mathbf{p}} \propto \phi(\mathbf{p}) + i \pi(\mathbf{p})/\omega_p$$
will be nice to work with. At this stage, $a_{\mathbf{p}}$ is just some operator with no physical interpretation. 

*When we compute the commutation relations, we find
$$[a_{\mathbf{p}}^\dagger, a_{\mathbf{q}}] \propto \delta(\mathbf{p}-\mathbf{q})$$
with an annoying energy-dependent proportionality constant, and all other commutators zero.

*From undergraduate quantum mechanics, these commutation relations imply that applying $a_{\mathbf{p}}^\dagger$ gives a ladder of states for each value of $\mathbf{p}$. Then we physically interpret $(a_{\mathbf{p}}^\dagger)^n |0 \rangle$ to contain $n$ particles of momentum $\mathbf{p}$, so that $a_{\mathbf{p}}^\dagger$ really is a creation operator, i.e. it creates particles.

*The only issue is that these states are not normalized; we get an annoying energy-dependent normalization factor. (To see this, try calculating the norm of $a_{\mathbf{p}}^\dagger |0 \rangle$ using the commutation relation above.) Tracing backwards, we find that it goes away if we replace $a_{\mathbf{p}}$ with $\sqrt{\omega_{\mathbf{p}}} a_{\mathbf{p}}$, recovering the standard definition.


When Peskin does this whole thing in one step, you should view it as just a very inspired definition (where we've outlined where the 'inspiration' might come from above), not a statement that needs to be proved. It's a more advanced version of guessing a sinusoid to solve the harmonic oscillator.
A: You do not need any Ansatz. The KG equation in coordinates $\left(\partial_\mu \partial^\mu + m^2 \right)\phi (x) =0$ needs to be translated to momentum coordinates using:
$$\phi (x) = \frac{1}{(2\pi)^4} \int_{\mathbb R^4} ~d^4 k ~ \tilde{\phi}(k) e^{ik_\mu x^\mu}$$
Can you do this calculation? 
A: The factor in the denominator comes from integration over the time component of the momentum four vector (which is E). When you do a Fourier transform you go from d^4 x to d^4 k.  You then impose the energy constraint equating E^2 to k^2. The delta function of k_0^2 is the delta function of k_0 divided by its derivative at k_0 = E. You then get an integral over three dimensional momentum space, but divided by 2E.
You can find a fairly detailed explanation of this in Ashok Das' book "Lectures on Quantum Field Theory" which in general has much more detail than most books.
