<?xml version="1.0" encoding="UTF-8"?>
<Worksheet><Version major="6" minor="0"/><View-Properties><Zoom percentage="100"/></View-Properties><Styles><Layout alignment="left" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.5" name="Maple Output12" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="left" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Normal" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Maple Plot" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="left" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Normal257" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="left" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.0" name="Normal256" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="centred" firstindent="0.0" leftmargin="0.0" linebreak="space" linespacing="0.5" name="Maple Output" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Font background="[0,0,0]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" name="Maple Input"/><Font background="[0,0,0]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Normal257" readonly="false" size="18" underline="false"/><Font background="[0,0,0]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Normal256" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" italic="true" name="_cstyle277"/><Font background="[0,0,0]" bold="true" name="_cstyle276"/><Font background="[0,0,0]" italic="true" name="_cstyle275"/><Font background="[0,0,0]" italic="true" name="_cstyle274"/><Font background="[0,0,0]" italic="true" name="_cstyle273"/><Font background="[0,0,0]" bold="true" name="_cstyle272"/><Font background="[0,0,0]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Maple Output" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Maple Plot" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Maple Output12" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" family="Times New Roman" foreground="[255,0,0]" name="2D Math_25" size="18" underline="false"/><Font background="[0,0,0]" family="Times New Roman" foreground="[255,0,0]" name="2D Math_24" size="18" underline="false"/><Font background="[0,0,0]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" name="Normal" readonly="false" size="12" underline="false"/><Font background="[0,0,0]" family="Times New Roman" name="Page Number" underline="false"/></Styles><Page-Numbers enabled="false" first-number="1" first-numbered-page="1" horizontal-location="right" style="Page Number" vertical-location="bottom"/><Group><Input><Text-field layout="Normal257" style="Normal257"><Font size="24">MATH 156 LAB 3</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="_cstyle273"><Font bold="false" family="Times New Roman" foreground="[0,0,0]" size="18" underline="false">Topic 1: Comparing sums with increasing number of subintervals.</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">We come back to the example of velocity-distance travelled from Laboratory 2. The velocity function was</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">f := t-&gt;-22108.111351860603123*t^12+267716.97873114933992*t^7-28550.588718383953421*t^4-.69089471139707261503e-1*t^18-593.25933891402415755*t^2+88214.018798090967877*t^5-182944.24328666353298*t^6+5693.6391073166057753*t^3-285572.24388626189800*t^8+227046.45357947547549*t^9-136597.49693854806554*t^10+62764.645490312705181*t^11+1.5172197744989322043*t^17+5957.3207937003999701*t^13-1217.1081971634308471*t^14+185.14666942246783552*t^15-20.307901075143421783*t^16+.14466922546287623311e-2*t^19+33.706872407075593812*t+20;Digits:=20;</Font></Text-field></Input><Output><Text-field layout="Maple Output12" style="Maple Output12"/><Text-field layout="Maple Output" style="Maple Output"/></Output></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">We are working on the interval [0, 5].</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal256" style="Normal256"><Font size="18">Write commands that show the left-hands sums with 5 and 10 subintervals simultaneously. Explain why LHS(5) is less than LHS(10). Graph and explain why LHS(10) is less than LHS(20). Graph and explain why RHS(5)&gt;RHS(10)&gt;RHS(20). Do not forget the plots  and student packages.</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Plot" style="Maple Plot"/></Output></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Plot" style="Maple Plot"/></Output></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Plot" style="Maple Plot"/></Output></Group><Group><Input><Text-field layout="Normal" style="Normal"/></Input></Group><Group><Input><Text-field layout="Normal" style="_cstyle274"><Font bold="false" family="Times New Roman" foreground="[0,0,0]" size="18" underline="false">Topic 2: Evaluate the sums numerically.</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">We would like now to calculate the sums numerically. Maple has the commands: leftsum(function, variable= lower limit .. upperlimit, number of subintervals) for the left-hand sum and rightsum(function, variable=lower limit ..upper limit, number of subintervals). We will use first 5 subintervals.</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">leftsum(f(t), t=0..5, 5); rightsum(f(t), t=0..5, 5);</Font></Text-field></Input><Output><Text-field layout="Maple Output12" style="Maple Output12"/><Text-field layout="Maple Output12" style="Maple Output12"/></Output></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">As you see Maple does not give us the numerical value, so we use evalf:</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">evalf(leftsum(f(t), t=0..5, 5)); evalf(rightsum(f(t), t=0..5, 5));</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="_cstyle272"><Font family="Times New Roman" foreground="[0,0,0]" italic="false" size="18" underline="false">Write commands to compute the left-hand sums and the right-hand sums with 10, 20, 40, 80, 160 subintervals.</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Output" style="Maple Output"/></Output></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Output" style="Maple Output"/></Output></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Output" style="Maple Output"/></Output></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">We see that indeed the left-hand sums are increasing and the right-hand sums are decreasing. At the same time the right-hand sums are always larger than all the left-hand sums.</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">As you see we have not gotten great accuracy. We do not even have  accuracy to the nearest integer. To compute more accurately it will be nice to increase the number of subintervals. As it is tiring to write the same commands over and over, it is important to introduce loops in Maple.</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal"/></Input></Group><Group><Input><Text-field layout="Normal" style="_cstyle275"><Font bold="false" family="Times New Roman" foreground="[0,0,0]" size="18" underline="false">Topic 3: Loops and convergence of Riemann sums.</Font></Text-field><Text-field layout="Normal" style="Normal"/></Input></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">The following commands produce a table of the left-hand sums  with 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120 subintervals. Notice that every time we multiply the number of subintervals by 2, so at the first step (j=1) we have 5*2^0 subintervals, at the second step (j=2) we have 5*2^1=10 subintervals, at the third step (j=3) we have 5*2^2=20 subintervals etc. This gives the formula 5*2^{j-1} in the commands. </Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">for j from 1 to 11 do n:= 5*2^(j-1): evalf(leftsum(f(t), t=0..5, n)):od;</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">We see that the first decimal digit is stabilized. Morever, as you have noticed before, the left-hand sums are increasing. To be certain that the first decimal digit is indeed 6 we need to give overestimates, which are the right-hand sums. </Font></Text-field><Text-field layout="Normal" style="_cstyle276"><Font family="Times New Roman" foreground="[0,0,0]" italic="false" size="18" underline="false">Write commands that produce the right-hand sums with the same number of subintervals, using a loop. All you have to do is copy the command for the left-hand sums and change leftsum into rightsum.</Font></Text-field><Text-field layout="Normal" style="Normal"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">Now let us introduce the command that evaluates the integral exactly. To introduce      </Font><Equation executable="true" input-equation="int(f(t),t = a .. b);" style="2D Math_24">NiMtJSRpbnRHNiQtJSJmRzYjJSJ0Ry9GKTslImFHJSJiRw==</Equation><Font size="18">  we use the command Int( f(t), t=a..b)</Font></Text-field></Input><Output><Text-field layout="Maple Output12" style="Maple Output12"/></Output></Group><Group><Input><Text-field layout="Normal" style="_cstyle277"><Font bold="false" family="Times New Roman" foreground="[0,0,0]" size="18" underline="false">Topic 4: The Int command.</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">integraloff:=Int(f(t), t=0..5);</Font></Text-field></Input><Output><Text-field layout="Maple Output12" style="Maple Output12"/></Output></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">To compute the numerical value we use the value command.</Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false">value(integraloff);</Font></Text-field></Input><Output><Text-field layout="Maple Output" style="Maple Output"/></Output></Group><Group><Input><Text-field layout="Normal" style="Normal"><Font size="18">Now we will work with the function g(x)=1/x and the integral </Font><Equation executable="true" input-equation="int(1/x,x = 1 .. 2);" style="2D Math_25">NiMtJSRpbnRHNiQqJiIiIkYnJSJ4RyEiIi9GKDtGJyIiIw==</Equation>  .</Text-field></Input><Output><Text-field layout="Maple Output" style="Maple Output"/></Output></Group><Group><Input><Text-field layout="Normal256" style="Normal256"><Font size="18">Compute the left-hand sums and right-hand sums with 2, 4, 8, 16, 32, 64, 128, 256, 516, 1024 subintervals. Use a loop. How many decimal digits are you certain of?</Font></Text-field><Text-field layout="Normal256" style="Normal256"><Font size="18">Which are overestimates and which are underestimates and why? Do the left-hand sums form an increasing or decreasing sequence of numbers, as the number of subintervals increase? Show this in appropriate graphs. </Font></Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Output" style="Maple Output"/></Output></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"><Font italic="false" size="12" underline="false"> </Font></Text-field></Input><Output><Text-field layout="Maple Plot" style="Maple Plot"/></Output></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Plot" style="Maple Plot"/></Output></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Plot" style="Maple Plot"/></Output></Group><Group><Output><Text-field layout="Maple Plot" style="Maple Plot"/></Output></Group><Group><Output><Text-field layout="Maple Plot" style="Maple Plot"/></Output></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Plot" style="Maple Plot"/></Output></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input><Output><Text-field layout="Maple Plot" style="Maple Plot"/></Output></Group><Text-field/><Text-field/></Worksheet>