# Marginal of Wigner Function calculation

I am reading on the Wigner function from the Gerry and Knight book. It defines it as: $$W(q, p) \equiv \frac{1}{2 \pi \hbar} \int_{-\infty}^{\infty}\left\langle q+\frac{1}{2} x|\hat{\rho}| q-\frac{1}{2} x\right\rangle e^{i p x / \hbar} d x$$

and then shows that :

\begin{aligned} \int_{-\infty}^{\infty} W(q, p) d p & =\frac{1}{2 \pi \hbar} \int_{-\infty}^{\infty} \psi^*\left(q-\frac{1}{2} x\right) \psi\left(q+\frac{1}{2} x\right) \int_{-\infty}^{\infty} e^{i p x / \hbar} d p d x \\ & =\int_{-\infty}^{\infty} \psi^*\left(q-\frac{1}{2} x\right) \psi\left(q+\frac{1}{2} x\right) \delta(x) d x \\ & =|\psi(q)|^2 \end{aligned}

but omits the calculation for the momentum counterpart.

I was attempting this but I couldn't transform the position wave function into the momentum wave functions without it getting too messy. Can anyone give me the idea of outline of how to do it? I've tried using Fourier transform and integrating to find the delta function but I get stuck at some point or another. Thanks a lot

$$\psi(q)=\int_{-\infty}^{\infty}\!\! \frac{dp}{\sqrt{2\pi \hbar}}~e^{-ipq/\hbar} \phi(p),$$ so that $$\int_{-\infty}^{\infty}\!\! dq~ W(q, p) =\frac{1}{(2 \pi \hbar)^2} \int_{-\infty}^{\infty} \!\! dq dxdp'dp''~\bigl (\phi^*(p'') e^{ip''(q-x/2)/\hbar}\bigr )\bigl ( \phi(p') e^{-ip'(q+x/2)/\hbar} \bigr ) e^{i p x / \hbar} \\ = \int_{-\infty}^{\infty} dp' dp''~\phi^*(p'') \phi(p') \delta(p'-p'') \delta \left (p-\frac{p'+p''}{2}\right ) \\ =|\phi(p)|^2.$$