Problem 25 in Section 16.3

Recall that in this problem we are studying the pyramid bounded by the planes z=-6, y=0, y-x = 4 and 2 x+y+z = 4. In class we calculated all the vertices of this pyramid. Now I will calculate them in Mathematica

eqs={z==-6,y==0,y-x==4,2 x+y+z==4}

Each vertex is at the intersection of three planes. So, I solve three of the four equations and get four vertices.

pP1={x,y,z}/.Solve[{z==-6,y==0,y-x==4},{x,y,z}][[1]]

pP2={x,y,z}/.Solve[{z==-6,y==0,2 x+y+z==4},{x,y,z}][[1]]

pP3={x,y,z}/.Solve[{z==-6,y-x==4,2 x+y+z==4},{x,y,z}][[1]]

pP4={x,y,z}/.Solve[{y==0,y-x==4,2 x+y+z==4},{x,y,z}][[1]]

Plot these points:

Graphics3D[{
{PointSize[0.02],Point[pP1],Point[pP2],Point[pP3],Point[pP4]},
{Opacity[0.3],Polygon[{pP1,pP2,pP3}],Polygon[{pP1,pP2,pP4}],Polygon[{pP1,pP4,pP3}],Polygon[{pP4,pP2,pP3}]},
{Thickness[0.01],Cyan,Line[{pP1,pP2}],Green,Line[{pP1,pP3}],Blue,Line[{pP2,pP3}],Red,Line[{pP1,pP4}],Magenta,Line[{pP2,pP4}],Yellow,Line[{pP3,pP4}]},
{Text[(Subscript[P, 1]),pP1,{1,1}],Text[(Subscript[P, 2]),pP2,{-1,1}],Text[(Subscript[P, 3]),pP3,{-1,-1}],Text[(Subscript[P, 4]),pP4,{-1,-1}]}
},
PlotRange->{{-5,6},{-1,8},{-7,13}},Axes->True,BoxRatios->{11,9,20},AxesLabel->{x,y,z}]

There are 6 lines of interest

Cyan

liC={x,y,z}/.Solve[{z==-6,y==0},{x,y,z}][[1]]

Green

liG={x,y,z}/.Solve[{z==-6,y-x==4},{x,y,z}][[1]]

Blue

liB={x,y,z}/.Solve[{z==-6,2 x+y+z==4},{x,y,z}][[1]]

Red

liR={x,y,z}/.Solve[{y==0,y-x==4},{x,y,z}][[1]]

Magenta

liM={x,y,z}/.Solve[{y==0,2 x+y+z==4},{x,y,z}][[1]]

Yellow

liY={x,y,z}/.Solve[{y-x==4,2 x+y+z==4},{x,y,z}][[1]]

How to integrate? (easier way)

How to integrate? Fix y to be y0 and find the corresponding points on Green, Blue and Yellow lines

liG

liB

liY

liG/.Solve[liG[[2]]==y0,x][[1]]

liB/.Solve[liB[[2]]==y0,x][[1]]

liY/.Solve[liY[[2]]==y0,x][[1]]

y0=2.5;pPG={-4+y0,y0,-6};pPB={((10-y0)/2),y0,-6}; pPY={-4+y0,y0,-3 (-4+y0)};

Graphics3D[{
{PointSize[0.02],Point[pP1],Point[pP2],Point[pP3],Point[pP4]},
{Opacity[0.3],Polygon[{pP1,pP2,pP3}],Polygon[{pP1,pP2,pP4}],Polygon[{pP1,pP4,pP3}],Polygon[{pP4,pP2,pP3}]},
{Thickness[0.01],Cyan,Line[{pP1,pP2}],Green,Line[{pP1,pP3}],Blue,Line[{pP2,pP3}],Red,Line[{pP1,pP4}],Magenta,Line[{pP2,pP4}],Yellow,Line[{pP3,pP4}]},{Text[(Subscript[P, 1]),pP1,{1,1}],Text[(Subscript[P, 2]),pP2,{-1,1}],Text[(Subscript[P, 3]),pP3,{-1,-1}],Text[(Subscript[P, 4]),pP4,{-1,-1}]},
{Polygon[{pPG,pPB,pPY}]}

},
PlotRange->{{-5,6},{-1,8},{-7,13}},Axes->True,BoxRatios->{11,9,20},AxesLabel->{x,y,z}]

