How can I do it on Mathematica 9?
Ex: integral of sqrt(4-x^2-y^2) dy dx where x^2+y^2-2*x<=0.
Doing the same thing numerically (using NIntegrate) gives the result 19.9868 in 0.34 s. (Mathematica 10.0, Windows 8.1). Actually the result has a tiny imaginary part 5.5 *10^-24 as an artifact of the numerical method ('numerical noise').
Looking at my messy result, it is actually a sum of several integrals which Mathematica returned unevaluated.
Where do you get the z from?
1722 seconds on my laptop, for a very messy result. I wonder if we're solving the same integral.
Timing[ Integrate[(x^2 + y^2)*Boole[(x - z)^2 + (y - z)^2 <= 1], {x, -1, 3}, {y, -1, 3}, {z, 0, 2}] ]
took 11.5 seconds on my computer.
Me too, but it's an interesting 3D problem.
Integrate[(x^2 + y^2)*Boole[(x - z)^2 + (y - z)^2 <= 1], {x, -1, 3}, {y, -1, 3}, {z, 0, 2}]. I left my notebook computing about a half an hour and nothing happened.
Wow! Very good. Thanks!
In[1]:= Integrate[ Sqrt[4 - x^2 - y^2]* Boole[x^2 + y^2 - 2 x <= 0], {x, -\[Infinity], \[Infinity]}, {y, -\[Infinity], \[Infinity]}] Out[1]= 8/9 (-4 + 3 \[Pi])