(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 7.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 11383, 357] NotebookOptionsPosition[ 10457, 326] NotebookOutlinePosition[ 10801, 341] CellTagsIndexPosition[ 10758, 338] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[TextData[{ StyleBox["Power Series Approximation", FontSize->24, FontWeight->"Bold"], StyleBox["\n", FontSize->24], StyleBox["By Corinne Manogue\n\n", FontSize->16, FontSlant->"Italic"], StyleBox["This ", FontFamily->"Times New Roman", FontSize->22], StyleBox["Mathematica", FontFamily->"Times New Roman", FontSize->22, FontSlant->"Italic"], StyleBox[" worksheet explores the use of power series to approximate \ functions. How many terms of the power series do you need to get a good \ approximation for the function f(\[Theta]", FontFamily->"Times New Roman", FontSize->22], StyleBox[")= ", FontFamily->"Times New Roman", FontSize->22, FontSlant->"Italic"], StyleBox["Sin(\[Theta]", FontFamily->"Times New Roman", FontSize->22], StyleBox[")?", FontFamily->"Times New Roman", FontSize->22, FontSlant->"Italic"], StyleBox["\n\n", FontSize->18, FontSlant->"Italic"], StyleBox["First, we define and plot f(\[Theta]", FontFamily->"Times New Roman", FontSize->22], StyleBox[").", FontFamily->"Times New Roman", FontSize->22, FontSlant->"Italic"], StyleBox["\n", FontSize->16, FontSlant->"Italic"] }], "Text", CellChangeTimes->{{3.5170667702133713`*^9, 3.5170668462744107`*^9}, { 3.5170668989296503`*^9, 3.5170669398038654`*^9}, {3.51706700803693*^9, 3.5170671379719353`*^9}, 3.5201841024636817`*^9}], Cell[BoxData[{ StyleBox[ RowBox[{"f", "=", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], FontFamily->"Courier New", FontSize->18], "\[IndentingNewLine]", StyleBox[ RowBox[{"Plot", "[", RowBox[{"f", ",", RowBox[{"{", RowBox[{"\[Theta]", ",", "0", ",", RowBox[{"2", "Pi"}]}], "}"}], ",", " ", RowBox[{"AxesLabel", "\[Rule]", " ", RowBox[{"{", "Theta", "}"}]}]}], "]"}], FontFamily->"Courier New", FontSize->18], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.517067143299958*^9, 3.5170672366262913`*^9}, { 3.5201055401902337`*^9, 3.520105558143014*^9}, {3.5201057916697803`*^9, 3.5201058829649024`*^9}, {3.520106199318203*^9, 3.5201062642388315`*^9}}], Cell[TextData[{ StyleBox["Now type in the missing information at the prompts below and press \ shift enter.", FontFamily->"Times New Roman", FontSize->22], StyleBox["\n\n", FontSize->18], StyleBox["First order(n=1) term:", FontFamily->"Times New Roman", FontSize->22, FontWeight->"Bold", FontVariations->{"Underline"->True}], StyleBox["\n", FontFamily->"Times New Roman", FontSize->22, FontWeight->"Bold"], StyleBox["Question: Why didn't we use the zeorth order term?", FontFamily->"Times New Roman", FontSize->22] }], "Text", CellChangeTimes->{{3.517067386404665*^9, 3.517067522480178*^9}, { 3.5170675542451925`*^9, 3.5170675601825786`*^9}, {3.517068626021489*^9, 3.5170686326307373`*^9}}], Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{"c", "[", "1", "]"}], ":=", "\[IndentingNewLine]", RowBox[{"g", ":=", RowBox[{ RowBox[{"c", "[", "1", "]"}], "*", "\[Theta]"}]}]}], FontFamily->"Courier New", FontSize->18]], "Input", CellChangeTimes->{{3.5170675671668196`*^9, 3.517067616837741*^9}, { 3.517067858083109*^9, 3.5170678679891686`*^9}, 3.5170679946273623`*^9, { 3.5170684254784646`*^9, 3.517068428681528*^9}, 3.520599082955676*^9}], Cell[CellGroupData[{ Cell[TextData[StyleBox["The function g(\[Theta]) is the approximation to f(\ \[Theta]). The purple line is the approximation and the blue line is the \ function f(\[Theta]).", FontFamily->"Times New Roman", FontSize->22]], "Text", CellGroupingRules->{"GroupTogetherGrouping", 31}, CellChangeTimes->{{3.5170673148904133`*^9, 3.51706731714037*^9}, { 3.5170676310093436`*^9, 3.5170676641024585`*^9}, {3.5170753772591276`*^9, 3.5170754008055506`*^9}}], Cell["", "Text", CellGroupingRules->{"GroupTogetherGrouping", 31}, CellChangeTimes->{{3.51706732442148*^9, 3.517067325843328*^9}}] }, Closed]], Cell[BoxData[ StyleBox[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{"f", ",", "g"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Theta]", ",", "0", ",", "Pi"}], "}"}], ",", " ", RowBox[{"AxesLabel", "\[Rule]", " ", RowBox[{"{", "Theta", "}"}]}]}], "]"}], FontFamily->"Courier New", FontSize->18]], "Input", CellChangeTimes->{{3.5170677641317873`*^9, 3.5170677664911175`*^9}, { 3.5170678463802085`*^9, 3.517067898066716*^9}, {3.5170679436127167`*^9, 3.5170679763152137`*^9}, 3.5170708833375225`*^9, {3.5201062805041447`*^9, 3.520106294597624*^9}}], Cell[BoxData[""], "Input", CellChangeTimes->{{3.5170682211542625`*^9, 3.5170682211698875`*^9}}], Cell[BoxData[""], "Input", CellChangeTimes->{{3.517068216138734*^9, 3.517068216154359*^9}}], Cell[TextData[{ StyleBox["For what values of \[Theta] is g(\[Theta]) a good approximation \ for f(\[Theta])=Sin(\[Theta])?\n", FontFamily->"Times New Roman", FontSize->22], StyleBox["\n", FontSize->18], StyleBox["Third order (n=3) term:", FontFamily->"Times New Roman", FontSize->22, FontWeight->"Bold", FontVariations->{"Underline"->True}] }], "Text", CellChangeTimes->{{3.517068073828966*^9, 3.5170681342809305`*^9}, { 3.5170682487006087`*^9, 3.5170682628878365`*^9}, 3.517068623740283*^9, { 3.517071328033947*^9, 3.517071328752531*^9}}], Cell[BoxData[{ StyleBox[ RowBox[{ RowBox[{"c", "[", "3", "]"}], ":=", "\[IndentingNewLine]", RowBox[{"g", ":=", RowBox[{ RowBox[{ RowBox[{"c", "[", "1", "]"}], "*", "\[Theta]"}], "+", RowBox[{ RowBox[{"c", "[", "3", "]"}], "*", RowBox[{"\[Theta]", "^", "3"}]}]}]}]}], FontFamily->"Courier New", FontSize->18], "\[IndentingNewLine]", StyleBox[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{"f", ",", "g"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Theta]", ",", "0", ",", "Pi"}], "}"}], ",", " ", RowBox[{"AxesLabel", "\[Rule]", " ", RowBox[{"{", "Theta", "}"}]}]}], "]"}], FontFamily->"Courier New", FontSize->18]}], "Input", CellChangeTimes->{{3.51706826685651*^9, 3.517068339901983*^9}, { 3.517068398853976*^9, 3.5170684443374777`*^9}, {3.5170688885008245`*^9, 3.5170688914538927`*^9}, 3.517070873259591*^9, {3.5201062844103193`*^9, 3.5201062867696495`*^9}, 3.520599126032974*^9}], Cell[TextData[{ StyleBox["For what values of \[Theta] is g(\[Theta]) a good approximation \ for f(\[Theta])=Sin(\[Theta])?\n", FontFamily->"Times New Roman", FontSize->22], StyleBox["\n", FontSize->18], StyleBox["Fifth order(n=5) term:", FontFamily->"Times New Roman", FontSize->22, FontWeight->"Bold", FontVariations->{"Underline"->True}] }], "Text", CellChangeTimes->{{3.5170685848035307`*^9, 3.5170686553959255`*^9}}], Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{ RowBox[{"c", "[", "5", "]"}], ":=", "\[IndentingNewLine]", RowBox[{"g", ":=", "\[IndentingNewLine]", RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{"f", ",", "g"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Theta]", ",", "0", ",", "Pi"}], "}"}], " ", ",", RowBox[{"AxesLabel", "\[Rule]", " ", RowBox[{"{", "Theta", "}"}]}]}], "]"}]}]}], "\[IndentingNewLine]"}], FontFamily->"Courier New", FontSize->18]], "Input", CellChangeTimes->{ 3.517068447915534*^9, 3.517068480993024*^9, {3.517068570928797*^9, 3.517068571444412*^9}, {3.517068659052105*^9, 3.517068705035597*^9}, { 3.51706881711157*^9, 3.517068918656495*^9}, 3.5170708628847904`*^9, { 3.520106327175123*^9, 3.5201063298469467`*^9}, {3.5205991420951653`*^9, 3.5205991656103387`*^9}}], Cell[TextData[{ StyleBox["For what values of \[Theta] is g(\[Theta]) a good approximation \ for f(\[Theta])=Sin(\[Theta])?", FontFamily->"Times New Roman", FontSize->22], StyleBox["\n", FontSize->18, FontWeight->"Bold"], StyleBox["\n", FontSize->18], StyleBox["Range of Approximation", FontFamily->"Times New Roman", FontSize->22, FontWeight->"Bold", FontVariations->{"Underline"->True}], StyleBox["\n", FontFamily->"Times New Roman", FontSize->22, FontWeight->"Bold"], StyleBox["Can you determine how many terms of the power series, g(\[Theta]), \ are needed to yield an accurate approximation of Sin(\[Theta]) for \[Theta] \ values between -\[Pi] and \[Pi]?", FontFamily->"Times New Roman", FontSize->22], StyleBox["\n", FontSize->18, FontWeight->"Bold"], StyleBox["\n", FontSize->18], StyleBox["How good is your approximation outside this range?", FontFamily->"Times New Roman", FontSize->22], StyleBox["\n\n", FontSize->18], StyleBox["Series expansions around a point other than zero", FontFamily->"Times New Roman", FontSize->22, FontWeight->"Bold", FontVariations->{"Underline"->True}], StyleBox["\n", FontFamily->"Times New Roman", FontSize->22], StyleBox["Now compare the series expansion h(\[Theta]) around the point ", FontFamily->"Times New Roman", FontSize->22], Cell[BoxData[ FormBox[ RowBox[{"\[Theta]", "=", StyleBox[ FractionBox["\[Pi]", "6"], FontSize->22]}], TraditionalForm]], FontFamily->"Times New Roman", FontSize->22], StyleBox[" to the function f(\[Theta])=Sin(\[Theta]) for several different \ orders in the expansion parameter.", FontFamily->"Times New Roman", FontSize->22] }], "Text", CellChangeTimes->{{3.517068946405963*^9, 3.5170690437322187`*^9}, { 3.51707049676682*^9, 3.5170705363285604`*^9}, {3.5170705672029676`*^9, 3.517070595093057*^9}, {3.5170706261705856`*^9, 3.5170707733083854`*^9}}], Cell[BoxData[ StyleBox[ RowBox[{"h", ":=", "\[IndentingNewLine]", RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{"f", ",", "h"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Theta]", ",", "0", ",", "Pi"}], "}"}]}], "]"}]}], FontFamily->"Courier New", FontSize->18]], "Input", CellChangeTimes->{{3.5170707814332294`*^9, 3.517070848275696*^9}}] }, WindowSize->{1272, 922}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, FrontEndVersion->"7.0 for Microsoft Windows (32-bit) (February 18, 2009)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[545, 20, 1379, 48, 213, "Text"], Cell[1927, 70, 710, 18, 72, "Input"], Cell[2640, 90, 725, 22, 118, "Text"], Cell[3368, 114, 466, 11, 64, "Input"], Cell[CellGroupData[{ Cell[3859, 129, 457, 8, 39, "Text", CellGroupingRules->{"GroupTogetherGrouping", 31}], Cell[4319, 139, 132, 2, 29, "Text", CellGroupingRules->{"GroupTogetherGrouping", 31}] }, Closed]], Cell[4466, 144, 600, 15, 30, "Input"], Cell[5069, 161, 96, 1, 31, "Input"], Cell[5168, 164, 92, 1, 31, "Input"], Cell[5263, 167, 563, 15, 90, "Text"], Cell[5829, 184, 987, 27, 72, "Input"], Cell[6819, 213, 438, 13, 90, "Text"], Cell[7260, 228, 877, 21, 118, "Input"], Cell[8140, 251, 1930, 60, 309, "Text"], Cell[10073, 313, 380, 11, 64, "Input"] } ] *) (* End of internal cache information *)