Clear[y0]; Manipulate[pPG={-4+y0,y0,-6};pPB={((10-y0)/2),y0,-6}; pPY={-4+y0,y0,-3 (-4+y0)};

Graphics3D[{
{PointSize[0.02],Point[pP1],Point[pP2],Point[pP3],Point[pP4]},
{Opacity[0.3],Polygon[{pP1,pP2,pP3}],Polygon[{pP1,pP2,pP4}],Polygon[{pP1,pP4,pP3}],Polygon[{pP4,pP2,pP3}]},
{Thickness[0.01],Cyan,Line[{pP1,pP2}],Green,Line[{pP1,pP3}],Blue,Line[{pP2,pP3}],Red,Line[{pP1,pP4}],Magenta,Line[{pP2,pP4}],Yellow,Line[{pP3,pP4}]},{Text[(Subscript[P, 1]),pP1,{1,1}],Text[(Subscript[P, 2]),pP2,{-1,1}],Text[(Subscript[P, 3]),pP3,{-1,-1}],Text[(Subscript[P, 4]),pP4,{-1,-1}]},
{Polygon[{pPG,pPB,pPY}]}

},
PlotRange->{{-5,6},{-1,8},{-7,13}},Axes->True,BoxRatios->{11,9,20},AxesLabel->{x,y,z}],
{{y0,2},0,6}]

Integrate[Integrate[Integrate[1,{z,-6,4-2 x-y}],{x,y-4,((10-y)/2)}],{y,0,6}]

How to integrate? (harder way)

How to integrate? Fix z to be z0 and find the corresponding points on Red, Magenta and Yellow lines

liR

liM

liY

liR/.Solve[liR[[3]]==z0,z][[1]]

liM/.Solve[liM[[3]]==z0,x][[1]]

liY/.Solve[liY[[3]]==z0,x][[1]]

Clear[z0]; Manipulate[pPR={-4,0,z0};pPM={((4-z0)/2),0,z0}; pPY1={-(z0/3),4-(z0/3),z0};

Graphics3D[{
{PointSize[0.02],Point[pP1],Point[pP2],Point[pP3],Point[pP4]},
{Opacity[0.3],Polygon[{pP1,pP2,pP3}],Polygon[{pP1,pP2,pP4}],Polygon[{pP1,pP4,pP3}],Polygon[{pP4,pP2,pP3}]},
{Thickness[0.01],Cyan,Line[{pP1,pP2}],Green,Line[{pP1,pP3}],Blue,Line[{pP2,pP3}],Red,Line[{pP1,pP4}],Magenta,Line[{pP2,pP4}],Yellow,Line[{pP3,pP4}]},{Text[(Subscript[P, 1]),pP1,{1,1}],Text[(Subscript[P, 2]),pP2,{-1,1}],Text[(Subscript[P, 3]),pP3,{-1,-1}],Text[(Subscript[P, 4]),pP4,{-1,-1}]},
{Thickness[0.01],Cyan,Line[{pPR,pPM}],Green,Line[{pPR,pPY1}],Blue,Line[{pPM,pPY1}]},
{PointSize[0.02],Point[pPR],Point[pPM],Point[pPY1]},
{Polygon[{pPR,pPM,pPY1}]}

},
PlotRange->{{-5,6},{-1,8},{-7,13}},Axes->True,BoxRatios->{11,9,20},AxesLabel->{x,y,z}],
{{z0,2},-6,12}]

Recall

pPY1={-(z0/3),4-(z0/3),z0}

So, y is between 0 and 4-(z/3).

Recall, the green and blue line, but now change them to be at the level z0

Green

liGz={x,y,z}/.Solve[{z==z0,y-x==4},{x,y,z}][[1]]

Blue

liBz={x,y,z}/.Solve[{z==z0,2 x+y+z==4},{x,y,z}][[1]]

Integrate[Integrate[Integrate[1,{x,y-4,((4-y-z)/2)}],{y,0,4-(z/3)}],{z,-6,12}]