# How to plot and find the volume of a solid enclosed by surfaces? [closed]

I'm a beginner with both Mathematica and multi-variable calculus. I want to plot and find the volume of the solid enclosed by the surfaces defined by

\begin{eqnarray} x^2+y^2 = & 4 \cr x-y+2z = & 4 \cr x = & 0 \cr y = & 0 \cr z = & 0 \cr \end{eqnarray}

Every time I see an equation where $z = 0$, I'm unable to interpret it in 3D form. Help will be much appreciated.

• @ Sam202: something like this? RegionPlot3D[ ImplicitRegion[ x^2 + y^2 <= 4 && x - y + 2 z <= 4 && 0 < x < 4 && 0 < y < 4 && 0 < z < 4, {x, y, z}]] – Dr. Wolfgang Hintze Sep 18 '15 at 8:18
• There are many ways to do this. Please post your code so we can see how you tried to do it. – C. E. Sep 18 '15 at 8:57

There are a number of ways to do this. Sometimes use of Reduce simplifies the constraints but as Dr Hintze's comment shows Mathematica handles boolean statements well.

To illustrate:

reg = Reduce[
0 <= x^2 + y^2 <= 4 && x - y + 2 z <= 4 && z >= 0 && y >= 0 &&
x >= 0, {x, y, z}]


Visualizing region and enclosing planes and cylinder:

rp = RegionPlot3D[reg, {x, 0, 2}, {y, 0, 2}, {z, 0, 3},
PlotPoints -> 100, MaxRecursion -> 5, Mesh -> False]

con[p_] :=
Graphics3D[{Opacity[p], Cylinder[{{0, 0, 0}, {0, 0, 3}}, 2],
InfinitePlane[{#1, #2, (4 - #1 + #2)/2} & @@@ {{1, 0}, {0, 1}, {1,
1}}], InfinitePlane[{0, 0, 0}, {{1, 0, 0}, {0, 1, 0}}],
InfinitePlane[{0, 0, 0}, {{0, 0, 1}, {0, 1, 0}}],
InfinitePlane[{0, 0, 0}, {{1, 0, 0}, {0, 0, 1}}]},
PlotRange -> {{0, 2}, {0, 2}, {0, 3}}];
Manipulate[Show[rp, con[p]], {p, 0, 1}]


You can calculate volumes in a number of ways, e.g.

r = ImplicitRegion[reg, {{x, 0, 2}, {y, 0, 2}, {z, 0, 3}}];
Integrate[1, {x, 0, 2}, {y, 0, Sqrt[4 - x^2]}, {z, 0, (4 - x + y)/2}]
Integrate[1, {x, y, z} ∈ r]
Volume[r]


All yield $2\pi$.