# Contradictory solutions to the Klein-Gordon equation as an initial value problem (canonical formulation)

I'm going to begin with a prelude about constructing the solution using the action/Lagrangian formalism in order to provide context and a point of comparison for the canonical one. The main question will begin at the horizontal line.

The inhomogeneous Klein-Gordon equation can be derived by minimizing the action \begin{align} S\left[\phi\right] &= \int \operatorname{d}^4x \mathcal{L}(\phi,\partial_0\phi) \\ & = \int \operatorname{d}^4 x \left[\frac{1}{2}\partial_\mu\phi\partial^\mu\phi - \frac{m^2}{2}\phi^2 + J\phi\right] \end{align} with $\operatorname{sig}(\eta_{\mu\nu}) = (+,-,-,-)$. Finding the stationary point in the action with respect to the field $\phi(t,\mathbf{x})$ produces the inhomogeneous Klein-Gordon equation \begin{align} \frac{\delta S[\phi]}{\delta \phi(t,\mathbf{x})} & = 0 \\ & = - \ddot{\phi} + \nabla^2\phi - m^2\phi + J. \end{align} If we define the retarded Green's function as \begin{align} \left[\frac{\partial^2}{\partial t^2} - \nabla^2 + m^2\right] G_{\mathrm{ret}}(t,\mathbf{x};t',\mathbf{x}') & = \delta(t-t')\,\delta(\mathbf{x}-\mathbf{x}') \\ G_{\mathrm{ret}}(t,\mathbf{x};t',\mathbf{x}') & = 0\ \forall\, t \le t' \Rightarrow \\ \left.\partial_t G_{\mathrm{ret}}(t,\mathbf{x};t',\mathbf{x}')\right|_{t=t'} & = \delta(\mathbf{x}-\mathbf{x}'), \end{align} then if we multiply the equation of motion by $G_{\mathrm{ret}}(t,\mathbf{x};t',\mathbf{x}')$, integrate over all of space-time, and integrate by parts to move the derivatives over to the Green's function yields \begin{align} \phi(t \ge 0,\mathbf{x}) &= \int \operatorname{d}^4x\, G_{\mathrm{ret}}(t,\mathbf{x};t',\mathbf{x}')\, J(t',\mathbf{x}') \\ &\hphantom{=} + \int \operatorname{d}^3x \left[\frac{\partial G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')}{\partial t} \phi(0,\mathbf{x}') + G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')\, \dot{\phi}(0,\mathbf{x}')\right], \end{align} if we assume the fields at spatial infinity vanish. Note that we don't have to worry about the value of the field and its derivative at $t'=t_{\mathrm{final}}$ because of our use of the retarded Green's function. To reconstruct $\phi(t\le 0,\mathbf{x})$, simply substitute the advanced propagator for the retarted one.

The canonical approach begins with defining the canonically conjugate momentum \begin{align} \pi(t,\mathbf{x}) & \equiv \frac{\partial \mathcal{L}}{\partial \partial_0 \phi} \\ & = \frac{\partial \phi}{\partial t} \end{align} and from there defining the Hamiltonian \begin{align} H & \equiv \int \operatorname{d}^3x \left[\pi \partial_0 \phi - \mathcal{L}\right] \\ & = \int\operatorname{d}^3x\left[ \frac{1}{2}\pi^2 + \frac{1}{2} (\nabla\phi)^2 + \frac{m^2}{2}\phi^2, \right] \end{align} where I've dropped the $J$ term because it's no longer relevant.

The canonical equations of motion then become \begin{align} \dot{\phi}(t,\mathbf{x}) & = \frac{\delta H}{\delta \pi(\mathbf{x})} \\ & = \pi(t,\mathbf{x}) \\ \dot{\pi}(t,\mathbf{x}) & = -\frac{\delta H}{\delta \phi(\mathbf{x})} \\ & = \nabla^2\phi(t,\mathbf{x}) - m^2\phi(t,\mathbf{x}) \end{align} where the phase space is now defined by $(\phi,\pi)$. It's clear that the canonical equations of motion can be combined to show that both $\phi$ and $\pi$ obey the Klein-Gordon equation. We can use that fact to reproduce the behavior of $\phi$ as $$\phi(t,\mathbf{x}) = \int \operatorname{d}^3x \left[\frac{\partial G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')}{\partial t} \phi(0,\mathbf{x}') + G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')\, \pi(0,\mathbf{x}')\right].$$

The question comes from asking how we define the time evolution of $\pi(t,\mathbf{x})$? If we apply the first canonical equation of motion we get \begin{align} \pi(t,\mathbf{x}) &= \int \operatorname{d}^3x \left[\frac{\partial^2 G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')}{\partial t^2} \phi(0,\mathbf{x}') + \frac{\partial G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')}{\partial t} \pi(0,\mathbf{x}')\right] \end{align} using the defining equation for the Green's function this becomes \begin{align} \pi(t,\mathbf{x}) &= \int \operatorname{d}^3x \left[ \left(\nabla^2 G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}') - m^2 G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}') + \delta(t)\,\delta(\mathbf{x}-\mathbf{x}') \right) \phi(0,\mathbf{x}') \right. \\ & \hphantom{=\int \operatorname{d}^3x}\ \ \left.+ \frac{\partial G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')}{\partial t} \pi(0,\mathbf{x}')\right]. \end{align} Now, the boundary conditions on $G_{\mathrm{ret}}$ make it so that the boundary condition for $\phi$, $\phi(t=0,\mathbf{x}) =\phi(0,\mathbf{x})$ is satisfied. The boundary condition for $\pi$ appears to be violated, though. Plugging in $t=0$ to the equation for $\pi$ gives \begin{align} \pi(t=0,\mathbf{x}) & = \pi(0,\mathbf{x}) + \delta(0)\,\phi(0,\mathbf{x}), \end{align} which violates the initial boundary condition.

We can guarantee the initial boundary condition is satisfied if we mimic the construction we used for $\phi$ to get \begin{align} \pi(t,\mathbf{x}) &= \int \operatorname{d}^3x \left[G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}') \dot{\pi}(0,\mathbf{x}') + \frac{\partial G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')}{\partial t} \pi(0,\mathbf{x}')\right] \\ & = \int\operatorname{d}^3x \left[G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}') (\nabla'^2-m^2)\phi(0,\mathbf{x}') + \frac{\partial G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')}{\partial t} \pi(0,\mathbf{x}')\right]\ \mathrm{by\ 2^{nd}\ canon\ E.O.M.} \\ & = \int\operatorname{d}^3x \left[\left((\nabla^2-m^2)G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')\right) \phi(0,\mathbf{x}') + \frac{\partial G_{\mathrm{ret}}(t,\mathbf{x};0,\mathbf{x}')}{\partial t} \pi(0,\mathbf{x}')\right], \end{align} which obviously satisfies $\pi(t=0,\mathbf{x}) = \pi(0,\mathbf{x})$, but violates the equation of motion $\pi = \dot{\phi}$ at $t=0$.

Is this apparent contradiction a problem? If it is a problem, what is the correct way to get around it (e.g. which version of $\pi(t,\mathbf{x})$ is correct and why)? If it's not, why not?

Having thought about it some, I'll put forward an answer to this question. The primary answer feels like something of a cop-out, nevertheless the answer is that the contradiction points to the fact that the time evolution equations are only valid at the level needed to take time derivatives for $t > 0$, where they all agree, even in the limit as $t\rightarrow 0$ (notice that the problems only pop up if you plug in $t=0$ directly).
The more detailed answer is that if we take the canonical equations of motion as the starting point, then the second form of $\pi(t,\mathbf{x})$ is the "more" correct one. For example, if keep space continuous and discretize time, then the canonical equations of motion become \begin{align} \phi(t_i + \Delta t,\mathbf{x}) & = \pi(t_i,\mathbf{x}) \Delta t + \phi(t_i,\mathbf{x}) \\ \pi(t_i + \Delta t,\mathbf{x}) & = \left(\nabla^2 - m^2\right)\phi(t_i,\mathbf{x}) \Delta t + \pi(t_i,\mathbf{x}) \Rightarrow \\ \left[\begin{array}{c} \phi \\ \pi \end{array}\right]_{i+1} &= \left[\begin{array}{cc} 1 & \Delta t \\ \Delta t \left(\nabla^2 - m^2\right) & 1 \end{array}\right]\cdot \left[\begin{array}{c} \phi \\ \pi \end{array}\right]_i, \end{align} which is an update rule for a finite (small) amount of time. When the limit $\Delta t\rightarrow 0$ and the total amount of time spanned by the number of updates is held fixed, this recovers the second form of $\pi(t,\mathbf{x})$ (the one with spatial derivatives of $G_{\mathrm{ret}}$).
Taking the reverse approach, where time is kept continuous and space is discretized, is equivalent to using countable number of discrete modes in mode space (Fourier transform with respect to space and not time) and leads to the same form for $\pi(t,\mathbf{x})$ as discretizing time does.
The only situation where the first from of $\pi(t,\mathbf{x})$ pops out is when the form of $\phi$ is derived from the second order equation of motion for $\phi$, and then applying the definition of $\pi=\dot\phi$. While not as purely "canonical" as the above approaches, it should still be valid. Thus, the conclusion that the forms of $\phi(t,\mathbf{x})$ and $\pi(t,\mathbf{x})$ are, in some sense, invalid at $t=0$ when taking time derivatives, in the same way that the derivative of of $|x|$ does not exist at $x=0$.