# Algorithm to calculate multiple integral.

One of the major difficulties of student in advanced calculus (including myself when student) is to obtain the extremes of repeated integrals to calculate the volume integral in $R^n$ i.e. transform the integral $$\int_{D}f(x) \,\mathrm d\,V_n, \quad f\in C(\mathbb{R}^n)$$ in the multiple integral $$\int_{c_1^1}^{d_1^1}\cdots\int_{c_n^1}^{d_n^1} f(x_1,\ldots,x_n) \,\mathrm d\,x_1\ldots \,\mathrm d\,x_n +\ldots + \int_{c_1^m}^{d_1^m}\cdots\int_{c_n^m}^{d_n^m} f(x_1,\ldots,x_n) \,\mathrm d\,x_1\ldots \,\mathrm d\,x_n.$$ The integer $m$ arises from the need to partition the set $D$.

More precisely I would get for a well-defined algorithm (that could be manually computable) whose output was the number $m\in\mathbb{N}$ and the extremes of integration in terms of vectors $a\in\mathbb{R}^p$, $b\in\mathbb{R}^p$ ​​and the matrices $M^1,\ldots,M^p\in\mathbb{R}^{n\times n}$ that define the set $D\subset\mathbb{R}^n$ as below $$D= \left\{ x= \left[ \begin{array}{c} x_1 \\ \vdots \\ x_n \end{array} \right] \in\mathbb{R}^n\quad \left|\quad \begin{array}{c} a_1 \leq x^TM^1x \leq b_1 \\ \vdots\\ a_p \leq x^TM^px \leq b_p \\ \end{array} \right. \right\} \subset [-r,r]^n,\quad r>0.$$

In terms of explicit coordinates we have: $M^1=(M_{uv}^1)_{n\times n},\ldots ,M^p=(M_{uv}^p)_{n\times n}$ are the matrices in $\mathbb{R}^{n\times n}$ and $a=(a_i)_p$ and $b=(b_j)_p$ are the vectors in $\mathbb{R}^{p}$.

My question: Is there any algorithm that can be implemented but it is computationally simple for calculate the extrems of repeated integrals above? Some reference?