# Quantization of Klein-Gordon field between two boundaries

Consider a real scalar $\phi(x,t)$ with mass $m$ in $1+1$ dimensional spacetime, described by the 2d free Klein-Gordon action. $\phi(x,t)$ lives on an interval $0 \leq x \leq L$, and is subject to the Dirichlet boundary conditions: $$\phi(0,t) = \phi(L,t) = 0.$$ Quantize this system and show that the formal (divergent) expression for the vacuum energy is $$E_0 = \sum_{n = 1}^\infty \frac{E_n}{2} = \sum_{n = > 1}^\infty \frac 12 \sqrt{(\frac{\pi n}{L})^2 + m^2}.$$

I know how to quantize free Klein Gordon equation. However, in the above, there is the boundary condition. Is it possible to just quantize the free Klein Gordon equation and apply the boundary condition? I am very confused...

• In this case imposing the constraints and second quantization commute with each other, but probably they don't in general... – Ryan Thorngren May 2 '18 at 18:34