If there is an $(n+1)$-dimensional integral of the form$$ \int_{[0,1]^{n+1}} f(x, y)\,\mathrm{d}^n x \,\mathrm{d}y,$$normally one would evaluate this using a multi-dimensional integration library over the whole domain, $[0,1]^{n+1}$.But are there some conditions where it might make sense to perform the integral over $y$ separately, using a one-dimensional quadrature, and then use the multi-dimensional integration library to evaluate the integrand over the other $n$ coordinates?$$ \int_{[0,1]^n}g(x)\,\mathrm{d}^nx, \qquad g(x) = \int_0^1 f(x,y)\,\mathrm{d}y. $$This might make sense, for example, if $f$ is especially smooth as a function of $y$, but not $x$. But how smooth exactly does it have to be in this case?My guess was that it almost never makes sense because far too many of the 1-d quadrature evaluation points would be wasted, but I'm not so sure this always applies. Is this guaranteed by the design of the high-dimensional integration methods?In my own case, $f$ is black-box, but piecewise-smooth in $y$, and has an unknown amount of kinks and jumps in $x$ at unknown locations, and $n$ is quite high ($n\geq 4$), so the integral over $x$ has to be done with something specifically for many dimensions. The integral over $y$ can be done with something regular like quadgk. In this example, the function is smooth enough in $y$ that it almost seems to work, but repeated integration ends up being 30 times slower, so I am wondering if the approach is misguided.If you know where this is already discussed in the literature, that would be helpful too.Example. (of why this is not trivial) Consider an easy integral, which is very smooth, unlike what I'm really interested in:$$ \int_{[0,1]^n} e^{-x_1 x_2\cdots x_n}\,\mathrm{d}^n x = \mathrm{F}\left(\begin{array}{}\{1,\ldots,1\}_n\\\{2,\ldots,2\}_n\end{array}\middle| -1\right). $$We could do naive $n$-dimensional Monte Carlo on the integrand, or naive $(n-1)$-dimensional Monte Carlo on the integrand integrated once w.r.t. $x_1$, which is $g(x_{2:n}) = -(e^{-a}-1)/a$ (where $a=x_2\cdots x_n$). With some algebra, I calculated that the variance of $(n=5)$-dimensional $N$-point MC estimate is $0.00244N^{-1}$, and it is $0.00167N^{-1}$ for the $4$-dimensional integral of $g$, for a variance reduction by a factor of $1.5$.This is a paltry reduction in variance: it would be negated by using $1.5$ times as many samples points, and this is offset by the fact that the internal integrand might be more than $1.5$ times slower to evaluate. If the function $g = (1-e^{-a})/a$ above happens to be more than $1.5$ times slower, this represents a net loss of accuracy, keeping computation time fixed.Presumably the same kind of tradeoff applies when considering a deterministic rule for integrating over $x$. The Monte Carlo method makes this analysis much easier than the general case, because integrating over $y$ acts like a very straightforward variance reduction technique. But I'm really much more interested in deterministic methods, which I haven't been able to analyze as easily.
When is it advantageous to iterate integrals numerically?
numerical analysis;reference request;quadrature;integration