I'm working on the derivation of the Casimir energy from quantum field theory. From the K-G equation (with $c=1$ and $\hbar=1)$ I found the vacuum energy:
$$\langle 0|H|0\rangle=E_{vac}=V\int_{-\infty}^{+\infty} d^3p\ \frac{1}{2}E_p$$
where $V$ is an arbitrary large volume (hence $E_{vac}$ is infinite). However, when trying to calculate the vaccum energy for a region between plates separated by a distance $a$, I had trouble finding a solution to the K-G equation with boundary conditions. We have the K-G equation to be
$$(\partial^2_t-\nabla^2+m^2)\psi=0 \, .$$
Which has the general solution, in terms of the creation and anhiquilation operators:
$$\psi (x,t)=\int d^3p\ \frac{1}{\sqrt{2E_p}}(\hat{a}e^{-ip\cdot x}+\hat{a}^\dagger e^{+ip\cdot x}) \, .$$
For simplicity, let's suppose the two plates are situation in $x_1=0$ and $x_1=L$, so our field must satisfy $\psi(x_1=0)=\psi(x_1=L)=0$. This leads to \begin{align} \psi(x=0,t) &= \int d^3p\ \frac{1}{\sqrt{2E_p}}(\hat{a}e^{-ip_\| \cdot x_\|}+\hat{a}^\dagger e^{+ip_\|\cdot x_\|})=0 \\ &= \int d^3p\ \frac{1}{\sqrt{2E_p}}(\hat{a}e^{-ip_\| \cdot x_\|}e^{-ip_1L}+\hat{a}^\dagger e^{+ip_\|\cdot x_\|}e^{ip_1L})=0 \, . \end{align}
Where I introduced the notation $p_\|\cdot x_\|=E_pt-p_2x_2-p_3x_3$ to denote the directions parallel to the plates (not sure if this helps). However, I cannot find a way to arrange the coefficients so I can get an expression (out of intuition I think some sinus should appear, but I can't justify it). How can I do that (this is the massless case)?