And if this problem is strictly an integral, then logically the code handling it belongs in integrate. It's a better separation of concerns. Let people who are interested in integration deal with how to efficiently integrate things and let people interested in stats just pass the integrals in a way that is logical to them.