<?xml version="1.0" encoding="UTF-8"?>
<Worksheet>
<Version major="12" minor="1"/>
<Label-Scheme value="2" prefix=""/>
<View-Properties presentation="false"></View-Properties>
<MapleNet-Properties elisiondigitsbefore="100" labelling="true" indentamount="4" elisiontermsthreshold="10000" ansi="false" errorbreak="1" useclientjvm="true" echo="1" imaginaryunit="I" labelwidth="20" plotdriver="openviz" elisiondigitsafter="100" plotoutput="terminal" rtablesize="10" elisiontermsbefore="100" elisiondigitsthreshold="10000" typesetting="standard" plotdevice="inline" verboseproc="1" showassumed="1" errorcursor="false" longdelim="true" plotoptions="" quiet="false" elisiontermsafter="100" screenwidth="79" preplot="" prettyprint="3" displayprecision="-1" warnlevel="3" screenheight="25" latexwidth="6.0" postplot="" prompt="&gt; " ShowLabels="true"/>
<Styles><Font name="Ordered List 1" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Annotation Text" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Ordered List 2" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Ordered List 3" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Ordered List 4" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Ordered List 5" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Author" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Annotation Title" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Warning" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Maple Input Placeholder" background="[255,255,255]" bold="true" executable="true" family="Monospaced" foreground="[200,0,200]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="true"/>
<Font name="Maple Plot" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Code" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[255,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Line Printed Output" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Text Output" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Diagnostic" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[40,120,40]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="2D Inert Output" background="[255,255,255]" bold="false" executable="true" family="Times New Roman" foreground="[144,144,144]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Normal" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Hyperlink" background="[255,255,255]" bold="false" executable="false" family="Serif" foreground="[0,128,128]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true" placeholder="false"/>
<Font name="Maple Output" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Dash Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="2D Math" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Maple Input" background="[255,255,255]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="2D Output" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="2D Input" background="[255,255,255]" bold="false" executable="true" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Header and Footer" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="10" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Error" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[255,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Title" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Heading 1" background="[255,255,255]" bold="true" executable="false" family="Serif" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Text" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Bullet Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Equation Label" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Heading 4" background="[255,255,255]" bold="false" executable="false" family="Serif" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Heading 3" background="[255,255,255]" bold="true" executable="false" family="Serif" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="14" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Heading 2" background="[255,255,255]" bold="true" executable="false" family="Serif" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="16" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Font name="Dictionary Hyperlink" background="[255,255,255]" bold="false" executable="false" family="Serif" foreground="[147,0,15]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true" placeholder="false"/>
<Font name="List Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>
<Layout name="Maple Output" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.3" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Ordered List 1" alignment="left" bullet="numeric" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Dash Item" alignment="left" bullet="dash" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Ordered List 2" alignment="left" bullet="alphabetic" firstindent="0" leftmargin="36" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Ordered List 3" alignment="left" bullet="roman" firstindent="0" leftmargin="72" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Ordered List 4" alignment="left" bullet="ALPHABETIC" firstindent="0" leftmargin="108" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Ordered List 5" alignment="left" bullet="ROMAN" firstindent="0" leftmargin="144" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1" bulletsuffix=""/>
<Layout name="Author" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="8" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Warning" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Annotation Title" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="12" spacebelow="12" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Maple Plot" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Error" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Title" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="12" spacebelow="12" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Line Printed Output" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="any" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 1" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="4" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Diagnostic" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="any" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Text Output" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="newline" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Bullet Item" alignment="left" bullet="dot" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 4" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Normal" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 3" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="Heading 2" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="2" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Layout name="List Item" alignment="left" bullet="indent" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0" bulletsuffix=""/>
<Pencil-style name="Pencil 5" pen-color="[255,0,0]" pen-height="5.0" pen-width="5.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 4" pen-color="[0,0,255]" pen-height="3.0" pen-width="3.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 3" pen-color="[0,0,0]" pen-height="3.0" pen-width="3.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 2" pen-color="[0,0,255]" pen-height="1.0" pen-width="1.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 1" pen-color="[0,0,0]" pen-height="1.0" pen-width="1.0" pen-opacity="1.0"/>
<Highlighter-style name="Highlighter 2" pen-color="[255,204,0]" pen-height="14.0" pen-width="14.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 1" pen-color="[255,153,255]" pen-height="12.0" pen-width="8.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 4" pen-color="[0,255,255]" pen-height="32.0" pen-width="32.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 3" pen-color="[51,255,0]" pen-height="24.0" pen-width="24.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 5" pen-color="[255,255,0]" pen-height="48.0" pen-width="48.0" pen-opacity="0.8"/>
</Styles>
<Task-table>
    <Task-category name="&lt;default&gt;">
    </Task-category>
</Task-table>
<Annotation-table>
    <Annotation-category name="&lt;default&gt;">
    </Annotation-category>
</Annotation-table>
<Task>
</Task>
<Group labelreference="L189" drawlabel="true">
<Input>
<Text-field style="Text" layout="Normal">Nick Berger, Tim Roorda, Juan Burgos and Andrew Eisterhold
3D Center of Mass</Text-field>
</Input>
</Group>
<Group labelreference="L7" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group labelreference="L8" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Maplets[Tools]): with(Maplets[Elements]): with(plots):
with(RandomTools):# with(plottools):
StartEngine();</Text-field>
</Input>
</Group>
<Group labelreference="L39" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">randomize():</Text-field>
</Input>
</Group>
<Group labelreference="L202" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">lightorange:=&quot;#FFB300&quot;:
lightcyan:=&quot;#DDFFFF&quot;:</Text-field>
</Input>
</Group>
<Group labelreference="L198" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">ColorFooter:=lightcyan:
FontFooter:=Font(&quot;helvetica&quot;,10):</Text-field>
</Input>
</Group>
<Group labelreference="L200" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L40" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">randx1:=rand(-1..3):
randx2:=rand(1..4):
randtype:=rand(0..1):</Text-field>
</Input>
</Group>
<Group labelreference="L79" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L37" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">ask:=proc()
global f, g, h, a, b, M, Mval, Myz, Mxz, Mxy, Myzval, Mxzval, Mxyval, rho, X, Y, Z, intType, u, v, z, rho1;
local p1, fmin, gmax, hmin, rhomin, dv, pad, f1, g1, h1, f2, g2, p2, ptop, pbot, pfrt, pbck, pright, pleft;
rho:=Generate(polynom(integer(range=-3..3), {u,v,z}, degree=1));
intType:=randtype();
f:=randpoly(u, coeffs=rand(-3..3), degree=2, terms=2);
g:=randpoly(u, coeffs=rand(-3..3), degree=2, terms=2);
h:=randpoly([u,v], coeffs=rand(-3..3), degree=2, terms=2);
while h=0 do
   h:=randpoly([u,v], coeffs=rand(1..3), degree=2, terms=2);
