(* 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[ 17963, 648] NotebookOptionsPosition[ 16097, 581] NotebookOutlinePosition[ 16553, 600] CellTagsIndexPosition[ 16510, 597] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Lesson 5 Answers - Replacement Rules and Solving Equations\ \>", "Section", CellChangeTimes->{{3.46100175040655*^9, 3.461001785385079*^9}, { 3.461268898233786*^9, 3.461268899876728*^9}, {3.465130344661601*^9, 3.465130345610549*^9}}], Cell[TextData[{ "1) Have ", StyleBox["Mathematica", FontSlant->"Italic"], " find the", StyleBox[" exact", FontWeight->"Bold"], " solutions to the following equations:" }], "Text", CellChangeTimes->{{3.416500591551766*^9, 3.416500609472273*^9}, { 3.416500667925123*^9, 3.4165007194843884`*^9}, 3.41770915185122*^9, { 3.417709224971787*^9, 3.417709230745022*^9}, {3.460825864733408*^9, 3.460825868959683*^9}, {3.460825922441498*^9, 3.4608259242015963`*^9}, 3.4610012507895308`*^9}, FontWeight->"Plain"], Cell[TextData[{ "(a) ", Cell[BoxData[ FormBox[ StyleBox[ RowBox[{ RowBox[{ SuperscriptBox["x", "2"], "-", RowBox[{"5", " ", "x"}], " ", "+", "4"}], "=", "0"}], "Input"], TraditionalForm]]] }], "Text", CellChangeTimes->{{3.460826364871724*^9, 3.4608263874571133`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["x", "2"], "-", RowBox[{"5", "x"}], "+", "4"}], "\[Equal]", "0"}], ",", "x"}], "]"}]], "Input", CellChangeTimes->{{3.4608258791795607`*^9, 3.460825888498254*^9}, { 3.460826442560223*^9, 3.460826445030017*^9}}, FontSlant->"Italic"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x", "\[Rule]", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"x", "\[Rule]", "4"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.460825889909095*^9}, FontSlant->"Italic"] }, Open ]], Cell[TextData[{ "(b) ", StyleBox["x+y=5", "Input"], " and ", StyleBox["2x+6y=23", "Input"], " simultaneously." }], "Text", CellChangeTimes->{{3.460825978143834*^9, 3.460826006771989*^9}, 3.460826044152461*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"x", "+", "y"}], "==", "5"}], ",", RowBox[{ RowBox[{ RowBox[{"2", "x"}], "+", RowBox[{"6", "y"}]}], "==", "23"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]], "Input", FontSlant->"Italic"], Cell[BoxData[ RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"x", "\[Rule]", FractionBox["7", "4"]}], ",", RowBox[{"y", "\[Rule]", FractionBox["13", "4"]}]}], "}"}], "}"}]], "Output", CellChangeTimes->{3.460826058434218*^9}, FontSlant->"Italic"] }, Open ]], Cell[TextData[{ "2) Can ", StyleBox["Mathematica", FontSlant->"Italic"], " find the exact solutions of ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SuperscriptBox["x", "5"], "+", RowBox[{"3", SuperscriptBox["x", "4"]}], "-", RowBox[{"3", SuperscriptBox["x", "2"]}], "+", RowBox[{"5", "x"}], "-", "5"}], "=", "0"}], TraditionalForm]]], "? If not, why not?" }], "Text", CellChangeTimes->{{3.460826122383803*^9, 3.460826173387498*^9}, { 3.4608265073860493`*^9, 3.460826567317264*^9}, {3.4608279366397*^9, 3.460827939216076*^9}, {3.4608281646247683`*^9, 3.460828166234248*^9}, { 3.461001259182382*^9, 3.461001279083243*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "^", "5"}], "+", RowBox[{"3", RowBox[{"x", "^", "4"}]}], "-", RowBox[{"3", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"5", "x"}], "+", "5"}], "\[Equal]", "0"}], ",", "x"}], "]"}]], "Input", FontSlant->"Italic"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{"Root", "[", RowBox[{ RowBox[{ RowBox[{"5", "+", RowBox[{"5", " ", "#1"}], "-", RowBox[{"3", " ", SuperscriptBox["#1", "2"]}], "+", RowBox[{"3", " ", SuperscriptBox["#1", "4"]}], "+", SuperscriptBox["#1", "5"]}], "&"}], ",", "1"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{"Root", "[", RowBox[{ RowBox[{ RowBox[{"5", "+", RowBox[{"5", " ", "#1"}], "-", RowBox[{"3", " ", SuperscriptBox["#1", "2"]}], "+", RowBox[{"3", " ", SuperscriptBox["#1", "4"]}], "+", SuperscriptBox["#1", "5"]}], "&"}], ",", "2"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{"Root", "[", RowBox[{ RowBox[{ RowBox[{"5", "+", RowBox[{"5", " ", "#1"}], "-", RowBox[{"3", " ", SuperscriptBox["#1", "2"]}], "+", RowBox[{"3", " ", SuperscriptBox["#1", "4"]}], "+", SuperscriptBox["#1", "5"]}], "&"}], ",", "3"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{"Root", "[", RowBox[{ RowBox[{ RowBox[{"5", "+", RowBox[{"5", " ", "#1"}], "-", RowBox[{"3", " ", SuperscriptBox["#1", "2"]}], "+", RowBox[{"3", " ", SuperscriptBox["#1", "4"]}], "+", SuperscriptBox["#1", "5"]}], "&"}], ",", "4"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{"Root", "[", RowBox[{ RowBox[{ RowBox[{"5", "+", RowBox[{"5", " ", "#1"}], "-", RowBox[{"3", " ", SuperscriptBox["#1", "2"]}], "+", RowBox[{"3", " ", SuperscriptBox["#1", "4"]}], "+", SuperscriptBox["#1", "5"]}], "&"}], ",", "5"}], "]"}]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.460826763493576*^9}, FontSlant->"Italic"] }, Open ]], Cell[TextData[{ "3) Can ", StyleBox["Mathematica", FontSlant->"Italic"], " find the exact solutions of ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SuperscriptBox["x", "5"], "+", RowBox[{"3", SuperscriptBox["x", "4"]}], "-", RowBox[{"3", SuperscriptBox["x", "2"]}], "+", RowBox[{"5", "x"}], "+", "6"}], "=", "0"}], TraditionalForm]]], "? How do you reconcile your observations of your answers to 2) and 3)?" }], "Text", CellChangeTimes->{{3.460826642283739*^9, 3.460826685374817*^9}, { 3.460827947668837*^9, 3.460827949500822*^9}, {3.460828171032873*^9, 3.46082818050056*^9}, {3.4610012641105433`*^9, 3.461001272451923*^9}, { 3.461001323840065*^9, 3.461001332691093*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "^", "5"}], "+", RowBox[{"3", RowBox[{"x", "^", "4"}]}], "-", RowBox[{"3", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"5", "x"}], "+", "6"}], "\[Equal]", "0"}], ",", "x"}], "]"}]], "Input", FontSlant->"Italic"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{"-", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{ RowBox[{ RowBox[{"-", "2"}], " ", SuperscriptBox[ RowBox[{"(", FractionBox["2", RowBox[{"3", " ", RowBox[{"(", RowBox[{"27", "-", SqrtBox["633"]}], ")"}]}]], ")"}], RowBox[{"1", "/", "3"}]]}], "-", FractionBox[ SuperscriptBox[ RowBox[{"(", RowBox[{ FractionBox["1", "2"], " ", RowBox[{"(", RowBox[{"27", "-", SqrtBox["633"]}], ")"}]}], ")"}], RowBox[{"1", "/", "3"}]], SuperscriptBox["3", RowBox[{"2", "/", "3"}]]]}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"1", "+", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], ")"}], " ", SuperscriptBox[ RowBox[{"(", FractionBox["2", RowBox[{"3", " ", RowBox[{"(", RowBox[{"27", "-", SqrtBox["633"]}], ")"}]}]], ")"}], RowBox[{"1", "/", "3"}]]}], "+", FractionBox[ RowBox[{ RowBox[{"(", RowBox[{"1", "-", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], ")"}], " ", SuperscriptBox[ RowBox[{"(", RowBox[{ FractionBox["1", "2"], " ", RowBox[{"(", RowBox[{"27", "-", SqrtBox["633"]}], ")"}]}], ")"}], RowBox[{"1", "/", "3"}]]}], RowBox[{"2", " ", SuperscriptBox["3", RowBox[{"2", "/", "3"}]]}]]}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", "\[Rule]", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"1", "-", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], ")"}], " ", SuperscriptBox[ RowBox[{"(", FractionBox["2", RowBox[{"3", " ", RowBox[{"(", RowBox[{"27", "-", SqrtBox["633"]}], ")"}]}]], ")"}], RowBox[{"1", "/", "3"}]]}], "+", FractionBox[ RowBox[{ RowBox[{"(", RowBox[{"1", "+", RowBox[{"\[ImaginaryI]", " ", SqrtBox["3"]}]}], ")"}], " ", SuperscriptBox[ RowBox[{"(", RowBox[{ FractionBox["1", "2"], " ", RowBox[{"(", RowBox[{"27", "-", SqrtBox["633"]}], ")"}]}], ")"}], RowBox[{"1", "/", "3"}]]}], RowBox[{"2", " ", SuperscriptBox["3", RowBox[{"2", "/", "3"}]]}]]}]}], "}"}]}], "}"}]], "Output", GeneratedCell->False, CellAutoOverwrite->False, CellChangeTimes->{3.46082669531859*^9, 3.460826733330212*^9}, FontSlant->"Italic"] }, Open ]], Cell[TextData[{ "In the first case, ", StyleBox["Mathematica", FontSlant->"Italic"], " cannot find the exact solution, it just indicates that it needs to find \ the solution, and ", StyleBox["NSolve", "Input"], " would give numerical answers. In the second case, ", StyleBox["Mathematica", FontSlant->"Italic"], " is able to provide an exact answer because the polynomial factors. For \ polynomials with degree 5 and higher, ", StyleBox["Mathematica", FontSlant->"Italic"], " can only find exacts solutions if it can factor the polynomial." }], "Text", CellChangeTimes->{{3.417709319393218*^9, 3.417709345707017*^9}, { 3.460826845886026*^9, 3.460826846841642*^9}, {3.4610012885912657`*^9, 3.461001305894793*^9}, {3.461001419282859*^9, 3.46100148599302*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Factor", "[", RowBox[{ RowBox[{"x", "^", "5"}], "+", RowBox[{"3", RowBox[{"x", "^", "4"}]}], "-", RowBox[{"3", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"5", "x"}], "+", "5"}], "]"}]], "Input", CellChangeTimes->{{3.417709300333397*^9, 3.417709300668378*^9}}, FontSlant->"Italic"], Cell[BoxData[ RowBox[{"5", "+", RowBox[{"5", " ", "x"}], "-", RowBox[{"3", " ", SuperscriptBox["x", "2"]}], "+", RowBox[{"3", " ", SuperscriptBox["x", "4"]}], "+", SuperscriptBox["x", "5"]}]], "Output", CellChangeTimes->{3.4608267980388803`*^9}, FontSlant->"Italic"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Factor", "[", RowBox[{ RowBox[{"x", "^", "5"}], "+", RowBox[{"3", RowBox[{"x", "^", "4"}]}], "-", RowBox[{"3", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"5", "x"}], "+", "6"}], "]"}]], "Input", FontSlant->"Italic"], Cell[BoxData[ RowBox[{ RowBox[{"(", RowBox[{"1", "+", "x"}], ")"}], " ", RowBox[{"(", RowBox[{"2", "+", "x"}], ")"}], " ", RowBox[{"(", RowBox[{"3", "-", RowBox[{"2", " ", "x"}], "+", SuperscriptBox["x", "3"]}], ")"}]}]], "Output", CellChangeTimes->{3.4608268018581667`*^9}, FontSlant->"Italic"] }, Open ]], Cell[TextData[{ "4) We want to find the solutions to the equation ", StyleBox["sin x = 1-x/4", "Input"], ". To get started on the problem, use the following input command for ", StyleBox["Mathematica", FontSlant->"Italic"], " to get a graph of the two functions together. Solutions to the equation \ above are exactly the ", StyleBox["x", "Input"], "-values of the points of intersection. " }], "Text", CellChangeTimes->{{3.460828194998019*^9, 3.460828209714355*^9}, 3.461001343108363*^9}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], ",", RowBox[{"1", "-", RowBox[{"x", "/", "4"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "7"}], "}"}]}], "]"}]], "Input"], Cell[TextData[{ "Evaluate the following input command which tries to find a solution by \ using ", StyleBox["Solve", "Input"], "." }], "Text", CellChangeTimes->{3.460828265577881*^9}], Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"Sin", "[", "x", "]"}], "\[Equal]", RowBox[{"1", "-", RowBox[{"x", "/", "4"}]}]}], ",", "x"}], "]"}]], "Input"], Cell[TextData[{ StyleBox["Basically, here ", FontColor->GrayLevel[0]], StyleBox["Mathematica", FontSlant->"Italic", FontColor->GrayLevel[0]], StyleBox[" tells you that the function to be solved is not a polynomial, so \ it cannot do it. ", FontColor->GrayLevel[0]] }], "Text", CellChangeTimes->{{3.417709459315682*^9, 3.4177095034865093`*^9}, 3.4610015254814043`*^9}, FontColor->RGBColor[0, 0, 1]], Cell[TextData[{ "Now use ", StyleBox["FindRoot", "Input"], " to get a numerical solution. Remember that ", StyleBox["FindRoot", "Input"], " needs a starting point, i.e., an ", StyleBox["x", "Input"], "-value that is close to the solution. Use the graph above to read off a \ starting value and compute all three solutions." }], "Text", CellChangeTimes->{{3.4608283429783993`*^9, 3.4608283454760847`*^9}, 3.461001885703231*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRoot", "[", RowBox[{ RowBox[{ RowBox[{"Sin", "[", "x", "]"}], "\[Equal]", RowBox[{"1", "-", RowBox[{"x", "/", "4"}]}]}], ",", RowBox[{"{", RowBox[{"x", ",", "1"}], "}"}]}], "]"}]], "Input", FontSlant->"Italic"], Cell[BoxData[ RowBox[{"{", RowBox[{"x", "\[Rule]", "0.8904870807443801`"}], "}"}]], "Output", CellChangeTimes->{3.460828376005021*^9}, FontSlant->"Italic"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRoot", "[", RowBox[{ RowBox[{ RowBox[{"Sin", "[", "x", "]"}], "\[Equal]", RowBox[{"1", "-", RowBox[{"x", "/", "4"}]}]}], ",", RowBox[{"{", RowBox[{"x", ",", "3"}], "}"}]}], "]"}]], "Input", FontSlant->"Italic"], Cell[BoxData[ RowBox[{"{", RowBox[{"x", "\[Rule]", "2.8499689344551418`"}], "}"}]], "Output", CellChangeTimes->{3.460828378488925*^9}, FontSlant->"Italic"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRoot", "[", RowBox[{ RowBox[{ RowBox[{"Sin", "[", "x", "]"}], "\[Equal]", RowBox[{"1", "-", RowBox[{"x", "/", "4"}]}]}], ",", RowBox[{"{", RowBox[{"x", ",", "5.5"}], "}"}]}], "]"}]], "Input", FontSlant->"Italic"], Cell[BoxData[ RowBox[{"{", RowBox[{"x", "\[Rule]", "5.8128260902615505`"}], "}"}]], "Output", CellChangeTimes->{3.4608283811218567`*^9}, FontSlant->"Italic"] }, Open ]] }, Open ]] }, ScreenStyleEnvironment->"Working", WindowSize->{850, 641}, WindowMargins->{{258, Automatic}, {Automatic, 14}}, PrintingCopies->1, PrintingPageRange->{Automatic, Automatic}, ShowSelection->True, FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (April 20, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 251, 5, 67, "Section"], Cell[844, 30, 526, 14, 26, "Text"], Cell[1373, 46, 301, 11, 30, "Text"], Cell[CellGroupData[{ Cell[1699, 61, 337, 10, 33, "Input"], Cell[2039, 73, 247, 8, 27, "Output"] }, Open ]], Cell[2301, 84, 219, 8, 26, "Text"], Cell[CellGroupData[{ Cell[2545, 96, 356, 13, 27, "Input"], Cell[2904, 111, 272, 9, 44, "Output"] }, Open ]], Cell[3191, 123, 680, 20, 30, "Text"], Cell[CellGroupData[{ Cell[3896, 147, 335, 12, 27, "Input"], Cell[4234, 161, 2121, 69, 73, "Output"] }, Open ]], Cell[6370, 233, 731, 20, 30, "Text"], Cell[CellGroupData[{ Cell[7126, 257, 335, 12, 27, "Input"], Cell[7464, 271, 3015, 102, 175, "Output"] }, Open ]], Cell[10494, 376, 826, 20, 56, "Text"], Cell[CellGroupData[{ Cell[11345, 400, 331, 10, 27, "Input"], Cell[11679, 412, 289, 9, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12005, 426, 265, 9, 27, "Input"], Cell[12273, 437, 328, 11, 33, "Output"] }, Open ]], Cell[12616, 451, 506, 12, 41, "Text"], Cell[13125, 465, 295, 10, 27, "Input"], Cell[13423, 477, 187, 6, 26, "Text"], Cell[13613, 485, 195, 6, 27, "Input"], Cell[13811, 493, 414, 12, 26, "Text"], Cell[14228, 507, 439, 11, 41, "Text"], Cell[CellGroupData[{ Cell[14692, 522, 269, 9, 27, "Input"], Cell[14964, 533, 161, 4, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15162, 542, 269, 9, 27, "Input"], Cell[15434, 553, 161, 4, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15632, 562, 271, 9, 27, "Input"], Cell[15906, 573, 163, 4, 27, "Output"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)