# Energy of neutral pion in proton's rest mass frame

Hello, my problem is as follows
For the decay $p\rightarrow e^+\pi ^0$ show that the energy of the pion in the proton’s rest
frame (i.e., the lab frame) is

$E_{\pi}=\frac{m_p^2+m_{\pi}^2-m_e^2}{2m_p}$​
I've tried finding the invariant mass of the positron and pion as follows

$M^2=(E_e+E_{\pi})^2-(\mathbf{p_e}+\mathbf{p_{\pi}})\\$
$=E_e^2+E_{\pi}^2+2E_eE_{\pi}-p_e^2-p_{\pi}^2-2\mathbf{p_ep_{\pi}}\\$
$=m_e^2+m_{\pi}^2-2(E_eE_{\pi}+\mathbf{p_ep_{\pi}})\\$
$=m_e^2+m_{\pi}^2-2(E_eE_{\pi}+p_ep_{\pi}\textrm{cos}\theta)\\$
And this is presumably equal to the mass of the proton so

$m_e^2+m_{\pi}^2-2(E_eE_{\pi}+p_ep_{\pi}\textrm{cos}\theta)=m_p^2$
At this point I cannot see how to get any closer to the given answer. Any help with how to proceed from here, or advice on where I may have already gone wrong, would be greatly appreciated.

Thanks

DEvens
$m_e^2+m_{\pi}^2-2(E_eE_{\pi}+p_ep_{\pi}\textrm{cos}\theta)=m_p^2$