end do;
a:=randx1();
b:=a+randx2();
fmin:=minimize(f, u=a..b);
gmax:=maximize(g, u=a..b);
dv:=fmin-gmax;
if dv&lt;0 then
  f:=f-dv;
end if;
hmin:=minimize(h, u=a..b, v=minimize(g,u=a..b)..maximize(f,u=a..b));
if hmin&lt;0 then
  h:=h-hmin;
end if;
rhomin:=minimize(rho, u=a..b, v=minimize(g,u=a..b)..maximize(f,u=a..b),
      z=0..maximize(h,u=a..b, v=minimize(g,u=a..b)..maximize(f,u=a..b)));
if rhomin&lt;0 then
  rho:=rho-rhomin;
end if;
pad:=(b-a)/5;
if intType=0 then
  f1:=subs(u=x,f); g1:=subs(u=x,g);
  h1:=subs({u=x,v=y},h);
  rho1:=subs({u=x,v=y},rho);
  M:=  Int(Int(Int(  rho1,z=0..h1),y=g1..f1),x=a..b);
  Myz:=Int(Int(Int(x*rho1,z=0..h1),y=g1..f1),x=a..b);
  Mxz:=Int(Int(Int(y*rho1,z=0..h1),y=g1..f1),x=a..b);
  Mxy:=Int(Int(Int(z*rho1,z=0..h1),y=g1..f1),x=a..b);
  <Font encoding="UTF-8">Set(question=sprintf(&quot;Find the center of mass of the solid\134nbelow z = %a above the region\134nbetween y = %a and y = %a\134nfor the interval %a &lt;= x &lt;= %a\134nwith density %a.&quot;,
      h1, f1, g1, a, b, rho1));</Font>
  ptop:=  plot3d([x,y,h1], x=a..b,                       y=g1..f1,           color=green):
  pbot:=  plot3d([x,y,0],  x=a..b,                       y=g1..f1,           color=green):
  pbck:=  plot3d([a,y,z],  y=eval(g1,x=a)..eval(f1,x=a), z=0..eval(h1,x=a),  color=magenta):
  pfrt:=  plot3d([b,y,z],  y=eval(g1,x=b)..eval(f1,x=b), z=0..eval(h1,x=b),  color=magenta):
  pright:=plot3d([x,f1,z], x=a..b,                       z=0..eval(h1,y=f1), color=blue):
  pleft:= plot3d([x,g1,z], x=a..b,                       z=0..eval(h1,y=g1), color=blue):
  Set(graph3d=display([ptop,pbot,pbck,pfrt,pleft,pright], orientation=[-90,0], axes=normal));
