If you have a distribution, with density p, that you don't know how to sample from, you can still estimate integrals like ∫f(x)p(x)dx by sampling:
Sample from a different distribution, with density q, then weight your samples by p(x) / q(x)
This is called importance sampling