Is possible to evaluate the integral $\int_0^1 dx_1\int_0^{1-x_1} dx_2\int_0^{1-x_2} dx_3\cdots \int_0^{1-x_{n-1}} dx_n$ with Mathematica?
3 Answers
Take the fine results of @Bill
Table[Integrate[1,
Sequence @@
Table[{a[j], 0, If[j == 1, 1, 1 - a[j - 1]]}, {j, 1, n}]], {n, 1,
8}]
and @bmf
ff[xx_] :=
Integrate[1,
Sequence @@
Table[{gg[j], 0, If[j == 1, 1, 1 - gg[j - 1]]}, {j, 1, xx}]];Table[ff[n], {n, 1, 8}]
to get list
{1, 1/2, 1/3, 5/24, 2/15, 61/720, 17/315, 277/8064}
Insert that list at serach site for integer sequences https://oeis.org/search?q=3,5,9,1,4,0,9,1&sort=&language=english&go=Search
You see, list is a series development of Sec and Tan
f[n_] = SeriesCoefficient[Sec[x] + Tan[x], {x, 0, n},
Assumptions -> n > 0 && Element[n, Integers]]
(* Piecewise[{{(I^n*EulerE[n])/n!,
Mod[n, 2] == 0}},
(I*(2*I)^n*(-1 + (-1)^n)*
(-1 + 2^(1 + n))*
BernoulliB[1 + n])/(1 + n)!] *)
Table[f[n], {n, 1, 8}]
(* {1, 1/2, 1/3, 5/24, 2/15, 61/720, 17/315, 277/8064} *)
-
2$\begingroup$ (+1) from me. I cannot believe I forgot to employ the
FindSequenceFunction
and/or OEIS. Wonderful stuff!!! $\endgroup$– bmfCommented Mar 26, 2022 at 21:38 -
$\begingroup$ @bmf I do not understand what's so wonderful, it's just guessing. Now not only students google even simplest integrals, I have seen profs doing this. $\endgroup$– yarchikCommented Mar 27, 2022 at 22:01
-
$\begingroup$ @yarchik so, the fact that I left a polite comment has to be justified? I do not understand. Did I do anything against the rules or something? $\endgroup$– bmfCommented Mar 27, 2022 at 22:04
-
1$\begingroup$ @bmf Nothing to be justified. You left a polite comment, I expressed my opinion on your comment and on the above solution, hopefully polite too. No downvotes. We simply have different opinions how math should be done, especially on a problem that can be easily solved rigorously. I think it is normal, isn't it? $\endgroup$– yarchikCommented Mar 27, 2022 at 22:09
-
$\begingroup$ @yarchik yes, of course. I was not offended and did not mean to be cheeky. My question was honest, i.e if it is bad to leave comments like these. In any case, as you say it's just a difference of approaches on a given maths problem, which I think is good in any situation as you also pointed out :-) $\endgroup$– bmfCommented Mar 27, 2022 at 22:11
I agree that you should have added clarification, but I don't agree with zero help to a newcomer.
I am hoping that the following will at least get you started.
- In case you want to multiply $n$ integrals with $1$ as integrand and variable limits.
Consider
ff[xx_] :=
With[{n = xx},
Integrate[Product[1, {k, 0, n}],
Sequence @@ Table[{x[k], 0, 1 - x[k - 1]}, {k, n, 1, -1}]]] /.
x[0] -> 0 // Expand
Check for $n=3$
ff[3]
1 - x[1] - x[2] + x[1] x[2]
And explicitly
Integrate[1, {x1, 0, 1}] Integrate[1, {x[2], 0, 1 - x[1]}] Integrate[
1, {x[3], 0, 1 - x[2]}] // Expand
1 - x[1] - x[2] + x[1] x[2]
- In case you want to use previous in the next and so on.
Consider
ff[xx_] :=
Integrate[1,
Sequence @@
Table[{gg[j], 0, If[j == 1, 1, 1 - gg[j - 1]]}, {j, 1, xx}]]
Check for $n=3$
ff[3]
1/3
and explicitly you get
Integrate[
Integrate[
Integrate[1, {x[3], 0, 1 - x[2]}], {x[2], 0, 1 - x[1]}], {x[1], 0,
1}]
1/3
-
$\begingroup$ Surely
Product[1, {k, 0, n}]
is equal to1
? $\endgroup$– JojoCommented Mar 27, 2022 at 10:53 -
-
$\begingroup$ @Joe because on my machine I get
the right results
$\endgroup$– bmfCommented Mar 27, 2022 at 11:07 -
$\begingroup$ Oh no I didn't run the code, it just seemed strange to me to put in
Product[1, {k, 0, n}]
instead of1
$\endgroup$– JojoCommented Mar 27, 2022 at 13:31 -
$\begingroup$ @Joe ok I see. I just thought you run into problems and it seemed weird. Thanks for the comment :-) $\endgroup$– bmfCommented Mar 27, 2022 at 18:41
We set x[0]==0
and use RegionMeasure
.
int[k_] :=
ImplicitRegion[
Join[{x[0] == 0}, Table[0 <= x[n] <= 1 - x[n - 1], {n, 1, k}]],
Evaluate@Table[x[n], {n, 0, k}]] // RegionMeasure;
int /@ Range[9]
{1, 1/2, 1/3, 5/24, 2/15, 61/720, 17/315, 277/8064, 62/2835}
-
$\begingroup$ Very cool use of
ImplicitRegion
andIntegrationMeasure
!!!! $\endgroup$– bmfCommented Mar 27, 2022 at 20:04
Integrate[1,Sequence@@Table[{a[j],0,If[j==1,1,1-a[j-1]]},{j,1,6}]]
ChangeIntegrate
to something likeq
and evaluate to inspect what arguments will be passed toIntegrate
$\endgroup$With[{n = 6}, #[x] & /@ NestList[Function[{x}, Integrate[#[y], {y, 0, 1 - x}]]] &, 1 &, n] // Together
[1]: math.stackexchange.com/questions/4415715/… $\endgroup$