else
  f1:=subs(u=y,f); g1:=subs(u=y,g);
  h1:=subs({u=y,v=x},h);
  rho1:=subs({u=y,v=x},rho);
  M:=  Int(Int(Int(  rho1,z=0..h1),x=g1..f1),y=a..b);
  Myz:=Int(Int(Int(x*rho1,z=0..h1),x=g1..f1),y=a..b);
  Mxz:=Int(Int(Int(y*rho1,z=0..h1),x=g1..f1),y=a..b);
  Mxy:=Int(Int(Int(z*rho1,z=0..h1),x=g1..f1),y=a..b);
  <Font encoding="UTF-8">Set(question=sprintf(&quot;Find the center of mass of the solid\134nbelow z = %a above the region\134nbetween x = %a and x = %a\134nfor the interval %a &lt;= y &lt;= %a\134nwith density %a.&quot;,
      h1, f1, g1, a, b, rho1));</Font>
  ptop:=  plot3d([x,y,h1], y=a..b,                       x=g1..f1,           color=green):
  pbot:=  plot3d([x,y,0],  y=a..b,                       x=g1..f1,           color=green):
  pbck:=  plot3d([x,a,z],  x=eval(g1,y=a)..eval(f1,y=a), z=0..eval(h1,y=a),  color=magenta):
  pfrt:=  plot3d([x,b,z],  x=eval(g1,y=b)..eval(f1,y=b), z=0..eval(h1,y=b),  color=magenta):
  pright:=plot3d([f1,y,z], y=a..b,                       z=0..eval(h1,x=f1), color=blue):
  pleft:= plot3d([g1,y,z], y=a..b,                       z=0..eval(h1,x=g1), color=blue):
  Set(graph3d=display([ptop,pbot,pbck,pfrt,pleft,pright], orientation=[-90,0], axes=normal));
end if;
Mval:=value(M);
Myzval:=value(Myz);
Mxzval:=value(Mxz);
Mxyval:=value(Mxy);
X:=value(Myz/M);
Y:=value(Mxz/M);
Z:=value(Mxy/M);
Set(MInt=&quot;&quot;);
Set(MVal=&quot;&quot;);
Set(MxyVal=&quot;&quot;);
Set(MyzVal=&quot;&quot;);
Set(MxzVal=&quot;&quot;);
Set(MxyInt=&quot;&quot;);
Set(MyzInt=&quot;&quot;);
Set(MxzInt=&quot;&quot;);
Set(XCoord=&quot;&quot;);
Set(YCoord=&quot;&quot;);
Set(ZCoord=&quot;&quot;);
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L36" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L1" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkM:=proc()
global Mval;
local userM, userMval;
userM:=Get(MInt::function):
userMval:=Get(MVal::realcons):
if userM=M and userMval=Mval then
  Set(reply=&quot;The mass integral is correct!&quot;)
elif userMConv=M then
  Set(reply=&quot;The mass integral is correct, but the value is wrong. Try again.&quot;)
