(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 9722, 292] NotebookOptionsPosition[ 9224, 272] NotebookOutlinePosition[ 9661, 289] CellTagsIndexPosition[ 9618, 286] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[TextData[StyleBox["Accumulating Area", FontColor->RGBColor[1, 0, 0]]], "Text", TextAlignment->Center, FontSize->36], Cell[CellGroupData[{ Cell["\<\ by Ruth Dover Illinois Mathematics and Science Academy\ \>", "Subsubtitle", CellChangeTimes->{{3.693227777071178*^9, 3.693227788957775*^9}}], Cell[TextData[{ "This notebook asks the user to enter a function \[Florin], a domain, a \ starting point ", StyleBox["a", FontSlant->"Italic"], ", and a step size", StyleBox[". ", FontSlant->"Italic"], " (An example is shown, though it may be changed.) The animation will show \ both the graph of the function \[Florin] as area accumulates (between the \ graph of \[Florin] and the ", StyleBox["x", FontSlant->"Italic"], "-axis) as the ", StyleBox["x", FontSlant->"Italic"], "-value increases and the graph of the function ", StyleBox["F", FontSlant->"Italic"], "(", StyleBox["x) = ", FontSlant->"Italic"], Cell[BoxData[ FormBox[ RowBox[{ SubsuperscriptBox["\[Integral]", "a", "x"], RowBox[{ RowBox[{"f", "(", "t", ")"}], RowBox[{"\[DifferentialD]", "t"}]}]}], TraditionalForm]]], ". Note the lower limit of integration of ", StyleBox["a", FontSlant->"Italic"], ". \n", StyleBox["Note:", FontColor->RGBColor[1, 0, 0]], " Really sorry \[SadSmiley], but the shading does not work as it should for ", StyleBox["x", FontSlant->"Italic"], " < ", StyleBox["a", FontSlant->"Italic"], ". This always shades from ", StyleBox["xmin", FontSlant->"Italic"], " to the current value of ", StyleBox["x ", FontSlant->"Italic"], "when it really should shade from ", StyleBox["a", FontSlant->"Italic"], " to ", StyleBox["x", FontSlant->"Italic"], ". " }], "Text", CellChangeTimes->{{3.693227823302009*^9, 3.6932278479324017`*^9}, { 3.6932474152561617`*^9, 3.6932474954574423`*^9}, {3.693247537767866*^9, 3.6932475719110107`*^9}, {3.6932476097153482`*^9, 3.693247609719836*^9}, { 3.6932476621171837`*^9, 3.69324771753721*^9}, {3.693247786952219*^9, 3.693247791704117*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", StyleBox[ RowBox[{ SuperscriptBox["x", "2"], "-", RowBox[{"3", "x"}]}], FontColor->RGBColor[1, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"xmin", "=", RowBox[{"-", "1"}]}], ";", " ", RowBox[{"xmax", "=", StyleBox["5", FontColor->RGBColor[1, 0, 1]]}], ";", " ", RowBox[{"a", " ", "=", StyleBox["0", FontColor->RGBColor[1, 0, 1]]}], ";", " ", RowBox[{"step", "=", StyleBox[".2", FontColor->RGBColor[1, 0, 1]]}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Leave", " ", "the", " ", "rest", " ", RowBox[{"alone", "!"}]}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"F", "[", "x_", "]"}], ":=", RowBox[{"Evaluate", "[", RowBox[{"Integrate", "[", RowBox[{ RowBox[{"f", "[", "z", "]"}], ",", " ", RowBox[{"{", RowBox[{"z", ",", " ", "a", ",", " ", "x"}], "}"}]}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"plgraph", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", " ", RowBox[{"{", RowBox[{"x", ",", " ", "xmin", ",", " ", "xmax"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"plint", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"F", "[", "x", "]"}], ",", " ", RowBox[{"{", RowBox[{"x", ",", " ", "xmin", ",", " ", "xmax"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"ylow", "=", RowBox[{"Min", "[", RowBox[{"0", ",", RowBox[{ RowBox[{"PlotRange", "[", "plgraph", "]"}], "[", RowBox[{"[", RowBox[{"2", ",", " ", "1"}], "]"}], "]"}], ",", " ", RowBox[{ RowBox[{"PlotRange", "[", "plint", "]"}], "[", RowBox[{"[", RowBox[{"2", ",", " ", "1"}], "]"}], "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"yhi", "=", RowBox[{"Max", "[", RowBox[{"0", ",", RowBox[{ RowBox[{"PlotRange", "[", "plgraph", "]"}], "[", RowBox[{"[", RowBox[{"2", ",", " ", "2"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"PlotRange", "[", "plint", "]"}], "[", RowBox[{"[", RowBox[{"2", ",", " ", "2"}], "]"}], "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"ex", "=", RowBox[{ RowBox[{"(", RowBox[{"xmax", "-", "xmin"}], ")"}], "/", "15"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"grfunc", "[", "u_", "]"}], ":=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "t", "]"}], ",", " ", RowBox[{"{", RowBox[{"t", ",", "xmin", ",", " ", "u"}], "}"}], ",", " ", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"xmin", "-", "ex"}], ",", " ", RowBox[{"xmax", "+", "ex"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"ylow", ",", " ", "yhi"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", "Thick"}], ",", RowBox[{"Filling", "\[Rule]", "0"}], ",", RowBox[{"MaxRecursion", " ", "\[Rule]", "1"}], ",", RowBox[{"Epilog", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "Large", "]"}], ",", "Red", ",", " ", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"u", ",", " ", RowBox[{"f", "[", "u", "]"}]}], "}"}], "]"}]}], "}"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"grint", "[", "u_", "]"}], ":=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"F", "[", "t", "]"}], ",", " ", RowBox[{"{", RowBox[{"t", ",", " ", "xmin", ",", " ", "u"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"xmin", "-", "ex"}], ",", " ", RowBox[{"xmax", "+", "ex"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"ylow", ",", " ", "yhi"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", "Thick"}], ",", RowBox[{"MaxRecursion", "\[Rule]", "1"}], ",", RowBox[{"Epilog", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "Large", "]"}], ",", "Red", ",", " ", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"u", ",", " ", RowBox[{"F", "[", "u", "]"}]}], "}"}], "]"}]}], "}"}]}]}], " ", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"GraphicsGrid", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"grfunc", "[", "u", "]"}], ",", " ", RowBox[{"grint", "[", "u", "]"}]}], "}"}], "}"}], ",", " ", RowBox[{"ImageSize", "\[Rule]", "600"}]}], "]"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"u", ",", " ", "a", ",", "\"\\""}], "}"}], ",", " ", RowBox[{"xmin", "+", ".1"}], ",", " ", "xmax"}], "}"}]}], "]"}]}], "Input", CellChangeTimes->{{3.395098556384001*^9, 3.3950985902895527`*^9}, { 3.3950987212496157`*^9, 3.395098722958439*^9}, {3.39509877482716*^9, 3.395098777566296*^9}, {3.395098859159753*^9, 3.395098905779091*^9}, { 3.395184002360011*^9, 3.395184162013335*^9}, {3.3951843082111673`*^9, 3.3951843292055283`*^9}, {3.395184378794819*^9, 3.3951843868848457`*^9}, { 3.395184427746825*^9, 3.395184450713943*^9}, {3.395184694626335*^9, 3.3951846962381563`*^9}, {3.395184769127907*^9, 3.3951848099790382`*^9}, { 3.3951848748379602`*^9, 3.395184900971279*^9}, {3.395184964578891*^9, 3.395184974508601*^9}, {3.395185022711042*^9, 3.395185083678123*^9}, { 3.395185136505262*^9, 3.395185139127454*^9}, {3.3951853713020487`*^9, 3.395185400959299*^9}, {3.395185431253495*^9, 3.395185483461823*^9}, { 3.3951855217995234`*^9, 3.395185530184495*^9}, {3.395185581406489*^9, 3.395185590460895*^9}, {3.395185702975309*^9, 3.3951857112585363`*^9}, { 3.395185781197422*^9, 3.395185803369458*^9}, {3.395185847711918*^9, 3.395185882615224*^9}, 3.395185925294526*^9, {3.3952494122396717`*^9, 3.395249435424766*^9}, {3.395249552413102*^9, 3.395249552751965*^9}, 3.395249594812257*^9, {3.395249629982951*^9, 3.3952496304048634`*^9}, { 3.395249927075786*^9, 3.39524992810911*^9}, {3.395249962682556*^9, 3.395249963852141*^9}, {3.395249996721037*^9, 3.3952500576979923`*^9}, { 3.6932478107818737`*^9, 3.6932478565568867`*^9}}] }, Open ]] }, WindowSize->{680, 730}, WindowMargins->{{Automatic, 34}, {Automatic, 34}}, PrivateNotebookOptions->{"VersionedStylesheet"->{"Default.nb"[8.] -> False}}, FrontEndVersion->"11.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (September \ 21, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[545, 20, 123, 3, 55, "Text"], Cell[CellGroupData[{ Cell[693, 27, 151, 4, 49, "Subsubtitle"], Cell[847, 33, 1751, 59, 151, "Text"], Cell[2601, 94, 6607, 175, 390, "Input"] }, Open ]] } ] *)