I'm trying to understand the optical theorem of Peskin and Schroeder
$$\tag{7.50} \text{Im} M(k_1,k_2\rightarrow k_1,k_2)=2E_{cm}p_{cm}\sigma_{tot}(k_1,k_2\rightarrow\text{anything})$$
which Peskin and Schroeder says follows from
$$\tag{7.49} -i[M(a\rightarrow b)-M^\ast(b\rightarrow a)]=\sum_f\int d\Pi_f M^\ast(b\rightarrow f)M(a\rightarrow f)$$
and $$\tag{4.79} d\sigma=\frac{1}{2E_A2E_B|v_A-v_B|}\times\prod_f\frac{d^3 p_f}{(2\pi)^3}\frac{1}{2E_f}\times |M(p_A,p_B\rightarrow\{p_f\})|^2(2\pi)^4\delta^{(4)}(p_A+p_B-\sum p_f)$$
and $$\tag{4.80} \int d\Pi_n=\prod_f\frac{d^3 p_f}{(2\pi)^3}\frac{1}{2E_f}\times(2\pi)^4\delta^{(4)}(P-\sum p_f)$$
But how did we integrate (4.79) to get (7.50)?