(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 34795, 1170]*) (*NotebookOutlinePosition[ 35682, 1200]*) (* CellTagsIndexPosition[ 35638, 1196]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[StyleBox["Calculus II Appendix to Lab II.2: Review of Simpson's \ Rule, etc.", FontFamily->"Nimbus sans l"]], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Avantgarde", FontSize->20, FontColor->RGBColor[1, 0, 1], FontVariations->{"Underline"->True}], Cell[TextData[StyleBox["The purpose of this lab is to reinforce your \ understanding and appreciation for the Midpoint Rule, the Trapezoidal Rule \ and Simpson's Rule.", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14]], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell[TextData[StyleBox["Before continuing, enlarge this window to a size that \ is comfortable for you. In addition, you might wish to alter the \ magnification by using the ``format'' menu at the top, then selecting \ ``magnification'' and then the particular magnification you want. You might \ wish to take notes as you work through this file. Saving this file to your \ disk every few minutes is highly recommended. You should check with your \ instructor to see if any part of this lab is to be submitted for grading and \ find out the due-date.", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14, FontColor->RGBColor[0, 0, 1]]], "Text", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Swiss721bt", Background->GrayLevel[1]], Cell[TextData[{ StyleBox["Enter input cells by putting the cursor anywhere in the cell and \ press ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14], StyleBox["\[ShiftKey]\[KeyBar]\[EnterKey]", "KeyStroke", FontSize->24], StyleBox[" .", "KeyStroke"], StyleBox[" The only exception is the following cell, which contains some \ \"hidden\" programs.", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt", Background->GrayLevel[1]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["STOP!!", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->18, FontColor->RGBColor[1, 1, 0], Background->GrayLevel[0.500008]], StyleBox[" \n", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->18, FontColor->RGBColor[0, 1, 1]], StyleBox["Click the cursor on the arrowed bracket on the ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14, FontColor->RGBColor[0.054902, 0.423529, 0]], StyleBox["far", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14, FontWeight->"Plain", FontColor->RGBColor[0.509804, 0, 0.905882]], StyleBox[" ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14, FontWeight->"Plain", FontColor->RGBColor[0.509804, 0, 0.905882], Background->GrayLevel[1]], StyleBox["RIGHT", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14, FontColor->RGBColor[0.509804, 0, 0.905882], Background->GrayLevel[1]], StyleBox[" ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14, FontColor->RGBColor[0.0705882, 0.556863, 0], Background->GrayLevel[1]], StyleBox["and then", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14, FontColor->RGBColor[0, 0.482353, 0]], StyleBox[" ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14, FontColor->RGBColor[0.0705882, 0.556863, 0]], StyleBox["press", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14, FontColor->RGBColor[0.117647, 0.431373, 0]], StyleBox[" ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->18, FontColor->RGBColor[0.117647, 0.431373, 0]], StyleBox["\[ShiftKey]\[KeyBar]\[EnterKey]", "KeyStroke", FontSize->24, FontColor->RGBColor[0.00784314, 0.423529, 0]], StyleBox[".", "KeyStroke", FontSize->18, FontColor->RGBColor[0.00784314, 0.423529, 0]] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt", FontSize->14, FontWeight->"Bold", FontSlant->"Plain", FontTracking->"Plain", FontVariations->{"Underline"->False, "Outline"->False, "Shadow"->False}], Cell["\<\ Lhs[f_,{x_,a_,b_,n_}]:=Module[ \t\t{delta,i,pic,plt,plt1,r}, \t\tdelta=N[(b-a)/n]; \t\t \t\tpic=Table[{{Hue[.5,.2,1],Rectangle[{a+i*delta,0},{a+(i+1)*delta,f/.{x->a+\ i*delta}}]}, \t {RGBColor[0,0,1],Line[{{a+i*delta,0},{a+i*delta,f/.{x->a+i*delta}}, \t\t {a+(i+1)*delta,f/.{x->a+i*delta}},{a+(i+1)*delta,0}}]}},{i,0,n-1}]; \t\t \t\tplt=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0},DisplayFunction->\ Identity]; \t\t \t\tplt1=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0},AxesLabel->{x,y},\ DisplayFunction->Identity]; \t\t \t\tShow[plt1,Graphics[pic],FullGraphics[plt],DisplayFunction->$\ DisplayFunction]; \t\t \t\tSum[f/.{x->a+i*delta},{i,0,n-1}]*delta//N] Rhs[f_,{x_,a_,b_,n_}]:=Module[ \t\t{delta,i,pic,plt,plt1,r}, \t\tdelta=N[(b-a)/n]; \t\t \t\tpic=Table[{{Hue[.5,.2,1],Rectangle[{a+i*delta,0},{a+(i+1)*delta,f/.{x->a+(\ i+1)*delta}}]}, \t {RGBColor[0,0,1],Line[{{a+i*delta,0},{a+i*delta,f/.{x->a+(i+1)*\ delta}}, \t\t {a+(i+1)*delta,f/.{x->a+(i+1)*delta}},{a+(i+1)*delta,0}}]}},{i,0,n-1}]\ ; \t\t \t\tplt=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0},DisplayFunction->\ Identity]; \t\t \t\tplt1=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0},AxesLabel->{x,y},\ DisplayFunction->Identity]; \t\t \t Show[plt1,Graphics[pic],FullGraphics[plt],DisplayFunction->$\ DisplayFunction]; \t\t \t\tSum[f/.{x->a+i*delta},{i,1,n}]*delta//N] \t\t Trap[f_,{x_,a_,b_,n_}]:=Module[ \t\t{delta,i,pic,plt,plt1,r}, \t\tdelta=N[(b-a)/n]; \t\t \t\tpic=Table[{{Hue[.5,.2,1],Polygon[{{a+i*delta,0},{a+i*delta,f/.{x->a+i*\ delta}}, \t\t {a+(i+1)*delta,f/.{x->a+(i+1)*delta}},{a+(i+1)*delta,0}}]}, \t {RGBColor[0,0,1],Line[{{a+i*delta,0},{a+i*delta,f/.{x->a+i*delta}}, \t\t {a+(i+1)*delta,f/.{x->a+(i+1)*delta}},{a+(i+1)*delta,0}}]}},{i,0,n-1}]\ ; \t\t \t\t \t\tplt=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0}, \ DisplayFunction->Identity]; \t\t plt1=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0},AxesLabel->{x,y},\ DisplayFunction->Identity]; \t\t \t\tShow[plt1,Graphics[pic],FullGraphics[plt],DisplayFunction->$\ DisplayFunction]; \t\t \t\tSum[((f/.{x->a+i*delta})+(f/.{x->a+(i+1)delta}))/2,{i,0,n-1}]*delta//N] Mid[f_,{x_,a_,b_,n_}]:=Module[ \t\t{delta,i,pic,plt,plt1,r}, \t\tdelta=N[(b-a)/n]; \t\t \t\tpic=Table[{{Hue[.5,.2,1],Rectangle[{a+i*delta,0},{a+(i+1)*delta,f/.{x->(\ 2a+(2i+1)*delta)/2}}]}, \t {RGBColor[0,0,1],Line[{{a+i*delta,0},{a+i*delta,f/.{x->(2a+(2i+1)*\ delta)/2}}, \t\t {a+(i+1)*delta,f/.{x->(2a+(2i+1)*delta)/2}},{a+(i+1)*delta,0}}]}},{i,\ 0,n-1}]; \t\t \t\tplt=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0},DisplayFunction->\ Identity]; \t\t \t\tplt1=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0},AxesLabel->{x,y}, DisplayFunction->Identity]; \t\t \t\tShow[plt1,Graphics[pic],FullGraphics[plt],DisplayFunction->$\ DisplayFunction]; \t\t \t\tSum[f/.{x->(2a+(2i+1)*delta)/2},{i,0,n-1}]*delta//N] Simp[f_,{x_,a_,b_,n_}]:=Module[ \t\t{delta,i,pic,plt,P}, \t\tdelta=N[(b-a)/n]; \t\t \t\tP=Table[Fit[{{a+i*delta,f/.{x->a+i*delta}},{(2a+(2i+1)*delta)/2,f/.{x->(\ 2a+(2i+1)*delta)/2}}, \t\t {a+(i+1)*delta,f/.{x->a+(i+1)*delta}}},{1,x,x^2},x],\ {i,0,n-1}]; \t\t \t\tpic=Table[{{RGBColor[0,0,1],Line[{{a+i*delta,f/.{x->a+i*delta}},{a+i*\ delta,0}}]}, \t\t {RGBColor[0,0,1],Line[{{a+(i+1)*delta,0},{a+(i+1)*delta,f/.{x->\ a+(i+1)*delta}}}]}}, \t\t {i,0,n-1}]; \t\t \t\tplt=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0},DisplayFunction->\ Identity]; \t\t \t\tShow[Table[Plot[P[[i+1]],{x,a+i*delta,a+(i+1)*delta},PlotStyle->RGBColor[\ 0,0,1], \t\t AxesOrigin->{0,0},AxesLabel->{x,y},DisplayFunction->Identity]\ , \t\t {i,0,n-1}], \t\t Graphics[pic], FullGraphics[plt], \ DisplayFunction->$DisplayFunction]; \t\t \t\t \t\tSum[((f/.{x->a+i*delta})/2+2*(f/.{x->(2a+(2i+1)*delta)/2})+(f/.{x->a+(i+1)\ *delta})/2),{i,0,n-1}]*(delta/3)//N] Area[f_,{x_,a_,b_}]:=Module[{p,q,r,r1,s}, \t\t \tp=Join[{{a,0}},Plot[f,{x,a,b},DisplayFunction->Identity][[1,1,1,1]], \t\t{{b,0}}]; \t\t \tq=Graphics[{Hue[.5,.2,1],Polygon[p]}]; \t \tr=Plot[f,{x,a,b},AxesOrigin->{0,0}, PlotRange->All, \ DisplayFunction->Identity]; \t \tr1=Plot[f,{x,a,b},AxesOrigin->{0,0}, PlotRange->All,AxesLabel->{x,y}, \ DisplayFunction->Identity]; \t \tShow[{r1,q,FullGraphics[r]},DisplayFunction->$DisplayFunction]; \t \t] Bhs[f_,{x_,a_,b_,n_}]:=Module[ \t\t{delta,i,pic,plt,plt1,r}, \t\tdelta=N[(b-a)/n]; \t\t \t\tpic1=Table[{{Hue[.3,.4,1],Rectangle[{a+i*delta,0},{a+(i+1)*delta,f/.{x->a+\ (i+1)*delta}}]}, \t Line[{{a+i*delta,0},{a+i*delta,f/.{x->a+(i+1)*delta}}, \t\t {a+(i+1)*delta,f/.{x->a+(i+1)*delta}},{a+(i+1)*delta,0}}]},{i,0,n-1}];\ \t\t \t\tpic11=Table[{RGBColor[0,0,1],Line[{{a+i*delta,f/.{x->a+(i+1)*delta}},{a+(\ i+1)*delta,f/.{x->a+(i+1)*delta}}}]}, \t\t {i,0,n-1}]; \t\t \t\tpic2=Table[{{Hue[.3,.4,1],Rectangle[{a+i*delta,0},{a+(i+1)*delta,f/.{x->a+\ i*delta}}]}, \t Line[{{a+i*delta,0},{a+i*delta,f/.{x->a+i*delta}}, \t\t {a+(i+1)*delta,f/.{x->a+i*delta}},{a+(i+1)*delta,0}}]},{i,0,n-1}]; \t\t \t\t \t\tpic22=Table[{RGBColor[1,0,0],Line[{{a+i*delta,f/.{x->a+i*delta}}, \t\t {a+(i+1)*delta,f/.{x->a+i*delta}}}]},{i,0,n-1}]; \t\t \t\tplt=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0},DisplayFunction->\ Identity]; \t\t \t\tplt1=Plot[f,{x,a,b},PlotRange->All,AxesOrigin->{0,0},AxesLabel->{x,y}, \t\t DisplayFunction->Identity]; \t\t \t Show[plt1,Graphics[pic1],Graphics[pic2],Graphics[pic11], \t Graphics[pic22],FullGraphics[plt],DisplayFunction->$\ DisplayFunction]; \t\t \t\t(Sum[f/.{x->a+i*delta},{i,1,n}]-Sum[f/.{x->a+i*delta},{i,0,n-1}])*delta//\ N] \ \>", "Input", AspectRatioFixed->True] }, Closed]], Cell[TextData[StyleBox["If you restart this notebook at a later date, you \ will need to reenter the previous cell before you can continue successfully!\n\ \n", FontFamily->"Nimbus sans l", FontSize->14]], "Text", Background->GrayLevel[1]], Cell["Left/Right-Hand Endpoints", "Subtitle", FontSize->18, FontColor->RGBColor[0, 0, 1], Background->GrayLevel[1]], Cell[TextData[StyleBox["Recall that the definite integral represents area \ under a graph, but area below the x-axis is negative.", FontFamily->"Nimbus sans l", FontSize->14]], "Text"], Cell[TextData[{ StyleBox["EXAMPLE 1\n", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->18, FontColor->RGBColor[0.866667, 0.411765, 0]], StyleBox["\n", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14], StyleBox["Consider", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14], StyleBox[" ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14], StyleBox[" ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->16], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ StyleBox[\(\[Integral]\_\(-\[Pi]\)\%\[Pi]\), FontSize->24], " ", StyleBox[ RowBox[{"sin", "[", SuperscriptBox[ StyleBox["x", FontFamily->"Nimbus sans l", FontSlant->"Plain"], "2"], "]"}], FontFamily->"Nimbus sans l"]}], StyleBox[" ", FontFamily->"Nimbus sans l"], StyleBox["+", FontFamily->"Nimbus sans l"], StyleBox[" ", FontFamily->"Nimbus sans l"], RowBox[{ StyleBox[\(2\/3\), FontFamily->"Nimbus sans l"], StyleBox[" ", FontFamily->"Nimbus sans l"], RowBox[{ StyleBox["\[DifferentialD]", FontFamily->"Nimbus sans l"], StyleBox["x", FontFamily->"Nimbus sans l", FontSlant->"Italic"]}]}]}], TraditionalForm]], FontSize->16], " ", StyleBox["and its corresponding picture........ ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Avantgarde"], Cell[" Area[Sin[x^2]+2/3,{x,-Pi,Pi}]", "Input", AspectRatioFixed->True], Cell[TextData[StyleBox["Using left-hand endpoints with 8 intervals to compute \ an approximation to this area, we obtain........", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14]], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell["Lhs[Sin[x^2]+2/3,{x,-Pi,Pi,8}]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["where the height of the rectangle is the value of y at the \ x-coordinate on the left side of the interval.", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14], StyleBox["\n\n", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14], StyleBox["On the other hand, we could instead have used the right side of \ the interval, or even the middle of the interval. The latter method is called \ the", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14], StyleBox[" ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14], StyleBox["Midpoint Rule", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14, FontColor->RGBColor[1, 0, 1]], StyleBox[".\n\n", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14], StyleBox["EXAMPLE 2", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->18, FontColor->RGBColor[0.866667, 0.411765, 0]], StyleBox["\n", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14], StyleBox["With the function etc of Example 1, using the Midpoint Rule with \ 8 intervals for estimating ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ StyleBox[\(\[Integral]\_\(-\[Pi]\)\%\[Pi]\), FontSize->24], StyleBox[" ", FontSize->16], StyleBox[\(sin[x\^2]\), FontSize->16]}], StyleBox[" ", FontSize->16], StyleBox["+", FontSize->16], StyleBox[" ", FontSize->16], StyleBox[\(2\/3\ \ \[DifferentialD]x\), FontSize->16]}], TraditionalForm]], FontFamily->"Nimbus sans l"], StyleBox[" ", FontFamily->"Nimbus sans l"], StyleBox["yields......", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14], StyleBox[" ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Avantgarde"], Cell["Mid[Sin[x^2]+2/3,{x,-Pi,Pi,8}]", "Input", AspectRatioFixed->True], Cell["\<\ The Trapezoidal Rule\ \>", "Subtitle", FontSize->18, FontColor->RGBColor[0, 0, 1], Background->GrayLevel[1]], Cell[TextData[{ "The trapezoidal rule involves ", StyleBox["trapezoids", FontWeight->"Bold", FontColor->RGBColor[1, 0, 1]], " instead of ", StyleBox["rectangles", FontWeight->"Bold", FontColor->RGBColor[0.054902, 0.556863, 0]], ". The heights of the parallel sides \nare determined by evaluating the \ function at the endpoints of the subinterval. The tops of the sides are then \ joined to form the trapezoid.\n\n", StyleBox["EXAMPLE 3\n", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->18, FontColor->RGBColor[0.866667, 0.411765, 0]], StyleBox["With the function etc of Example 1, using the Trapezoidal Rule \ with 8 intervals for estimating ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ StyleBox[\(\[Integral]\_\(-\[Pi]\)\%\[Pi]\), FontSize->24], StyleBox[" ", FontSize->16], StyleBox[\(sin[x\^2]\), FontSize->16]}], StyleBox[" ", FontSize->16], StyleBox["+", FontSize->16], StyleBox[" ", FontSize->16], StyleBox[\(2\/3\ \ \[DifferentialD]x\), FontSize->16]}], TraditionalForm]], FontFamily->"Nimbus sans l"], StyleBox[" ", FontFamily->"Nimbus sans l"], StyleBox["yields......", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14], StyleBox[" ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt", FontSize->14], Cell["Trap[Sin[x^2]+2/3,{x,-Pi,Pi,8}]", "Input", AspectRatioFixed->True], Cell["\<\ Simpson's Rule\ \>", "Subtitle", FontSize->18, FontColor->RGBColor[0, 0, 1], Background->GrayLevel[1]], Cell[TextData[{ StyleBox["However, instead of joining the endpoints with a straight line, \ one could join the endpoints with a ", FontSize->14], StyleBox["parabola", FontSize->14, FontWeight->"Bold", FontColor->RGBColor[1, 0, 1]], StyleBox["!! \n\n", FontSize->14], StyleBox["EXAMPLE 4\n", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->18, FontColor->RGBColor[0.866667, 0.411765, 0]], StyleBox["With the function etc of Example 1, using Simpson's Rule with 8 \ intervals for estimating ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ StyleBox[\(\[Integral]\_\(-\[Pi]\)\%\[Pi]\), FontSize->24], StyleBox[" ", FontSize->16], StyleBox[\(sin[x\^2]\), FontSize->16]}], StyleBox[" ", FontSize->16], StyleBox["+", FontSize->16], StyleBox[" ", FontSize->16], StyleBox[\(2\/3\ \ \[DifferentialD]x\), FontSize->16]}], TraditionalForm]], FontFamily->"Nimbus sans l"], StyleBox[" ", FontFamily->"Nimbus sans l"], StyleBox["yields......", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontFamily->"Nimbus sans l", FontSize->14], StyleBox[" ", Evaluatable->False, CellGroupingRules->"OutputGrouping", AspectRatioFixed->True, FontSize->14] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell["Simp[Sin[x^2]+2/3,{x,-Pi,Pi,8}]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["The black graph is the graph of our function \n \ ", FontFamily->"Nimbus sans l", FontSize->14], StyleBox[" f", FontFamily->"Nimbus sans l", FontSize->14, FontSlant->"Italic"], StyleBox["(", FontFamily->"Nimbus sans l", FontSize->14], StyleBox["x", FontFamily->"Nimbus sans l", FontSize->14, FontSlant->"Italic"], StyleBox[") = ", FontFamily->"Nimbus sans l", FontSize->14], Cell[BoxData[ FormBox[ RowBox[{" ", StyleBox[\(sin[x\^2]\ + \ 2\/3\), FontSize->16]}], TraditionalForm]], FontFamily->"Nimbus sans l", FontSize->14], StyleBox["\nwhile the blue curve consists of 8 parabolas (one on each \ subinterval) which have been joined together.\nLet's focus on one such \ parabola, say, the one on the subinterval ", FontFamily->"Nimbus sans l", FontSize->14], StyleBox[" [", FontFamily->"Nimbus sans l", FontSize->24], Cell[BoxData[ FormBox[ StyleBox[\(x\_i\), FontFamily->"Nimbus sans l", FontSize->18], TraditionalForm]]], ",", StyleBox[" ", FontFamily->"Nimbus sans l"], Cell[BoxData[ FormBox[ StyleBox[\(x\_\(i + 1\)\), FontSize->18], TraditionalForm]], FontFamily->"Nimbus sans l", FontSize->24], StyleBox["]", FontFamily->"Nimbus sans l", FontSize->24], StyleBox[". That parabola is constructed so that it passes through 3 \ particular points on the graph of our function", FontFamily->"Nimbus sans l", FontSize->14], StyleBox[" f", FontFamily->"Nimbus sans l", FontSize->14, FontSlant->"Italic"], StyleBox[", namely the points", FontFamily->"Nimbus sans l", FontSize->14], StyleBox["\n\n ", FontSize->14], StyleBox["(", FontFamily->"Nimbus sans l", FontSize->16], Cell[BoxData[ FormBox[ RowBox[{" ", StyleBox[ SubscriptBox["x", StyleBox["i", FontWeight->"Plain"]], FontWeight->"Bold"]}], TraditionalForm]], FontFamily->"Nimbus sans l", FontSize->14], StyleBox[", f(", FontFamily->"Nimbus sans l", FontSize->16], Cell[BoxData[ FormBox[ StyleBox[ SubscriptBox["x", StyleBox["i", FontWeight->"Plain"]], FontWeight->"Bold"], TraditionalForm]], FontFamily->"Nimbus sans l", FontSize->14], StyleBox[") ) , ", FontFamily->"Nimbus sans l", FontSize->16], StyleBox["(", FontFamily->"Nimbus sans l", FontSize->18], Cell[BoxData[ FormBox[ StyleBox[\(\(\(\ \)\(x\_i\ + \ x\_\(i + 1\)\)\)\/2\), FontSize->16], TraditionalForm]], FontFamily->"Nimbus sans l", FontSize->14, FontWeight->"Bold"], StyleBox[", ", FontFamily->"Nimbus sans l", FontSize->14], StyleBox["f", FontFamily->"Nimbus sans l", FontSize->18, FontWeight->"Bold"], StyleBox["( ", FontFamily->"Nimbus sans l", FontSize->18], Cell[BoxData[ FormBox[ StyleBox[\(\(x\_i\ + \ x\_\(i + 1\)\)\/2\), FontWeight->"Bold"], TraditionalForm]], FontFamily->"Nimbus sans l", FontSize->18], StyleBox[" )", FontFamily->"Nimbus sans l", FontSize->18], StyleBox[" ", FontFamily->"Nimbus sans l", FontSize->14], StyleBox[")", FontFamily->"Nimbus sans l", FontSize->18], StyleBox[" & ( ", FontFamily->"Nimbus sans l", FontSize->16], Cell[BoxData[ FormBox[ StyleBox[ SubscriptBox["x", RowBox[{ StyleBox["i", FontWeight->"Plain"], "+", "1"}]], FontWeight->"Bold"], TraditionalForm]], FontFamily->"Nimbus sans l", FontSize->14], StyleBox[", f(", FontFamily->"Nimbus sans l", FontSize->16], Cell[BoxData[ FormBox[ StyleBox[ SubscriptBox["x", RowBox[{ StyleBox["i", FontWeight->"Plain"], "+", "1"}]], FontWeight->"Bold"], TraditionalForm]], FontFamily->"Nimbus sans l", FontSize->14], StyleBox[") ),", FontFamily->"Nimbus sans l", FontSize->16], StyleBox["\n", FontFamily->"Nimbus sans l", FontSize->14], StyleBox["\n", FontSize->14], StyleBox["which have ", FontFamily->"Nimbus sans l", FontSize->14], StyleBox["x", FontFamily->"Nimbus sans l", FontSize->14, FontSlant->"Italic"], StyleBox["-coordinates which are the endpoints and the midpoint of the \ subinterval", FontFamily->"Nimbus sans l", FontSize->14], StyleBox[" [", FontFamily->"Nimbus sans l", FontSize->24], Cell[BoxData[ FormBox[ StyleBox[ SubscriptBox["x", StyleBox["i", FontSlant->"Plain"]], FontFamily->"Nimbus sans l", FontSize->18], TraditionalForm]]], ",", StyleBox[" ", FontFamily->"Nimbus sans l"], Cell[BoxData[ FormBox[ StyleBox[ SubscriptBox["x", RowBox[{ StyleBox["i", FontSlant->"Plain"], "+", "1"}]], FontSize->18], TraditionalForm]], FontFamily->"Nimbus sans l", FontSize->24], StyleBox["]", FontFamily->"Nimbus sans l", FontSize->24], StyleBox[".", FontFamily->"Nimbus sans l", FontSize->16], StyleBox[" ", FontFamily->"Nimbus sans l", FontSize->14], StyleBox["\n\n", FontSize->14], StyleBox["Depending on which function", FontFamily->"Nimbus sans l", FontSize->14], StyleBox[" f", FontFamily->"Nimbus sans l", FontSize->14, FontSlant->"Italic"], StyleBox[" is being considered, any one of the parabolas could pass through \ more than 3 points of the graph of ", FontFamily->"Nimbus sans l", FontSize->14], StyleBox["f", FontFamily->"Nimbus sans l", FontSize->14, FontSlant->"Italic"], StyleBox[" on the subinterval on which the parabola sits. ", FontFamily->"Nimbus sans l", FontSize->14] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Avantgarde"], Cell[TextData[{ StyleBox[" We are implicitly assuming that if we have 3 distinct points, \ then there is a ", CellFrame->True, FontSize->14, FontColor->RGBColor[1, 0, 1], Background->None], StyleBox["unique", CellFrame->True, FontSize->14, FontColor->RGBColor[0, 0, 1], Background->None], StyleBox[" parabola that passes through them. If the points are \ collinear, then the parabola is really a straight line, i.e., a degenerate \ parabola.", CellFrame->True, FontSize->14, FontColor->RGBColor[1, 0, 1], Background->None] }], "Text", CellDingbat->"\[LightBulb]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell["\<\ Exercises\ \>", "Subtitle", FontSize->18, FontColor->RGBColor[0, 0, 1], Background->GrayLevel[1]], Cell[TextData[{ StyleBox["1. Go back to the above pictures and compute them with \n (a) \ 16 subintervals;\n (b) 32 subintervals;\n (c) 50 subintervals.", FontSize->14], StyleBox["How quickly does the picture approach the a bounded by the \ function? ", FontSize->15] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell[TextData[{ StyleBox["2. Redo the previous question with different functions:\n (a) \ ", FontSize->14], Cell[BoxData[ FormBox[ RowBox[{ StyleBox["x", FontFamily->"Nimbus sans l", FontSize->14, FontSlant->"Plain"], StyleBox[" ", FontSize->14], StyleBox["-", FontSize->14], StyleBox[" ", FontSize->14], StyleBox["4", FontSize->14]}], TraditionalForm]]], StyleBox[";\n (b) ", FontSize->14], Cell[BoxData[ \(TraditionalForm\`x\^2\)], FontWeight->"Bold"], StyleBox[" ", FontWeight->"Bold"], StyleBox["+ 3", FontSize->14, FontWeight->"Bold"], " ;\n ", StyleBox["(c) ", FontSize->14], Cell[BoxData[ FormBox[ SuperscriptBox[ StyleBox["e", FontWeight->"Plain"], "x"], TraditionalForm]], FontSize->14, FontWeight->"Bold"], ". ", StyleBox[" ( Command Exp[x] )\n ", FontColor->RGBColor[1, 0, 1]], StyleBox["Which rules work best for the different functions?", FontSize->14] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell[TextData[StyleBox[ "In the following exercises, assume that the functions are continuous and \ that Trap(n) denotes the trapezoidal rule with n subintervals, and similarly \ for Simp(n), etc.", FontSize->14, FontColor->RGBColor[1, 0, 1]]], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell[TextData[StyleBox["3. Assume that f \"(x) < 0 and that f(x) > 0 for all \ x.\n If n>m, which is bigger, Trap(n) or Trap(m)?? \n Explain your \ reasoning. Does your answer change if instead we assume that f(x) < 0 for \ all x? Explain.", FontSize->14]], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell[TextData[{ StyleBox["4. Decide whether or not the following statement is true. If it \ is true, explain why. If it is false, give an \n example to show that it \ is false.\n \n If f(x) = ", FontSize->14], Cell[BoxData[ FormBox[ SuperscriptBox[ StyleBox["a", FontSize->14], "2"], TraditionalForm]]], StyleBox["+ bx + c, where a, b and c are real numbers, then Simp(m) = \ Simp(n) for any positive\n integers m and n. ", FontSize->14] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell[TextData[{ "5. In the previous question, a family of functions was considered, namely \ the family of quadratic\n functions (of one variable, ", StyleBox["x", FontFamily->"Nimbus sans l", FontSlant->"Italic"], "). In this question, find a family of functions for which Lhs(n) is \ equal\n to the integral for all n for every member of the family. \n \ Do the same for Trap(n). Explain your reasoning." }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt", FontSize->14], Cell[TextData[StyleBox["6. Find a family of functions for which Trap(n) is \ less than the integral for every member of the family.", FontSize->14]], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell[TextData[{ StyleBox["7. Decide whether or not the following statement is true. If it \ is true, explain why. If it is false, give an \n example to show that it \ is false.\n\n If f\"(", FontSize->14], StyleBox["x", FontFamily->"Nimbus sans l", FontSize->14, FontSlant->"Italic"], StyleBox[") > 0 for all", FontSize->14], StyleBox[" x", FontFamily->"Nimbus sans l", FontSize->14, FontSlant->"Italic"], StyleBox[", then Lhs(n) < Trap(n) for all n. ", FontSize->14] }], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell[TextData[StyleBox["8. In the discussion of Simpson's rule, we implicitly \ assumed that if we have 3 distinct points, then \n there is a unique \ parabola that passes through them (if the points are collinear, then the \ parabola\n is degenerate). More specifically, if you specify three \ distinct points, then there is only one quadratic\n polynomial whose \ graph, or sideways graph, contains them. Why is this true? Explain.", FontSize->14]], "Text", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Swiss721bt"], Cell[TextData[{ StyleBox["End of Lab. \nIf you wish, save your work. Quit ", FontSize->14], StyleBox["Mathematica", FontSize->14, FontSlant->"Italic"], StyleBox[".", FontSize->14] }], "Text", FormatType->TextForm, FontFamily->"Swiss721bt", FontColor->RGBColor[0, 0, 1]], Cell[TextData[{ "\n\n", StyleBox["This lab was modified from a lab at the University of Oregon.", FontSize->10, FontColor->RGBColor[1, 0, 1]] }], "Text", FormatType->TextForm, FontFamily->"Swiss721bt", FontColor->RGBColor[0, 0, 1]] }, FrontEndVersion->"5.0 for X", ScreenRectangle->{{0, 1024}, {0, 768}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{400, 302}, WindowMargins->{{37, Automatic}, {Automatic, 29}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, 128}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, CharacterEncoding->"NeXTAutomaticEncoding" ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 296, 8, 104, "Text", Evaluatable->False], Cell[2053, 61, 358, 9, 94, "Text", Evaluatable->False], Cell[2414, 72, 842, 17, 254, "Text", Evaluatable->False, CellGroupingRules->"OutputGrouping"], Cell[3259, 91, 651, 20, 85, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[3935, 115, 2642, 89, 90, "Text", Evaluatable->False], Cell[6580, 206, 5729, 173, 2217, "Input"] }, Closed]], Cell[12324, 382, 245, 5, 99, "Text"], Cell[12572, 389, 121, 3, 45, "Subtitle"], Cell[12696, 394, 188, 3, 58, "Text"], Cell[12887, 399, 2106, 69, 94, "Text", Evaluatable->False], Cell[14996, 470, 73, 1, 27, "Input"], Cell[15072, 473, 319, 8, 34, "Text", Evaluatable->False], Cell[15394, 483, 73, 1, 27, "Input"], Cell[15470, 486, 2789, 92, 203, "Text", Evaluatable->False], Cell[18262, 580, 73, 1, 27, "Input"], Cell[18338, 583, 126, 7, 91, "Subtitle"], Cell[18467, 592, 1903, 61, 176, "Text", Evaluatable->False], Cell[20373, 655, 74, 1, 27, "Input"], Cell[20450, 658, 120, 7, 91, "Subtitle"], Cell[20573, 667, 1729, 58, 136, "Text", Evaluatable->False], Cell[22305, 727, 74, 1, 27, "Input"], Cell[22382, 730, 6173, 228, 303, "Text", Evaluatable->False], Cell[28558, 960, 700, 23, 74, "Text", Evaluatable->False], Cell[29261, 985, 115, 7, 91, "Subtitle"], Cell[29379, 994, 379, 10, 96, "Text", Evaluatable->False], Cell[29761, 1006, 1227, 47, 114, "Text", Evaluatable->False], Cell[30991, 1055, 332, 8, 54, "Text", Evaluatable->False], Cell[31326, 1065, 351, 7, 74, "Text", Evaluatable->False], Cell[31680, 1074, 590, 16, 114, "Text", Evaluatable->False], Cell[32273, 1092, 539, 13, 96, "Text", Evaluatable->False], Cell[32815, 1107, 235, 5, 34, "Text", Evaluatable->False], Cell[33053, 1114, 636, 20, 96, "Text", Evaluatable->False], Cell[33692, 1136, 546, 9, 94, "Text", Evaluatable->False], Cell[34241, 1147, 298, 11, 54, "Text"], Cell[34542, 1160, 249, 8, 66, "Text"] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)