(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.1' 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[ 13055, 354]*) (*NotebookOutlinePosition[ 13902, 385]*) (* CellTagsIndexPosition[ 13829, 379]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Fundamental Theorem of Calculus", "Title", TextAlignment->Center, TextJustification->0, Background->RGBColor[0, 1, 0]], Cell["\<\ This notebook is by Steven Amgott. Please send any questions or comments to \ samgott1@swarthmore.edu. Feel free to use and distribute this notebook, but \ keep this author information in any copy you use or distribute.\ \>", "SmallText"], Cell[TextData[{ "In any input cell containing ", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], " , you must replace it with your input before evaluating the cell. In \ general, anything in ", StyleBox["magenta", FontColor->RGBColor[1, 0, 1]], " is something you can, and possibly should, change." }], "Text"], Cell[CellGroupData[{ Cell["\<\ Initialization (can be skipped provided you answer \"Yes\" to initialization \ prompt\ \>", "Section"], Cell["\<\ Needs[\"Graphics`FilledPlot`\"] Needs[\"Graphics`Animation`\"]\ \>", "Input", InitializationCell->True, CellTags->"S5.32.1"], Cell[BoxData[ \($Packages\)], "Input"], Cell[CellGroupData[{ Cell["Eliminating some unnecessary warning messages.", "Subsection"], Cell[BoxData[{ \(\(Off[General::"\"];\)\), "\n", \(\(Off[General::"\"];\)\)}], "Input", InitializationCell->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Constructing the graph of the \"area under the curve\" function.\ \>", "Section"], Cell[TextData[{ "The cell below shows the construction of the function ", Cell[BoxData[ \(TraditionalForm\`\[Integral]\_a\%x f[t] \[DifferentialD]t\)]], " as the \"area under the curve\" function. You may change the function \ and the region on which it is bounded by changing ", StyleBox["f[x]", FontColor->RGBColor[1, 0, 1]], ", ", StyleBox["a", FontColor->RGBColor[1, 0, 1]], ", and ", StyleBox["b", FontColor->RGBColor[1, 0, 1]], "." }], "Text"], Cell[TextData[{ "You can adjust the number of frames in the animation by changing the value \ of ", StyleBox["n", FontColor->RGBColor[1, 0, 1]], ". (You may need to reduce it if you are working on a slow computer.) To \ see the animation, evaluate the cell, select the entire collection of output \ graphs, and choose ", StyleBox["Animate Selected Graphics", FontColor->RGBColor[0, 0, 1]], " from the ", StyleBox["Cell", FontColor->RGBColor[0, 0, 1]], " menu item." }], "Text"], Cell[BoxData[{\(Clear[f, x, n, a, b, x0, r, aplot]\), "\[IndentingNewLine]", RowBox[{\(f[x_]\), ":=", StyleBox[\(Sin[x]\), FontColor->RGBColor[1, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"a", "=", StyleBox["0", FontColor->RGBColor[1, 0, 1]]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"b", "=", StyleBox["10", FontColor->RGBColor[1, 0, 1]]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", StyleBox["20", FontColor->RGBColor[1, 0, 1]]}], ";"}], "\[IndentingNewLine]", RowBox[{\(aplot = Plot[\[Integral]\_a\%y f[x] \[DifferentialD]x, {y, a, b}, DisplayFunction \[Rule] Identity]\), ";", RowBox[{"Animate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"Rectangle", "[", RowBox[{\({0, 1}\), ",", \({1, 2}\), ",", "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{\(Plot[f[x], {x, a, b}, PlotRange \[Rule] All, DisplayFunction \[Rule] Identity]\), ",", \(FilledPlot[f[x], {x, a, x0}, Fills \[Rule] {RGBColor[0, 0, 1]}, DisplayFunction \[Rule] Identity]\), ",", \(DisplayFunction \[Rule] $DisplayFunction\), ",", RowBox[{"PlotLabel", "\[Rule]", RowBox[{"StyleForm", "[", RowBox[{ RowBox[{ "\"\\"", "<>", RowBox[{"ToString", "[", RowBox[{"z", "=", RowBox[{"Chop", "[", RowBox[{\(\[Integral]\_a\%x0 f[ x] \[DifferentialD]x\), ",", SuperscriptBox["10", RowBox[{"-", StyleBox["6", FontColor->RGBColor[1, 0, 1]]}]]}], "]"}]}], "]"}]}], ",", \(FontSize \[Rule] 12\)}], "]"}]}]}], "]"}]}], "]"}], ",", RowBox[{"Rectangle", "[", RowBox[{\({0, 0}\), ",", \({1, 1}\), ",", RowBox[{"Plot", "[", RowBox[{\({\[Integral]\_a\%y f[x] \[DifferentialD]x, z}\), ",", \({y, a, x0}\), ",", \(PlotRange \[Rule] {{a, b}, \(PlotRange[aplot]\)[\([2]\)]}\), ",", \(PlotLabel \[Rule] StyleForm[\*"\"\\"" <> ToString[z], FontSize \[Rule] 12]\), ",", RowBox[{"Epilog", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", StyleBox[".025", FontColor->RGBColor[1, 0, 1]], "]"}], ",", \(RGBColor[1, 0, 0]\), ",", \(Point[{x0, z}]\)}], "}"}]}]}], "]"}]}], "]"}]}], "}"}], "]"}], "]"}], ",", \({x0, a + .001, b, \(b - a - .001\)\/n}\), ",", RowBox[{"ImageSize", "\[Rule]", StyleBox["600", FontColor->RGBColor[1, 0, 1]]}]}], "]"}]}]}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Illustrating the derivative of the \"area under the curve\" function\ \>", "Section"], Cell[TextData[{ "The next cell animates the convergence of difference quotients ", Cell[BoxData[ FormBox[ FractionBox[ RowBox[{ RowBox[{ StyleBox["F", FontSlant->"Plain"], "[", RowBox[{ StyleBox["x0", FontSlant->"Plain"], "+", "\[CapitalDelta]x"}], "]"}], "-", RowBox[{ StyleBox["F", FontSlant->"Plain"], "[", StyleBox["x0", FontSlant->"Plain"], "]"}]}], "\[CapitalDelta]x"], TraditionalForm]]], " for the function F[x] = ", Cell[BoxData[ \(TraditionalForm\`\[Integral]\_a\%x f[t] \[DifferentialD]t\)]], " for various \[CapitalDelta]x, illustrating the fact that ", Cell[BoxData[ FormBox[ FractionBox[ StyleBox["d", FontSlant->"Plain"], "dx"], TraditionalForm]]], Cell[BoxData[ \(TraditionalForm\`\[Integral]\_a\%x f[t] \[DifferentialD]t\)]], " = f[x] at a chosen value x0. The ", StyleBox["green", FontColor->RGBColor[0, 1, 0]], " line is the value of f[x0]. The region bounded by the x-axis and the \ curve between x0 and x0 + \[CapitalDelta]x is in ", StyleBox["blue", FontColor->RGBColor[0, 0, 1]], ". There is a ", StyleBox["red", FontColor->RGBColor[1, 0, 0]], " rectangle whose height (shown with a horizontal ", StyleBox["red", FontColor->RGBColor[1, 0, 0]], " line) is the difference quotient and whose base is \[CapitalDelta]x (so \ that it has the same area as the area under the curve from x0 to x0 + \ \[CapitalDelta]x). The place where these regions overlap is colored ", StyleBox["purple", FontColor->RGBColor[0.501961, 0, 0.501961]], ". Since the difference quotient approaches the value of the derivative \ F'[x0] as \[CapitalDelta]x \[Rule] 0, the animation should show this ", StyleBox["red", FontColor->RGBColor[1, 0, 0]], " height approaching the ", StyleBox["green", FontColor->RGBColor[0, 1, 0]], " value of f[x0]." }], "Text"], Cell[TextData[{ "You can adjust the number of frames in the animation by changing the value \ of ", StyleBox["n", FontColor->RGBColor[1, 0, 1]], ". (You may need to reduce it if you are working on a slow computer.) To \ see the animation, evaluate the cell, select the entire collection of output \ graphs, and choose ", StyleBox["Animate Selected Graphics", FontColor->RGBColor[0, 0, 1]], " from the ", StyleBox["Cell", FontColor->RGBColor[0, 0, 1]], " menu item." }], "Text"], Cell[BoxData[{\(Clear[f, x, a, x0, n, fPlot, dq, k]\), "\[IndentingNewLine]", RowBox[{\(f[x_]\), ":=", StyleBox[\(x\^2\), FontColor->RGBColor[1, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"a", "=", StyleBox["0", FontColor->RGBColor[1, 0, 1]]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x0", "=", StyleBox[".2", FontColor->RGBColor[1, 0, 1]]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", StyleBox["50", FontColor->RGBColor[1, 0, 1]]}], ";"}], "\[IndentingNewLine]", \(fPlot = Plot[f[x], {x, a, x0 + \(n - 1\)\/n}, DisplayFunction \[Rule] Identity];\), "\[IndentingNewLine]", RowBox[{"Animate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Show", "[", RowBox[{ "fPlot", ",", \(Plot[{dq = \(\[Integral]\_x0\%\(x0 + \(n - k\)\/n\)f[y] \ \[DifferentialD]y\)\/\(\(n - k\)\/n\), f[x0]}, {x, a, x0 + \(n - 1\)\/n}, PlotStyle \[Rule] {RGBColor[1, 0, 0], RGBColor[0, 1, 0]}, DisplayFunction \[Rule] Identity]\), ",", \(FilledPlot[{f[x], dq, 0, If[f[x]\ dq\ < 0, 0, If[dq < 0, Max[f[x], dq], Min[f[x], dq]]]}, {x, x0, x0 + \(n - k\)\/n}, Fills \[Rule] {RGBColor[0, 0, 1], RGBColor[1, 0, 0], Hue[0.75]}, Curves \[Rule] Front, DisplayFunction \[Rule] Identity]\), ",", \(DisplayFunction \[Rule] $DisplayFunction\), ",", \(PlotLabel \[Rule] "\" <> ToString[N[dq]] <> "\<; f[x0] is \>" <> ToString[N[f[x0]]]\), ",", \(PlotRange \[Rule] PlotRange[fPlot]\), ",", RowBox[{"ImageSize", "\[Rule]", StyleBox["600", FontColor->RGBColor[1, 0, 1]]}]}], "]"}], ",", \({k, 1, n - 1, 1}\)}], "]"}]}], "Input"] }, Closed]] }, Open ]] }, FrontEndVersion->"5.1 for Microsoft Windows", ScreenRectangle->{{0, 1600}, {0, 1147}}, AutoGeneratedPackage->None, WindowToolbars->"EditBar", WindowSize->{1028, 892}, WindowMargins->{{0, Automatic}, {Automatic, 0}} ] (******************************************************************* 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->{ "S5.32.1"->{ Cell[2630, 82, 138, 5, 48, "Input", InitializationCell->True, CellTags->"S5.32.1"]} } *) (*CellTagsIndex CellTagsIndex->{ {"S5.32.1", 13703, 371} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 130, 3, 111, "Title"], Cell[1909, 58, 250, 4, 44, "SmallText"], Cell[2162, 64, 328, 9, 33, "Text"], Cell[CellGroupData[{ Cell[2515, 77, 112, 3, 73, "Section"], Cell[2630, 82, 138, 5, 48, "Input", InitializationCell->True, CellTags->"S5.32.1"], Cell[2771, 89, 42, 1, 30, "Input"], Cell[CellGroupData[{ Cell[2838, 94, 68, 0, 47, "Subsection"], Cell[2909, 96, 141, 3, 50, "Input", InitializationCell->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[3099, 105, 91, 2, 43, "Section"], Cell[3193, 109, 486, 15, 52, "Text"], Cell[3682, 126, 505, 14, 52, "Text"], Cell[4190, 142, 4125, 82, 317, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[8352, 229, 95, 2, 43, "Section"], Cell[8450, 233, 2088, 56, 94, "Text"], Cell[10541, 291, 505, 14, 52, "Text"], Cell[11049, 307, 1978, 43, 325, "Input"] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)