<?xml version="1.0" encoding="UTF-8"?>
<Worksheet>
<Version major="11" minor="1"/>
<Label-Scheme value="2" prefix=""/>
<View-Properties presentation="false"></View-Properties>
<MapleNet-Properties warnlevel="3" longdelim="true" plotoptions="" echo="1" errorcursor="false" elisiontermsthreshold="10000" elisiontermsbefore="100" errorbreak="1" prettyprint="3" prompt="&gt; " latexwidth="6.0" useclientjvm="true" ansi="false" screenheight="25" labelwidth="20" plotdevice="inline" typesetting="standard" displayprecision="-1" indentamount="4" elisiondigitsthreshold="10000" quiet="false" plotoutput="terminal" rtablesize="10" preplot="" showassumed="0" plotdriver="openviz" elisiontermsafter="100" labelling="true" postplot="" screenwidth="79" elisiondigitsbefore="100" elisiondigitsafter="100" verboseproc="1" imaginaryunit="I" ShowLabels="true"/>
<Styles><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="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="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="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="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="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="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="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="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="Page Number" 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="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="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="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="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="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="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 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="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="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="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="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="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="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"/>
<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="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="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="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="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="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="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="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="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="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="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"/>
<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="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="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="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="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="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="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="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="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="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="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="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="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="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=""/>
<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="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="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="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="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="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="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="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="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=""/>
<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 1" pen-color="[0,0,0]" pen-height="1.0" pen-width="1.0" pen-opacity="1.0"/>
<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 2" pen-color="[0,0,255]" pen-height="1.0" pen-width="1.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"/>
<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 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 1" pen-color="[255,153,255]" pen-height="12.0" pen-width="8.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="L1" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
</Group>
<Group labelreference="L2" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Maplets[Tools]): with(Maplets[Elements]): with(plots): with(RandomTools): with(plottools):</Text-field>
</Input>
</Group>
<Group labelreference="L3" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">StartEngine();</Text-field>
</Input>
</Group>
<Group labelreference="L28" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">randomize():</Text-field>
</Input>
</Group>
<Group labelreference="L30" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">randx1:=rand(0..4):
randx2:=rand(1..5):
randtype:=rand(0..1):</Text-field>
</Input>
</Group>
<Group labelreference="L35" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">ask:=proc()
global f, g, a, b, M, Mval, My, Mx, Mxval, Myval, rho, X, Y, intType, u, v, rho1;
local p1, fmin, gmax, rhomin, dv, pad, f1, g1, f2, g2, p2;
rho:=Generate(polynom(integer(range=-3..3), {u,v}, degree=1));
intType:=randtype();
 f:=Generate(polynom(integer(range=-3..3), u, degree=2));
 g:=Generate(polynom(integer(range=-3..3), u, degree=2));
 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;
 rhomin:=minimize(rho, u=a..b, v=minimize(g,u=a..b)..maximize(f,u=a..b));
 if rhomin&lt;0 then
   rho:=rho-rhomin;
 end if;
 M:=Int(Int(rho,v=g..f),u=a..b);
if intType=0 then
My:=Int(Int(u*rho,v=g..f),u=a..b);
Mx:=Int(Int(v*rho,v=g..f),u=a..b);else
My:=Int(Int(v*rho,v=g..f),u=a..b);
Mx:=Int(Int(u*rho,v=g..f),u=a..b);
end if;
 pad:=(b-a)/5;
if intType=0 then
 f1:=subs(u=x,f); g1:=subs(u=x,g);
 rho1:=subs({u=x,v=y},rho);
 Set(question=cat(&quot;Find the center of mass of the region between y = &quot;,
   convert(f1,string),&quot; and y = &quot;,convert(g1,string),&quot; for the interval &quot;,a,&quot; &lt;= x &lt;= &quot;,
   b,&quot; with density &quot;,convert(rho1,string),&quot;.&quot;));
 p1:=densityplot(-rho1,x=a..b,y=g1..f1,color=green);
 Set(graph=display(p1, view=[a-pad..b+pad, default]));
