Given the function
$$ \iint p(x|a,b)p(a)p(b) \, \mathrm d(a) \,\mathrm d(b) $$
I would like to integrate out $a$ and $b$ to be left with $x$ only. As far as numeric methods go, I understand how to do it, but is there a computational approach to it? By that I mean an algorithm you could encode on a computer that would approximate that?
I was thinking about a simpler example
$$\int p(x|a) p(a) \, \mathrm d(a) $$
and thought to take $N$ $x$ values , let's say $\langle 1,2,3,\ldots,N\rangle$ and integrate for a fixed $x$, all values of $a$. In a sense, I change the function to be in terms of a and not $x$, to get back to univariate function. Then, I can combine it using some interpolation to make approximately continuous $p(x)$. Is that a good approach?