else
  Set(reply=&quot;The mass integral is wrong. Try again.&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L53" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintM:=proc()
if intType=0 then
Set(MInt=&quot;Int(Int(Int(rho,z = 0 .. h(x,y)),y = f(x) .. g(x)),x = a .. b)&quot;)
else
Set(MInt=&quot;Int(Int(Int(rho,z = 0 .. h(x,y)),x = f(y) .. g(y)),y = a .. b)&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L178" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showM:=proc()
global M, Mval;
Set(MInt=M):
Set(MVal=Mval):
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L180" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L179" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkMyz := proc () 
local userMyz, userMyzval; 
global Myzval;
userMyz := Get(MyzInt::realcons); 
userMyzval := Get(MyzVal::realcons); 
if userMyz=Myz and userMyzval=Myzval then 
   Set(reply=&quot;The Myz integral and value are correct!&quot;) 
elif userMyzConv=Myz then 
   Set(reply=&quot;The Myz integral is correct, but the value is wrong. Try again.&quot;) 
else 
   Set(reply=&quot;The Myz integral is wrong. Try again.&quot;) 
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L183" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintMyz := proc ()
if intType=0 then 
Set(MyzInt = &quot;Int(Int(Int(x*rho,z = 0 .. h(x,y)),y = f(x) .. g(x)),x = a .. b)&quot;)
else
Set(MyzInt = &quot;Int(Int(Int(x*rho,z = 0 .. h(x,y)),x = f(y) .. g(y)),y = a .. b)&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L182" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showMyz:=proc() 
global Myz, Myzval;
Set(MyzInt = Myz); 
Set(MyzVal = Myzval) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L187" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L186" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkX:=proc() 
local userX; 
userX:=Get(XCoord::realcons); 
if userX=X then 
   Set(reply=&quot;Correct x center of mass!&quot;) 
else 
   Set(reply=&quot;Incorrect x center of mass. Try again.&quot;) 
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L184" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintX:=proc () 
Set(XCoord=&quot;Myz/M&quot;) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L185" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showX:=proc () 
Set(XCoord=X) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L54" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L57" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkMxz:=proc()
local userMxz, userMxzval:
global Mxzval:
userMxz:=Get(MxzInt::realcons):
userMxzval:=Get(MxzVal::realcons):
if userMxz=Mxz and userMxzval=Mxzval then
  Set(reply=&quot;The Mxz integral and value are correct!&quot;):
elif userMxzConv=Mxz then
  Set(reply=&quot;The Mxz integral is correct, but the value is wrong. Try again.&quot;):
else
  Set(reply=&quot;The Mxz integral is wrong. Try again.&quot;):
end if:
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L56" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintMxz := proc () 
if intType=0 then
Set(MxzInt = &quot;Int(Int(Int(y*rho,z = 0 .. h(x,y)),y = f(x) .. g(x)),x = a .. b)&quot;)
else
Set(MxzInt = &quot;Int(Int(Int(y*rho,z = 0 .. h(x,y)),x = f(y) .. g(y)),y = a .. b)&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L55" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showMxz := proc () 
global Mxz, Mxzval;
Set(MxzInt = Mxz); 
Set(MxzVal = Mxzval)  
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L193" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L190" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkY:=proc ()
local userY;
userY:=Get(YCoord::realcons);
if userY=Y then
  Set(reply=&quot;Correct y center of mass!&quot;)
else
  Set(reply=&quot;Incorrect y center of mass. Try again.&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L191" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintY := proc () 
Set(YCoord = &quot;Mxz/M&quot;) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L192" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showY := proc () 
Set(YCoord = Y) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L45" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L61" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkMxy := proc () 
local userMxy, userMxyval; 
global Mxyval; 
userMxy := Get(MxyInt::realcons); 
userMxyval := Get(MxyVal::realcons); 
if userMxy=Mxy and userMxyval=Mxyval then 
   Set(reply=&quot;The Mxy integral and value are correct!&quot;) 
elif userMxyConv=Mxy then 
   Set(reply=&quot;The Mxy integral is correct, but the value is wrong. Try again.&quot;) 
else 
   Set(reply=&quot;The Mxy integral is wrong. Try again.&quot;) 
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L63" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintMxy := proc ()
if intType=0 then 
Set(MxyInt = &quot;Int(Int(Int(z*rho,z = 0 .. h(x,y)),y = f(x) .. g(x)),x = a .. b)&quot;)
else
Set(MxyInt = &quot;Int(Int(Int(z*rho,z = 0 .. h(x,y)),x = f(y) .. g(y)),y = a .. b)&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L62" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showMxy:=proc() 
global Mxy, Mxyval;
Set(MxyInt = Mxy); 
Set(MxyVal = Mxyval)   
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L65" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L74" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkZ:=proc ()
local userZ;
userZ:=Get(ZCoord::realcons);
if userZ=Z then
  Set(reply=&quot;Correct z center of mass!&quot;)
else
  Set(reply=&quot;Incorrect z center of mass. Try again.&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L75" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintZ := proc () 
Set(ZCoord = &quot;Mxy/M&quot;) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L76" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showZ := proc () 
Set(ZCoord = Z) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L3502" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L3501" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">Preview:=proc(TFname)
global CurrentTFname;
local expr;
options `Copyright 2004-07, Philip B. Yasskin and Douglas Meade, Maplets for Calculus`;
if Get(TFname)=&quot;&quot; then
  Set(reply=&quot;Please enter an expression to preview.&quot;);
  return;
end if;
CurrentTFname:=TFname;
expr:=Get(TFname::anything, corrections=true, update=true);
Set(TFPreview=expr);
Set(MMLPreview=MathML[Export](expr));
Set(ARunPreview(run)=true);
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L3503" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">Update_Preview:=proc()
global CurrentTFname;
local expr;
options `Copyright 2004-07, Philip B. Yasskin and Douglas Meade, Maplets for Calculus`;
if Get(TFPreview)=&quot;&quot; then
  Set(reply=&quot;Please enter an expression to preview.&quot;);
  return;
end if;
expr:=Get(TFPreview::anything, corrections=true, update=true);
Set(MMLPreview=MathML[Export](expr));
Set(CurrentTFname=expr);
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L73" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L6" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">CenterOfMass:=Maplet(onstartup=RunWindow(MAIN),
Window[MAIN] (title=&quot;Center of Mass of a Plate with Variable Density&quot;,
[ valign=none, inset=0, spacing=0,
  [ Button(&quot;New Problem&quot;, Evaluate(function = &quot;ask&quot;), background=magenta),
    HorizontalGlue(),
    Button(&quot;Quit&quot;, Shutdown(), background=pink)
  ],
  [ halign=none, valign=none,
    [ halign=none, valign=none, inset=0,
      [ halign=none,
        HorizontalGlue(),
        TextBox[question](width=45, height=5, editable=false),
        HorizontalGlue()
      ],
      BoxColumn( valign=none, inset=0, spacing=0, border=true,
        caption=&quot;Find the total mass, M. Enter the integral and value.&quot;,
        [ halign=none,
          &quot;M  =  &quot;, 
          TextBox[MInt](width = 45, height=2, background=turquoise)
        ], 
        [ halign=none,
          &quot;    = &quot;,
          TextField[MVal](width=10, background=turquoise),
          HorizontalGlue(),
          Button(&quot;Template&quot;, Evaluate(function=&quot;hintM&quot;), background=lightorange),
          Button(&quot;Preview&quot;, onclick=APreM, background=yellow),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkM&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showM&quot;), background=lightorange),
          HorizontalGlue()
        ]
      )
    ],
    [ border=true,
      caption=&quot;Rotate the plot with your mouse to see the solid.&quot;,
      Plotter[graph3d](plot3d(0,x=0..6,y=0..6,axes=normal), width=250, height=200)
    ]
  ],
  [ [ valign=none, inset=0, spacing=0, border=true,
      caption=&quot;Find the moment about the yz-plane (integral and value):&quot;,
      [ halign=none,
        &quot;Myz = &quot;,
        TextBox[MyzInt](width=45, height=2, background=turquoise)
      ],
      [ halign=none,
        &quot;    =&quot;,
        TextField[MyzVal](width=10, background=turquoise),
        HorizontalGlue(),
        Button(&quot;Template&quot;, Evaluate(function=&quot;hintMyz&quot;), background=lightorange),
        Button(&quot;Preview&quot;, onclick=APreMyz, background=yellow),
        Button(&quot;Check&quot;, Evaluate(function=&quot;checkMyz&quot;), background=green),
        Button(&quot;Show&quot;, Evaluate(function=&quot;showMyz&quot;), background=lightorange),
        HorizontalGlue()
      ]
    ],
    [ valign=none, inset=0, spacing=0, border=true,
      caption=&quot;Find the x-coordinate of the center of mass:&quot;,
      [ halign=none,
        HorizontalGlue(),
        &quot;X = &quot;,
        TextField[XCoord](width=20, background=turquoise),
        HorizontalGlue()
      ],
      [ halign=none,
        HorizontalGlue(),
        Button(&quot;Template&quot;, Evaluate(function=&quot;hintX&quot;), background=lightorange),
        Button(&quot;Check&quot;, Evaluate(function=&quot;checkX&quot;), background=green),
        Button(&quot;Show&quot;, Evaluate(function=&quot;showX&quot;), background=lightorange),
        HorizontalGlue()
      ]
    ]
  ],
  [
    [ valign=none, inset=0, spacing=0, border=true,
      caption=&quot;Find the moment about the xz-plane (integral and value):&quot;,
      [ halign=none,
        &quot;Mxz = &quot;,
        TextBox[MxzInt](width=45, height=2, background=turquoise)
      ],
      [ halign=none,
        &quot;    =&quot;,
        TextField[MxzVal](width=10, background=turquoise),
        HorizontalGlue(),
        Button(&quot;Template&quot;, Evaluate(function=&quot;hintMxz&quot;), background=lightorange),
        Button(&quot;Preview&quot;, onclick=APreMxz, background=yellow),
        Button(&quot;Check&quot;, Evaluate(function=&quot;checkMxz&quot;), background=green),
        Button(&quot;Show&quot;, Evaluate(function=&quot;showMxz&quot;), background=lightorange),
        HorizontalGlue()
      ]
    ],
    [ valign=none, inset=0, spacing=0, border=true,
      caption=&quot;Find the y-coordinate of the center of mass:&quot;,
      [ halign=none,
        HorizontalGlue(),
        &quot;Y = &quot;,
        TextField[YCoord](width=20, background=turquoise),
        HorizontalGlue()
      ],
      [ halign=none,
        HorizontalGlue(),
        Button(&quot;Template&quot;, Evaluate(function=&quot;hintY&quot;), background=lightorange),
        Button(&quot;Check&quot;, Evaluate(function=&quot;checkY&quot;), background=green),
        Button(&quot;Show&quot;, Evaluate(function=&quot;showY&quot;), background=lightorange),
        HorizontalGlue()
      ]
    ]
  ],
  [ 
    [ valign=none, inset=0, spacing=0, border=true,
      caption=&quot;Find the moment about the xy-plane (integral and value):&quot;,
      [ halign=none,
        &quot;Mxy = &quot;,
        TextBox[MxyInt](width=45, height=2, background=turquoise)
      ],
      [ halign=none,
        &quot;    =&quot;,
        TextField[MxyVal](width=10, background=turquoise),
        HorizontalGlue(),
        Button(&quot;Template&quot;, Evaluate(function=&quot;hintMxy&quot;), background=lightorange),
        Button(&quot;Preview&quot;, onclick=APreMxy, background=yellow),
        Button(&quot;Check&quot;, Evaluate(function=&quot;checkMxy&quot;), background=green),
        Button(&quot;Show&quot;, Evaluate(function=&quot;showMxy&quot;), background=lightorange),
        HorizontalGlue()
      ]
    ],
    [ valign=none, inset=0, spacing=0, border=true,
      caption=&quot;Find the z-coordinate of the center of mass:&quot;,
      [ halign=none,
        HorizontalGlue(),
        &quot;Z = &quot;,
        TextField[ZCoord](width=20, background=turquoise),
        HorizontalGlue()
      ],
      [ halign=none,
        HorizontalGlue(),
        Button(&quot;Template&quot;, Evaluate(function=&quot;hintZ&quot;), background=lightorange),
        Button(&quot;Check&quot;, Evaluate(function=&quot;checkZ&quot;), background=green),
        Button(&quot;Show&quot;, Evaluate(function=&quot;showZ&quot;), background=lightorange),
        HorizontalGlue()
      ]
    ]
  ],
  [ TextField[reply](width=60)
  ],
  [ halign=none, background=ColorFooter,
    Label(&quot;Programmers: Sarah Mannen, Nick Berger, Tim Roorda, Juan Burgos and Andrew Eisterhold&quot;, font=FontFooter),
    HorizontalGlue(),
    Label(&quot;Copyright: P. Yasskin 2008&quot;, font=FontFooter)
  ]
]),
Window[PREVIEW]( title=&quot;Preview&quot;, defaultbutton=UpdatePreview, 
[ halign=none,
  [ TextField[TFPreview](width=50, background=turquoise),
    Button[UpdatePreview](&quot;Update&quot;, Evaluate(function=&quot;Update_Preview&quot;), background=lightorange),
    Button[ClosePreview](&quot;Close&quot;, CloseWindow(PREVIEW), background=pink)
  ],
  [ MathMLViewer[MMLPreview](value=MathML[Export](&quot;&quot;), width=500, height=100)
  ]
]),
Action[APreM](Evaluate(function=&quot;Preview(MInt)&quot;)),
Action[APreMyz](Evaluate(function=&quot;Preview(MyzInt)&quot;)),
Action[APreMxz](Evaluate(function=&quot;Preview(MxzInt)&quot;)),
Action[APreMxy](Evaluate(function=&quot;Preview(MxyInt)&quot;)),
Action[ARunPreview](RunWindow(PREVIEW))
):</Text-field>
</Input>
</Group>
<Group labelreference="L4" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">Maplets[Display](CenterOfMass);</Text-field>
</Input>
</Group>
<Group labelreference="L194" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Worksheet>
