an exercise asks me to explicit the functions ${a}(k)$ and $a^{*}(k)$ in term of the real field $\phi$ and its temporal derivate $\partial_0 \phi$ if the general solution of the Klein-Gordon equation is $$\phi(x,t) = \frac{1}{(2\pi)^3} \int \frac{d^3k}{\sqrt{2w_k}}[a(k)e^{-i\, k\cdot x}+ a^{*}(k) e^{i \, k \cdot x}],$$ where $k \cdot x = w_kt - \vec{k}\cdot\vec{x}$.
I wrote down in explicit form the Klein Gordon equation, such as $$(\partial^{\mu}\partial_{\mu} + m^2)\phi=0 \Rightarrow \ddot{\phi} = (\nabla^2 - m^2) \phi$$ and inserted the general solution on it but I didn't find the solution.
Can someone help me?