Examples
➤ 1.
$$I=\iiint\limits_D \dfrac{{\rm d}x\ \!{\rm d}y\ \!{\rm d}z}{(x+y+z)^p}~,$$
where $$D=\{~(x,y,z)~\colon~x>0~,y>0~,z>0~,x+y+z<1~\}~.$$
MMA gives: $~I=-\dfrac1{2(p-3)}~.$
➤ 2.
$$I=\idotsint\limits_{~~V} \dfrac{{\rm d}x_1\ \!{\rm d}x_2\ \!\cdots\ \!{\rm d}x_n}{(x_1+x_2+...+x_n)^p}~,$$
where $$V=\{~(x_1,x_2~,\dots,x_n)~\colon~x_1>0~,x_2>0~~,\dots,x_n>0~,x_1+x_2+...+x_n<1~\}~.$$
The integral converges when $p<n$.
Verified the case of $n=1~5$, conjecture by induction that $$I=\frac{1}{(n-1)!~(n-p)}~.$$
Conclusion
Special thanks to @Pillsy's formula and @CarlWoll's simplification!
In:
n = 20;
Integrate[y^(n-1-p), {y,0,1}, x∈Simplex[n-1]] [[1]] // AbsoluteTiming
Out:
$\left\{0.363959,\frac1{121645100408832000 (20-p)}\right\}$
NOTE: The following content is no longer worth browsing.
Code
In:
int[var_] :=
Block[
var,
fun = Power[Plus @@ var, p]~Power~-1;
con0 = <|1 -> (StringRiffle[# > 0 & /@ var, "&&"] // ToExpression),
2 -> Plus @@ var < 1|>;
con = StringRiffle[Values@con0, "&&"] // ToExpression;
Column[{fun, con}] // TraditionalForm // Print;
(result = Integrate[fun, var ∈ ImplicitRegion[con, Evaluate@var],
Assumptions -> p < Length@var] // Together
) // TraditionalForm
]
int@{x, y, z}
int@{x, y, z, u, v, w} // Timing
Out:
$(x+y+z)^{-p} \\ x>0\land y>0\land z>0\land x+y+z<1 \\ -\dfrac1{2(p-3)}$
$(u+v+w+x+y+z)^{-p} \\ x>0\land y>0\land z>0\land u>0\land v>0\land w>0\land u+v+w+x+y+z<1 \\ \left\{29.6719,-\dfrac1{120(p-6)}\right\}$
Timing
$\begin{array}{rr} n & t(s) \\ \hline 1 & 0.328 \\ 2 & 0.656 \\ 3 & 1.391 \\ 4 & 3.297 \\ 5 & 16.828 \\ 6 & 29.641 \\ 7 & 69.766 \end{array}$
Tests on:
Mathematica 11.1.1.0 (←2017-05-16),
Windows 64-bit 10.0.10586 (←2015-11-12),
AMD A8-5600K (←2012-09-26)
Aiming
Code of fast and efficient algorithm.
Wish: regardless of how large is $n$, the computation time is always less than 10s.
I would be thankful, if you could improve or rewrite any part of the code.
I would be admired, if you could write a library/macro that can output very fast and can apply to many situations, whereas even do not depend on the original Integrate
function.
Question END.
The following has nothing to do with the post topic, just recording my experiences of fixing this —
Your post appears to contain code that is not properly formatted as code.
In my case, all the problems stem from LaTeX MathJax (comment from @anderstood).
① Custom commands are not allowed to submit (though they are rendered normally).
② Need to delete ⏎ after \\
in some places.
Simplex
for your region specification, but it won't be much (if any) faster, e.g.With[{v=Table[Unique[x],{5}]},Integrate[1/Total[v]^p, v\[Element]Simplex[5]]]
$\endgroup$