0
$\begingroup$

I would like to solve the following integral: $$I=\int_{0}^{a} \int_{0}^{y} \int_{0}^{z} e^{(a-x)^{3}} d x d z d y$$ with the condition that: $$a>0$$ So I tried to input the equation like below into Mathematica, but I get error messages saying Assumptions could help.

Then I tried to do it like this but no to avail: enter image description here

What am I doing wrong? Are the inputs I have mathematically incomplete, or am I doing a mistake in formatting them in Mathematica, or both??

Edit: I tried to copy the code, I hope I could do it right:

\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(a\)]\(\((
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(y\)]\((
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(z\)]
\*SuperscriptBox[\(E\), 
SuperscriptBox[\((a - 
            x)\), \(3\)]] \[DifferentialD]x)\) \[DifferentialD]z)\) \
\[DifferentialD]y\)\)

The second one:

Integrate[(\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(y\)]\(\((
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(z\)]
\*SuperscriptBox[\(E\), 
SuperscriptBox[\((a - 
           x)\), \(3\)]] \[DifferentialD]x)\) \[DifferentialD]z\)\)), \
{y, 0, a}, Assumptions -> {a > 0 && y \[Element] Reals}]

In input-converted form:

Integrate[
 Integrate[Integrate[E^(a - x)^3, {x, 0, z}], {z, 0, y}], {y, 0, a}]

The second equation:

Integrate[
 Integrate[Integrate[E^(a - x)^3, {x, 0, z}], {z, 0, y}], {y, 0, a}, 
 Assumptions -> {a > 0 && Element[y, Reals]}]
$\endgroup$
5
  • 2
    $\begingroup$ Please post Mathematica code as text rather than as images. That will help us diagnose your problem better. $\endgroup$
    – John Doty
    Commented Jun 23, 2021 at 18:09
  • $\begingroup$ I did it, thanks for the feedback. $\endgroup$
    – user80691
    Commented Jun 23, 2021 at 18:27
  • 1
    $\begingroup$ Also please convert your cells to InputForm prior to copy and paste. $\endgroup$
    – Bob Hanlon
    Commented Jun 23, 2021 at 18:31
  • $\begingroup$ I believe I did that, I inserted the InputForm equations as well. $\endgroup$
    – user80691
    Commented Jun 23, 2021 at 18:37
  • $\begingroup$ This is a repeated integral that can be transformed to a 1d integral (I think) $\endgroup$
    – mikado
    Commented Jun 23, 2021 at 19:08

2 Answers 2

3
$\begingroup$

You should be able to use a single call to Integrate:

Integrate[Exp[(a - x)^3], {y, 0, a}, {z, 0, y}, {x, 0, z}]

Integrate[-(a*ExpIntegralE[2/3, -a^3]) + (a - z)*ExpIntegralE[2/3, -(a - z)^3], {y, 0, a}, {z, 0, y}]/3

However, it seems that Mathematica can only partially do this integral as written (note that this was evaluated in Mathematica 12.3, in earlier versions an incorrect result was returned). An alternative is to make use of Region functionality. The region of integration is:

reg = ImplicitRegion[0 < y < a && 0 < x < z && 0 < z < y, {x, y, z}];

Using this region in Integrate:

sol = Integrate[Exp[(a-x)^3], {x, y, z} ∈ reg, Assumptions -> a > 0]

1/6 (-1 + E^a^3)

Let's use NIntegrate to check for a numerical value of a:

NIntegrate[Exp[(3 - x)^3], {y, 0, 3}, {z, 0, y}, {x, 0, z}]
N[sol /. a->3]

8.86747*10^10

8.86747*10^10

$\endgroup$
0
$\begingroup$

Your error is in using the same variable name (e.g., $y$) for the variable of integration AND the integration limit.

A no-no.

This works:

    Assuming[a > 0 && {a, y, z} \[Element] Reals,
 Integrate[E^(a - x)^3, {x, 0, z}, {z, 0, y}, {y, 0, a}]]

Incidentally, you might just perform the trivial $y$ and $z$ integrals separately.

$\endgroup$
2
  • $\begingroup$ Assuming[a > 0, Integrate[Exp[(a - x)^3], {x, 0, a}, {y, 0, y}, {z, 0, z}]] also works.. $\endgroup$
    – Bill Watts
    Commented Jun 23, 2021 at 20:15
  • $\begingroup$ Your integration is still different from the OP's. $\endgroup$
    – Carl Woll
    Commented Jun 23, 2021 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.