# What is the best method to do a MC Integration of a multidimensional integral where the integration limits depend upon other variables?

What is the best method to do a Monte Carlo Integration of a multidimensional integral where the integration limits depend upon other variables?

I am interested in getting a numerical value of a 5 dimensional integral, the limits look like this:

$$\int_{0}^{a^2} dS_{12} \int\limits_{S_{12}}^{a^2} dS_{123} \int\limits_0^{(a^2-S_{123})(S_{123}-S_{12})/S_{123}} dS_{34} \int\limits_0^1 d\tilde{S}_{13}\int_\limits{-\pi/2}^{\pi/2} d\tilde{S}_{134}$$

I guess the first two integrals could be done by choosing any random number between their respective limits, but what about the three last ones? I could find no source that could tell me about that, the only reference I could find that barely talks about this kind of stuff is this (page 41 in the pdf file): http://www.hep.fsu.edu/~harry/papers/MonteCarloTheoryPractice.pdf

My first attempt at solving this integral was with what the author of the previous link calls "the obvious way", which they say is wrong, and it seems like this is the case (I am calculating the decay width of a four-body decay and comparing it with other simulations and the value given by different collaborations).

Sorry if it seems to be a rather elementary question, this is the first time that I am doing a Monte Carlo integration problem.

• I think rejection sampling might work? And this appears in the PDF you linked immediately below the "obvious way" (section 8.2.2). Oct 7, 2021 at 15:05
• @DanielShapero How would this work exactly? s_12 = a**2*random() s_123 = a**2*random() s_34 = max(upper_limit)*random() where upper_limit should be the value at which the upper limit of the integral of $S_{34}$ is maximum (getting the gradient, equalling to zero would solve it, Lagrange multipliers should also come into play since this is constrained) Would the only rejection come from s_123 < s_12? Or are there any further rejections from the $S_{34}$ integral? Oct 7, 2021 at 15:50
• Sorry, maybe there should be another rejection if s_34 > (a^2-s_123)(s_123-s12)/s123. Should this be the procedure? Oct 7, 2021 at 15:58
• Maybe try first a simple 2D case: $\int_0^x dy \int_0^1 dx$. Would this one cause difficulty? Oct 7, 2021 at 20:13