else
 f1:=subs(u=y,f); g1:=subs(u=y,g);
 f2:=subs(u=x,f); g2:=subs(u=x,g);
 rho1:=subs({u=y,v=x},rho);
 Set(question=cat(&quot;Find the center of mass of the region between x = &quot;,
   convert(f1,string),&quot; and x = &quot;,convert(g1,string),&quot; for the interval &quot;,a,&quot; &lt;= y &lt;= &quot;,
   b,&quot; with density &quot;,convert(rho1,string),&quot;.&quot;));
 p2:=densityplot(-rho1, x=a..b, y=g2..f2, color=green);
 p1:=reflect(p2, [[0,0], [1,1]]);
 p1:=subs(PLOT3D = PLOT, p1);
 Set(graph=display(p1, view=[default, a-pad..b+pad]));
end if;
Mval:=value(M);
Myval:=value(My);
Mxval:=value(Mx);
X:=value(My/M);
Y:=value(Mx/M);
Set(MInt=&quot;&quot;);
Set(MVal=&quot;&quot;);
Set(MxInt=&quot;&quot;);
Set(MxVal=&quot;&quot;);
Set(MyInt=&quot;&quot;);
Set(MyVal=&quot;&quot;);
Set(XCoord=&quot;&quot;);
Set(YCoord=&quot;&quot;);
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L9" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkM:=proc()
global Mval;
local userM, userMval, userMConv;
userM:=Get(MInt::function):
userMval:=Get(MVal::realcons):
if intType=0 then
  userMConv:=subs({x=u,y=v},userM);
else
  userMConv:=subs({y=u,x=v},userM);
end if;
if userMConv=M and userMval=Mval then
  Set(response=&quot;Correct!&quot;)
elif userMConv=M then
  Set(response=&quot;The integral is correct, but the value is wrong. Try again.&quot;)
