How to check in Wolfram|Alpha double integral?

integ.JPG

D: x=y^2 and x-y=2

Plot[{x^2, x + 2}, {x, 0, 3}]
Integrate[x + 2 - x^2, {x, 0, 2}]

it’s wrong, another shape is bounded by these lines.
y^2=x and x-y=2

Does this match what you expect?

Integrate[Integrate[y^2,{x,xlow(y),xhigh(y)}],{y,ylow,yhigh}]

so

Integrate[Integrate[y^2,{x,y^2,2+y}],{y,-1,2}]

Giving exactly that to either WolframAlpha or to Mathematica returns 63/20==3.15

It is also possible to do the same with

Integrate[y^2,{y,-1,2},{x,y^2,2+y}]

but the y and x must be given in exactly that order if you use that form.

As a check, If you are using Mathematica or other calculation tools then it is possible to calculate a crude manual approximation of this

total=0;d=1/100;
For[y=-1,y<=2,y=y+d,
  For[x=y^2,x<=2+y,x=x+d,
    total=total+y^2*d^2
]];
total//N

which returns

3.1652

and that is approximately the same as the result from the integration and smaller values for d will give better approximations..

But after doing that be sure to tell Mathematica to forget the cached assigned values to x and y with

x=.;y=.;

before doing further Integrate which do not expect to have x or y have been assigned values.

  1. you didn’t specify your problem exactly

  2. I interchanged x and y, So your figure is basically the same as my region

  3. Try

    Plot[{x^2, x + 2}, {x, -2, 3}]
    Integrate[x + 2 - x^2, {x, -1, 2}]

Thx you for your answers!!

Here is another approach

Integrate[Integrate[1, {x, y^2, y + 2}], {y, -1, 2}]

Or did you mean this?

Integrate[Integrate[y^2, {x, y^2, y + 2}], {y, -1, 2}]