Learning the Integral of a Diffusion Model