3

In a cube of side "a", a sphere with center in one of the vertices intersects another sphere located in the vertex opposite to the previous one. What is the volume of the intersection?

First I tried to draw the situation The equation of one of the spheres centered at the origin is

$$x^2+y^2+z^2 =a^2$$ And the one located on the opposite vertex will be

$$(x-a)^2+(y-a)^2+(z-a)^2 =a^2$$

2 questions How to plot the situation? How to calculate the common volume?

I used several commands but I did not get the cube and the 2 spheres at the same time in a drawing

Thanks in advance

Edited: There was an error in the radios of the spheres, they have radius "a", similar to the edges of the cube

susy diaz
  • 77
  • 4
  • Try this: RegionIntersection[Ball[{0, 0, 0}, 3], Ball[{1, 1, 1}, 3]] // Volume – Anjan Kumar Apr 22 '17 at 01:12
  • "Unable to compute the volume of region
    RegionIntersection[Ball[{0,0,0},3],Ball[{1,1,1},3]]" :(
    – susy diaz Apr 22 '17 at 01:38
  • Note that your problem statement mentions nothing about the radius. Are you sure that's all you've been given? – J. M.'s missing motivation Apr 22 '17 at 01:51
  • Edited: There was an error in the radios of the spheres, they have radius "a", similar to the edges of the cube – susy diaz Apr 22 '17 at 02:11
  • c = {1, 1, 1}; Show[ContourPlot3D[{(x - 1)^2 + (y - 1)^2 + (z - 1)^2 == 1, x^2 + y^2 + z^2 == 1}, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}, ContourStyle -> Opacity[0.5], Mesh -> None], Graphics3D[{Red, PointSize[0.04], Point[{{0, 0, 0}, c}], Line[{{0, 0, 0}, c}]}]] --> This is the idea Similar code in forum As I get the whole spheres, and the volume – susy diaz Apr 22 '17 at 02:49

1 Answers1

4

For the plotting - with a equal to 1:

Graphics3D[{Opacity[0.3], Green, Ball[], Red, Ball[{1, 1, 1}], 
  Opacity[0.6], Blue, Cuboid[]}]

enter image description here

As suggested by J.M., it is possible to derive a symbolic expression for the region using

region = Simplify[RegionMember[RegionIntersection[
    Ball[], Ball[{1, 1, 1}]], {x, y, z}], {x, y, z} ∈ Reals]

x^2 + y^2 + z^2 <= 1 && (-1 + x)^2 + (-1 + y)^2 + (-1 + z)^2 <= 1

which is the same as the OPs expression with a=1.

To plot just the intersection:

RegionPlot3D[region, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, PlotPoints -> 100]

enter image description here

To find the volume, integrate over the region of intersection:

NIntegrate[Boole[region], {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]

0.107742
LCarvalho
  • 9,233
  • 4
  • 40
  • 96
bill s
  • 68,936
  • 4
  • 101
  • 191