# Computation time unexpectedly long for a Volume

The command is

Volume[Region[ImplicitRegion[{Sqrt[x^2+y^2]<=Abs[Sin[z]],0<=z<=2Pi},{x,y,z}]]]


The computation time is exceeding my expectation. The Integral is solvable by hand (I don't want to say I'm better than the kernel $$\tiny \text{lol}$$, just that it's solvable).

E.g. the command

Volume[Region[ImplicitRegion[{Sqrt[x^2+y^2]<=Abs[z],0<=z<=2Pi},{x,y,z}]]]


results in $$\tfrac{8\pi^4}{3}$$.

Question: Is it normal that the kernel is taking so long to compute? If not, why is it stuck?

Attempt: My guess is that sin is somehow causing the problem, but I don't know why it would.

• Just for info. reg = ImplicitRegion[{Sqrt[x^2 + y^2] <= Sin[z], 0 <= z <= Pi}, {x, y, z}];Volume[reg] // Timing results in {915.422, 4.92673} (13,3,1 on Windows 10). Sep 22 at 20:27

If I replace 0 by 0. in your inequality for z, it completes fairly quickly.

In:= Volume[
Region[ImplicitRegion[{Sqrt[x^2 + y^2] <= Abs[Sin[z]],
0. <= z <= 2 Pi}, {x, y, z}]]]

(* Out= 9.8696 *)


Using 0. instead of 0 converts this to a numerical problem, instead of asking for a symbolic solution, which may take a very long time to compute.

For revolution 3D, it is recommend to help Mathematica to calculate its volume by the formula, that is, for every 2D region reg, we rotate it around the InfiniteLine[{{0, 0}, {0, 1}}] to get 3D revolution,to calculate the volume,we accumulate the 2D ring for all point {x,y} in the 2D region.

revolutionVolume[reg_] :=
Integrate[
2 π*RegionDistance[InfiniteLine[{{0, 0}, {0, 1}}]]@{x, y}, {x,
y} ∈ reg]

• 2D regions.
reg1 = ImplicitRegion[{0 <= x <= y, 0 <= y <= 2 π}, {x, y}];
reg2 = ImplicitRegion[{0 <= x <= Abs[Sin[y]], 0 <= y <= 2 π}, {x,
y}];
reg3 = Disk[{0, 0}, 1, {-π/2, π/2}];

RegionPlot[#, AspectRatio -> Automatic] & /@ {reg1, reg2, reg3}

revolutionVolume /@ {reg1, reg2, reg3} {(8 π^4)/3, π^2, (4 π)/3}

\$Version

(* "13.3.1 for Mac OS X ARM (64-bit) (July 24, 2023)" *)

Clear["Global*"]

RegionPlot3D[Sqrt[x^2 + y^2] <= Abs[Sin[z]],
{x, -1, 1}, {y, -1, 1}, {z, 0, 2 Pi},
BoxRatios -> {1, 1, Pi}] rgn = ImplicitRegion[{Sqrt[x^2 + y^2] <= Abs[Sin[z]], 0 <= z <= 2 Pi},
{x, y, z}];


Calculate the volume using less than infinite precision

(vol = Volume[rgn, WorkingPrecision -> 17] // N) // AbsoluteTiming

(* {9.39592, 9.8696} *)

vol = RootApproximant[vol/Pi^2]*Pi^2

(* π^2 *)
`