else
  Set(response=&quot;The integral is wrong. Try again.&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L10" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintM:=proc()
if intType=0 then
Set(MInt=&quot;Int(Int(rho,y=f(x)..g(x)),x=a..b)&quot;)
else
Set(MInt=&quot;Int(Int(rho,x=f(y)..g(y)),y=a..b)&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L11" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showM:=proc()
global Mval;
local MConv;
if intType=0 then
  MConv:=subs({u=x,v=y},M);
else
  MConv:=subs({u=y,v=x},M);
end if;
Set(MInt=MConv);
Set(MVal=Mval):
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L13" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkMy:=proc()
local userMy, userMyConv, userMyval:
global Myval:
userMy:=Get(MyInt::realcons):
userMyval:=Get(MyVal::realcons):
if intType=0 then
  userMyConv:=subs({x=u,y=v},userMy);
else
  userMyConv:=subs({x=v,y=u},userMy);
end if;
if userMyConv=My and userMyval=Myval then
  Set(response=&quot;Correct!&quot;):
elif userMyConv=My then
  Set(response=&quot;The integral is correct, but the value is wrong. Try again.&quot;):
else
  Set(response=&quot;The integral is wrong. Try again.&quot;):
end if:
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L16" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintMy := proc () 
if intType=0 then
Set(MyInt = &quot;Int(Int(x*rho,y=f(x)..g(x)),x=a..b)&quot;)
else
Set(MyInt = &quot;Int(Int(x*rho,x=f(y)..g(y)),y=a..b)&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L17" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showMy := proc () 
local MyConv;
if intType=0 then
  MyConv:=subs({u=x,v=y},My);
else
  MyConv:=subs({u=y,v=x},My);
end if;
Set(MyInt = MyConv); 
Set(MyVal = value(My)) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L18" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkMx := proc () 
local userMx, userMxval, userMxConv; 
global Mxval; userMx := Get(MxInt::realcons); 
userMxval := Get(MxVal::realcons); 
if intType=0 then
  userMxConv:=subs({x=u,y=v},userMx);
else
  userMxConv:=subs({x=v,y=u},userMx);
end if;
if userMxConv=Mx and userMxval=Mxval then 
   Set(response=&quot;Correct!&quot;) 
elif userMxConv=Mx then 
   Set(response=&quot;The integral is correct, but the value is wrong. Try again.&quot;) 
else 
   Set(response=&quot;The integral is wrong. Try again.&quot;) 
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L19" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintMx := proc ()
if intType=0 then 
Set(MxInt = &quot;Int(Int(y*rho,y=f(x)..g(x)),x=a..b)&quot;)
else
Set(MxInt = &quot;Int(Int(y*rho,x=f(y)..g(y)),y=a..b)&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L20" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showMx:=proc() 
local MxConv;
if intType=0 then
  MxConv:=subs({u=x,v=y},Mx);
else
  MxConv:=subs({u=y,v=x},Mx);
end if;
Set(MxInt = MxConv); 
Set(MxVal = value(Mx)) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L22" 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(response=&quot;Correct!&quot;) 
else 
   Set(response=&quot;Incorrect. Try again.&quot;) 
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L21" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintX:=proc () 
Set(XCoord=&quot;My/M&quot;) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L23" 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="L24" 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(response=&quot;Correct!&quot;)
else
  Set(response=&quot;Incorrect. Try again.&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L25" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintY := proc () 
Set(YCoord = &quot;Mx/M&quot;) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L26" 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="L4" 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,
  [ 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,
      TextBox[question](width=30, height=3, editable=false),
      BoxColumn( border=true,
      caption=&quot;Find the total mass, M. Enter the integral and value.&quot;,
        [ halign=none,
          &quot;M = &quot;, 
          TextBox[MInt](width = 30, height=2, background=turquoise),
          &quot; = &quot;,
          TextField[MVal](width=10, background=turquoise), 
          HorizontalGlue()
        ], 
        [ halign=none,
          HorizontalGlue(),
          Button(&quot;Template&quot;, Evaluate(function=&quot;hintM&quot;), background=orange),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkM&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showM&quot;), background=yellow),
          HorizontalGlue(),
          HorizontalGlue()
        ]
      )
    ],
    [ border=true,
      Plotter[graph](plot(0,x=0..6), width=300, height=200)
    ]
  ],
  [ halign=none, valign=none,
    [ border=true,
      BoxColumn( border=true,
        caption=&quot;Find the moment about the y-axis (integral and value):&quot;,
        [ inset=0, spacing=0,
          &quot;My = &quot;,
          TextBox[MyInt](width=35, height=2, background=turquoise),
          &quot; = &quot;,
          TextField[MyVal](width=10, background=turquoise)
        ],
        [ halign=none,
          HorizontalGlue(),
          Button(&quot;Template&quot;, Evaluate(function=&quot;hintMy&quot;), background=orange),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkMy&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showMy&quot;), background=yellow),
          HorizontalGlue()
        ]
      ),
      BoxColumn( 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=orange),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkX&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showX&quot;), background=yellow),
          HorizontalGlue()
        ]
      )
    ],
    [ border=true,
      BoxColumn( border=true,
        caption=&quot;Find the moment about the x-axis (integral and value):&quot;,
        [ inset=0, spacing=0,
          &quot;Mx = &quot;,
          TextBox[MxInt](width=35, height=2, background=turquoise),
          &quot; = &quot;,
          TextField[MxVal](width=10, background=turquoise)
        ],
        [ halign=none,
          HorizontalGlue(),
          Button(&quot;Template&quot;, Evaluate(function=&quot;hintMx&quot;), background=orange),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkMx&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showMx&quot;), background=yellow),
          HorizontalGlue()
        ]
      ),
      BoxColumn( 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=orange),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkY&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showY&quot;), background=yellow),
          HorizontalGlue()
         ]
      )
    ]
  ],
  [ TextField[response](width=60)
  ],
  [ &quot;Programmer: Sarah Mannen&quot;,
    HorizontalGlue(),
    &quot;copyright P. Yasskin 2008&quot;
  ]
]
)
):</Text-field>
</Input>
</Group>
<Group labelreference="L6" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">Maplets[Display](CenterOfMass);</Text-field>
</Input>
</Group>
<Group labelreference="L40" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Worksheet>
