So I am trying to solve the Klein-Gordon equation using a Fourier transform of the spatial components only. The Klein-Gordon equation reads:
$$ (\partial ^2 + m^2)\phi(x) = 0. $$
If I let
$$ \phi(x) = \phi(t, \mathbf{x}) = \frac{1}{(2\pi)^{3/2}}\int \widetilde{\phi}(t,\mathbf{k})e^{-i \mathbf{k} \cdot \mathbf{x} } \mathrm{d}^3k,$$
I substitute this into the K-G equation to get
$$\frac{\partial^2 \widetilde{\phi}}{\partial t^2} +(\mathbf{k}^2+m^2)\widetilde{\phi}=0. $$
This is the differential equation for a simple harmonic oscillator so I can immediately write
$$ \widetilde{\phi}(t,\mathbf{k})=A(\mathbf{k})e^{i \omega_{\mathbf{k}}t}+B(\mathbf{k})e^{-i \omega_{\mathbf{k}} t}, $$
and therefore I find
$$ \phi(x)= \frac{1}{(2\pi)^{3/2}}\int \bigg(A(\mathbf{k})e^{i \omega_{\mathbf{k}}t-\mathbf{k} \cdot \mathbf{x}}+B(\mathbf{k})e^{-i \omega_{\mathbf{k}} t -\mathbf{k} \cdot \mathbf{x}}\bigg) \mathrm{d}^3k. $$
Now at this stage I get slightly confused. I have seen the general solution to the Klein-Gordon equation and it has a factor of $1/2 \omega_{\mathbf{k}}$ inside the integrand, any hints as to how I can proceed to this?
I have also read that in order to tidy notation up I would set $\mathbf{k} \rightarrow -\mathbf{k} $ in the second term of the integrand, but wouldn't this change $ \mathrm{d}^3k \rightarrow -\mathrm{d}^3k$ as the Jacobian determinant is $-1$, so surely it should be a difference of two terms?
The solution I am trying to get to:
$$ \phi(x)= \frac{1}{(2\pi)^{3/2}}\int \frac{1}{2\omega_{\mathbf{k}}} \bigg(A(\mathbf{k})e^{i \omega_{\mathbf{k}}t-\mathbf{k} \cdot \mathbf{x}}+B(\mathbf{k})e^{-i \omega_{\mathbf{k}} t +\mathbf{k} \cdot \mathbf{x}}\bigg) \mathrm{d}^3k. $$