How can I evaluate a double integral over a region in Mathematica?
For example
$\qquad \iint(x^4+y^2)\,dx\,dy$
for the bounded region $y=x^2$ and $y=x^3$
How can I evaluate a double integral over a region in Mathematica?
For example
$\qquad \iint(x^4+y^2)\,dx\,dy$
for the bounded region $y=x^2$ and $y=x^3$
In this case, we can look at the region in question and figure it out. The only closed region to integrate would be between x=0 and x=1,
Plot[{x^2, x^3}, {x, 0, 1}, Filling -> {1 -> {2}}]
So you can restrict the x range of the integral to {0,1}, and then the limits for the y integral are the lower and upper curve,
$$ \int_0^1 dx \int_{x^3}^{x^2} dy \,\, x^4+y^2 $$
Integrate[x^4 + y^2, {x, 0, 1}, {y, x^3, x^2}]
(* 9/280 *)
As pointed out by Artes, the order of integration can be reversed, by writing it as such:
$$ \int_0^1 dy \int_{y^{1/2}}^{y^{1/3}} dx \,\, x^4+y^2 $$
Integrate[x^4 + y^2, {y, 0, 1}, {x, y^(1/2), y^(1/3)}]
(* 9/280 *)
x and y and you'll get different values. So I don't find your answer sufficiently rigorous. I'd rather mention somtheing like here Integrate not restricting variable with Assumptions option?. By the way, isn't it a duplicate?
– Artes
Dec 10 '15 at 16:11
Integrate[x^4 + y^2, {x, 0, 1}, {y, x^3, x^2}] == Integrate[Integrate[x^4 + y^2, {y, x^3, x^2}], {x, 0, 1}] evaluates to True. Edit: um, forget I said that, since Mma actually evaluates the limits in reverse order
– Jason B.
Dec 10 '15 at 16:15
Boole in the answer, which is overkill in this situation, in my opinion.
– Jason B.
Dec 10 '15 at 16:27
Integrate[x^4 + y^2, {x, y} ∈ ImplicitRegion[x^3 < y < x^2 && x > 0, {x, y}]] is an alternative.
– J. M.'s missing motivation
Dec 10 '15 at 16:48
Integrate? Also, is it supposed to be $y<=x^{2}$ and $y>=x^{3}$. – Edmund Dec 10 '15 at 15:47Integrate[f[x, y]*Boole[{y < x^2 && y > x^3}], {x, 0, 1}, {y, 0, 10}]. – garej Dec 10 '15 at 16:17