# Evaluate a double integral over a region [duplicate]

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$

• Have you looked at Integrate? Also, is it supposed to be $y<=x^{2}$ and $y>=x^{3}$. – Edmund Dec 10 '15 at 15:47
• @Nehorai, did you see that question? – garej Dec 10 '15 at 15:48
• @garej Yes,I saw this I'm very new in Mathematica so I started with this f[x_,y_]=x^4+y^2; Integrate[f[x,y]*Boole[]] – 3SAT Dec 10 '15 at 15:50
• but how can I input the region? – 3SAT Dec 10 '15 at 15:52
• @Nehorai, i.e. this way: Integrate[f[x, y]*Boole[{y < x^2 && y > x^3}], {x, 0, 1}, {y, 0, 10}]. – garej Dec 10 '15 at 16:17

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

$$\int_0^1 dy \int_{y^{1/2}}^{y^{1/3}} dy \,\, x^4+y^2$$

Integrate[x^4 + y^2, {y, 0, 1}, {x, y^(1/2), y^(1/3)}]
(* 9/280 *)

• Change the order of integration with respect to 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
• What do you mean get different values, 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
• Something like this Integrate[x^4 + y^2, {y, x^3, x^2}, {x, 0, 1}]. – Artes Dec 10 '15 at 16:16
• @Artes, I see your point, modified the answer. The question linked to in the comments above uses 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 technical difficulties Dec 10 '15 at 16:48