3
$\begingroup$
ImplicitRegion[z >= x^2 + y^2 && x^2 + y^2 + z^2 <= 6, {x, y, z}] // RegionBoundary // Area

This code returns 20.23041621162892 which isn't a symbolic number. So how to calculate it without use some math transformations?

It takes longer than 2 min but without returning a result in 11.3

$\endgroup$
5
$\begingroup$

Just split the steps.

ImplicitRegion[
  z == x^2 + y^2 && x^2 + y^2 + z^2 <= 6, {x, y, z}] // Area

gives

$$ \frac{13 \pi }{3} $$

ImplicitRegion[
  z >= x^2 + y^2 && x^2 + y^2 + z^2 == 6, {x, y, z}] // Area

gives

$$ -4 \left(\sqrt{6}-3\right) \pi $$

enter image description here

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ In Mathematica v12(Windows64) your version is much slower (32s) than the version @wuyudi intends to speed up (0.4s) ! $\endgroup$ – Ulrich Neumann Jun 29 at 10:31
  • $\begingroup$ @UlrichNeumann ,thx for pointing out that, RegionBoundary seems not so useful in this case. $\endgroup$ – wuyudi Jun 29 at 10:54
  • $\begingroup$ And this two results add up to $20.531\dots$ instead of $20.236\dots$ $\endgroup$ – SneezeFor16Min Jun 29 at 11:22
  • $\begingroup$ @wuyudi No , the RegionBoundary-version seems to be much faster! $\endgroup$ – Ulrich Neumann Jun 29 at 11:32
  • 1
    $\begingroup$ @wuyudi I usually say something like "I let it run for 10 minutes and then aborted it." It wasn't clear what "really slow" meant. Sometimes it's 1 second (compared to a millisecond, that's really slow) and so on. $\endgroup$ – Michael E2 Jun 29 at 15:16
5
$\begingroup$

For semialgebraic regions we can express the boundary as disjoint pieces through the third argument of CylindricalDecomposition. We can then find the area of each piece and sum.

OrList[HoldPattern[Or][args__]] := {args}
OrList[expr_] := expr

expr = z >= x^2 + y^2 && x^2 + y^2 + z^2 <= 6;

bdcomps = OrList[BooleanConvert[CylindricalDecomposition[expr, {x, y, z}, "Boundary"]]];

acomps = With[{reg = ImplicitRegion[#, {x, y, z}]},
  If[RegionDimension[reg] == 2, Area[reg], 0]
] & /@ bdcomps;

Simplify[Total[acomps]]
(49/3 - 4Sqrt[6])π
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.