EM field quantization I'm trying to quantize the electromagnetic field by solving the vector potential wave equation, that is:
$$\nabla^{2} \mathbf{A} = \dfrac{1}{c^{2}} \dfrac{\partial ^{2} \mathbf{A}}{\partial t^{2}}, $$
combined with the boundary conditions:
$$ \mathbf{A}(\mathbf{x},t) = \mathbf{A}(\mathbf{x}+\mathbf{L},t), $$
where $\mathbf{L}$ is A vector that represent the width, lenght and height of a cubic box of size L.
Well, I suppose that the solution of the above equation could be separable as:
$$ \mathbf{A}(\mathbf{x},t)=u(\mathbf{x})T(t); $$
Then, solving the $\mathbf{x}$ and the $t$ dependence, the solution is:
$$ A(\mathbf{x},t) = \sum_{\mathbf{k},s}\ \   \mathbf{e}_{\mathbf{k},s} \left( A\exp[i \mathbf{k}\cdot \mathbf{x}] + B\exp[-i \mathbf{k}\cdot \mathbf{x}] \right) \left( C\exp[i \omega t] + D\exp[-i \omega t] \right), $$ 
were A,B,C and D are constants, $\mathbf{k} = 2n\pi \mathbf{x}/\mathbf{L}$, $\omega = |\mathbf{k}|c$, $\mathbf{e}_{\mathbf{f},s}$ its the polarization vector and $s$ represent the two independent polarization directions. 
The solution, according to Sakurai (Advanced Quantum Mechanics, ) is:
$$ A(\mathbf{x},t) = \sum_{\mathbf{k},s}\ \   \mathbf{e}_{\mathbf{k},s} \left( A\exp[-i \omega t]\exp[i \mathbf{k}\cdot \mathbf{x}] + B\exp[i \omega t]\exp[-i \mathbf{k}\cdot \mathbf{x}] \right) $$
What I did wrong or what other condition I have to impose to get the correct solution? I have imposed the reality condition on $\mathbf{A}$, but I got nothing useful.   
 A: There is a straightforward way of finding the radiation field you are looking for. For the wave equation
$\Delta_{\mathbf{r}}\mathbf{A}-\dfrac{1}{c^2}\partial^2_{t}\mathbf{A}=\mathbf{0}$
the solution are plane waves, normalized in your box of volume $V=L^3$ 
$\psi_{\mathbf{k},s}=\dfrac{1}{\sqrt{V}}\mathbf{e}_s e^{i(\mathbf{k}\cdot\mathbf{r}-\omega_{\mathbf{k}}t)}$
where $s=1,2$ is the polarization. 
Next, your vector potential is a superposition of plane waves (a real one) with complex coefficients $A_{\mathbf{k},s}$
$\mathbf{A}(\mathbf{r},t)=\dfrac{1}{\sqrt{V}} \sum_{\mathbf{k}} \sum_{s=1,2}\left(A_{\mathbf{k},s}e^{i(\mathbf{k}\cdot\mathbf{r}-\omega_{\mathbf{k}}t)}+\text{c.c} \right)\mathbf{e}_s$
where c.c. means complex conjugate.
It seems to me that you are not taking into account that in the separation of variables the coefficients $A,B,C,D$ are not independent. Solve first Helmholtz equation for $u_{\mathbf{k}}(\mathbf{r})$ with expansion coefficients $A_{\mathbf{k},s}(t)$ (in your case ($A$ and $B=A^\ast$), insert into the equation of the harmonic oscillator and it should be fine.
D.
A: You forgot the sume over $k$, as any linear combination of solutions is again a solution. And you do not need to treat the $-k$ case separately from the $k$ case as otherwise you'd get each term twice. Then -after multiplying out the reamining product - your solution will be identical with Sakurai's (also amended by summing over $k$). 
A: An alternative way to think of this is that the last expression in your Question is no more than a presentation of $A_\mu(x)$ as a Fourier transform on Minkowski space, subject to the twin constraints that there are only light-like components and that the observables are the electromagnetic field (not the potential), to which only components in the 2-space determined by the polarization vectors at a given wave-number contribute.
