(* 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[ 14459, 514] NotebookOptionsPosition[ 12384, 442] NotebookOutlinePosition[ 12762, 459] CellTagsIndexPosition[ 12719, 456] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Lesson 1 Answers - Introduction to Mathematica", "Section", CellChangeTimes->{{3.459969581416307*^9, 3.459969586776207*^9}, { 3.459971298773995*^9, 3.459971304719817*^9}, {3.461268805336286*^9, 3.461268806808523*^9}, {3.465130288564887*^9, 3.4651302904098463`*^9}}], Cell[TextData[{ "1) ", "Evaluate the following expressions using ", StyleBox["Mathematica", FontSlant->"Italic"], ". Explain the difference between the pairs of inputs:" }], "Text", CellChangeTimes->{{3.45996923141405*^9, 3.459969234078657*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"3", "x"}], " ", "+", " ", RowBox[{"x", " ", "7"}]}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"3", "x"}], " ", "+", " ", "x7"}]], "Input"], Cell[TextData[{ "In the first expression ", StyleBox["x", "Input"], " \[SpaceKey] ", StyleBox["7", "Input"], " is interpreted as ", StyleBox["7", "Input"], " times ", StyleBox["x", "Input"], ", and thus the answer is ", StyleBox["10x", "Input"], "; whereas in the second expression, ", StyleBox["x", "Input"], " (no blank) ", StyleBox["7", "Input"], " is interpreted as a new variable named ", StyleBox["x7", "Input"], ", and thus no simplification is possible." }], "Text", CellChangeTimes->{{3.45996970123283*^9, 3.459969733994669*^9}, 3.459969963163444*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[TextData[{ "2) Evaluate the following expressions using ", StyleBox["Mathematica", FontSlant->"Italic"], ". Explain the difference between the pairs of inputs:" }], "Text", CellChangeTimes->{{3.459969262243264*^9, 3.459969276351048*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"2", " ", "meters"}], " ", "+", " ", RowBox[{"13", " ", "meters"}]}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"1", " ", "meter"}], " ", "+", " ", RowBox[{"3", " ", "meters"}]}]], "Input"], Cell[TextData[{ "In the first expression we get the addition of ", StyleBox["2", "Input"], " and ", StyleBox["13", "Input"], " times ", StyleBox["meters", "Input"], " (so in this way one can \"add\" units), i.e. ", StyleBox["meters", "Input"], " is interpreted as a symbol or variable. In the second expression, ", StyleBox["meter", "Input"], " and ", StyleBox["meters", "Input"], " are interpreted as different symbols. ", StyleBox["Mathematica", FontSlant->"Italic"], " does not recognize that ", StyleBox["meter", "Input"], " is the singular of ", StyleBox["meters", "Input"], ". However, since ", StyleBox["meter", "Input"], " and ", StyleBox["meters", "Input"], " do not differ by more than one letter, a warning message is displayed to \ alert you of the possibility of a typo." }], "Text", CellChangeTimes->{{3.459969826148222*^9, 3.459969831314056*^9}, { 3.459970961028302*^9, 3.459970961760844*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell["2) Calculate sin(0.1) to 20 decimal places.", "Text", CellChangeTimes->{{3.45996819257474*^9, 3.459968245446228*^9}, 3.4599683626909*^9, 3.459969294143343*^9, {3.4599700419944143`*^9, 3.459970053712479*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"N", "[", RowBox[{ RowBox[{"Sin", "[", RowBox[{"1", "/", "10"}], "]"}], ",", "20"}], "]"}]], "Input", CellChangeTimes->{{3.459970057112549*^9, 3.45997007653966*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData["0.09983341664682815230681419841062202546`20."], "Output", CellChangeTimes->{3.459970078414309*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Open ]], Cell[TextData[StyleBox["3) Compute the cube root of your CIN number to 10 \ significant digits.", FontWeight->"Plain"]], "Text", CellChangeTimes->{{3.459968758819642*^9, 3.4599687597222643`*^9}, 3.459969296755831*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"N", "[", RowBox[{ RowBox[{"123456789", "^", RowBox[{"(", RowBox[{"1", "/", "3"}], ")"}]}], ",", "10"}], "]"}]], "Input", CellChangeTimes->{{3.45997008548487*^9, 3.459970097646475*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData["497.9338592181743417913`9.999999999999998"], "Output", CellChangeTimes->{3.459970099923644*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Open ]], Cell[TextData[{ "4) How close is (1+", Cell[BoxData[ FormBox[ SuperscriptBox[ RowBox[{ FractionBox["1", "100"], ")"}], "100"], TraditionalForm]]], " to \[ExponentialE]?" }], "Text", CellChangeTimes->{{3.459968250448845*^9, 3.4599683230629873`*^9}, 3.459969307655385*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"N", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"1", "+", RowBox[{"1", "/", "100"}]}], ")"}], "^", "100"}], "-", "E"}], "]"}]], "Input", CellChangeTimes->{{3.459970284538542*^9, 3.459970346926619*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData[ RowBox[{"-", "0.01346799903751883`"}]], "Output", CellChangeTimes->{{3.459970309317646*^9, 3.459970347886305*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Open ]], Cell[TextData[{ "5) In math books it is common to write ", Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["sin", "2"], "(", "x", ")"}], TraditionalForm]]], " instead of ", Cell[BoxData[ FormBox[ SuperscriptBox[ RowBox[{"(", RowBox[{"sin", "(", "x", ")"}], ")"}], "2"], TraditionalForm]]], ". In ", StyleBox["Mathematica,", FontSlant->"Italic"], " this expression can certainly be written as ", StyleBox["(Sin[x])^2", "Input"], ". But what about ", StyleBox["Sin^2[x]", "Input"], " and ", StyleBox["Sin[x]^2", "Input"], "? What do these mean?" }], "Text", CellChangeTimes->{{3.459968334141512*^9, 3.459968335158043*^9}, { 3.459968379505783*^9, 3.459968587193502*^9}, 3.4599693107181664`*^9, { 3.459969427074741*^9, 3.459969443563815*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"Sin", "[", "x", "]"}], "^", "2"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"(", RowBox[{"Sin", "[", "x", "]"}], ")"}], "^", "2"}]}], "Input", CellChangeTimes->{{3.45997038324055*^9, 3.459970389317432*^9}, { 3.459970456239544*^9, 3.459970468279776*^9}, {3.4599705745741167`*^9, 3.4599705787421627`*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData[ SuperscriptBox[ RowBox[{"Sin", "[", "x", "]"}], "2"]], "Output", CellChangeTimes->{3.4599705803039303`*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData[ SuperscriptBox[ RowBox[{"Sin", "[", "x", "]"}], "2"]], "Output", CellChangeTimes->{3.459970580469235*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Open ]], Cell[TextData[{ " Since the outputs of the above commands are the same, ", StyleBox["Sin[x]^2", "Input"], " means the same as ", StyleBox["(Sin[x])^2", "Input"] }], "Text", CellChangeTimes->{{3.459970490036023*^9, 3.4599705138673058`*^9}, { 3.4599706497379417`*^9, 3.459970685548401*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Sin", "^", RowBox[{"2", "[", "x", "]"}]}]], "Input", CellChangeTimes->{{3.459970398283876*^9, 3.459970400836054*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData[ SuperscriptBox["Sin", RowBox[{"2", "[", "x", "]"}]]], "Output", CellChangeTimes->{3.4599704025137043`*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Sin", "^", RowBox[{"(", RowBox[{"2", "[", "x", "]"}], ")"}]}]], "Input", CellChangeTimes->{{3.459970398283876*^9, 3.459970431035235*^9}, { 3.459970800667163*^9, 3.459970807222295*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData[ SuperscriptBox["Sin", RowBox[{"2", "[", "x", "]"}]]], "Output", CellChangeTimes->{3.459970431757863*^9, 3.4599708081616373`*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Open ]], Cell[TextData[{ "The other expression, ", StyleBox["Sin^2[x]", "Input"], ", is interpreted by ", StyleBox["Mathematica", FontSlant->"Italic"], " to be the variable(?) ", StyleBox["Sin", "Input"], " to the power ", StyleBox["2[x]", "Input"], " (whatever that is!!?)." }], "Text", CellChangeTimes->{{3.4599707128132677`*^9, 3.459970860952094*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[TextData[{ "6) Calculate ", Cell[BoxData[ FormBox[ SuperscriptBox["\[ExponentialE]", RowBox[{"ln", " ", "x"}]], TraditionalForm]]], "and ", Cell[BoxData[ FormBox[ RowBox[{"ln", "(", SuperscriptBox["\[ExponentialE]", "x"], ")"}], TraditionalForm]]], " using ", StyleBox["Mathematica", FontSlant->"Italic"], " (assuming that ", StyleBox["x", FontSlant->"Italic"], " has not been assigned a value)." }], "Text", CellChangeTimes->{{3.459968611660166*^9, 3.45996861241997*^9}, { 3.459968782413658*^9, 3.4599688702983913`*^9}, 3.45996931334589*^9, 3.459970927182919*^9}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{"Exp", "[", RowBox[{"Log", "[", "x", "]"}], "]"}], "\[IndentingNewLine]", RowBox[{"Log", "[", RowBox[{"Exp", "[", "x", "]"}], "]"}]}], "Input", CellChangeTimes->{{3.459970980426537*^9, 3.459971000659957*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData["x"], "Output", CellChangeTimes->{3.4599710019624367`*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData[ RowBox[{"Log", "[", SuperscriptBox["\[ExponentialE]", "x"], "]"}]], "Output", CellChangeTimes->{3.4599710020989103`*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Open ]], Cell[TextData[{ "It is curious that, in one case, ", StyleBox["Mathematica", FontSlant->"Italic"], " knows that the log and exponential functions are inverses of each other, \ and in the other case, it does not." }], "Text", CellChangeTimes->{{3.4599710168981457`*^9, 3.459971081572844*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[TextData[{ "7) What happens when you evaulate a function where it is undefined? For \ example, try evaluating ", Cell[BoxData[ FormBox[ SqrtBox[ RowBox[{"-", "1"}]], TraditionalForm]]], ", tan(\[Pi]/2), ln(0), ln(-1)." }], "Text", CellChangeTimes->{{3.459968963439313*^9, 3.459968964287631*^9}, { 3.459969001996893*^9, 3.459969176924686*^9}, 3.4599693239222107`*^9, { 3.4599693732633257`*^9, 3.4599693744104357`*^9}, 3.4599694998635893`*^9}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{"Sqrt", "[", RowBox[{"-", "1"}], "]"}], "\[IndentingNewLine]", RowBox[{"Tan", "[", RowBox[{"Pi", "/", "2"}], "]"}], "\[IndentingNewLine]", RowBox[{"Log", "[", "0", "]"}], "\[IndentingNewLine]", RowBox[{"Log", "[", RowBox[{"-", "1"}], "]"}]}], "Input", CellChangeTimes->{{3.459971118370235*^9, 3.459971142653212*^9}}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData["\[ImaginaryI]"], "Output", CellChangeTimes->{3.4599711448396473`*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData["ComplexInfinity"], "Output", CellChangeTimes->{3.459971144970581*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData[ RowBox[{"-", "\[Infinity]"}]], "Output", CellChangeTimes->{3.459971144997155*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]], Cell[BoxData[ RowBox[{"\[ImaginaryI]", " ", "\[Pi]"}]], "Output", CellChangeTimes->{3.459971145113693*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Open ]], Cell[TextData[{ "In some of these cases ", StyleBox["Mathematica", FontSlant->"Italic"], " gives infinity as the answer - though there seems to be more than one kind \ of infinity. In other cases, ", StyleBox["Mathematica", FontSlant->"Italic"], " gives complex numbers as solutions. " }], "Text", CellChangeTimes->{{3.459971154081202*^9, 3.459971248048851*^9}, 3.460061472629056*^9}, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Open ]] }, WindowSize->{819, 716}, WindowMargins->{{Automatic, 390}, {Automatic, 88}}, ShowSelection->True, Magnification->1., 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, 277, 3, 67, "Section"], Cell[870, 28, 252, 7, 26, "Text"], Cell[1125, 37, 100, 3, 27, "Input"], Cell[1228, 42, 78, 2, 27, "Input"], Cell[1309, 46, 630, 22, 41, "Text"], Cell[1942, 70, 248, 6, 26, "Text"], Cell[2193, 78, 116, 3, 27, "Input"], Cell[2312, 83, 114, 3, 27, "Input"], Cell[2429, 88, 984, 30, 71, "Text"], Cell[3416, 120, 222, 3, 26, "Text"], Cell[CellGroupData[{ Cell[3663, 127, 248, 7, 27, "Input"], Cell[3914, 136, 161, 3, 27, "Output"] }, Open ]], Cell[4090, 142, 223, 4, 26, "Text"], Cell[CellGroupData[{ Cell[4338, 150, 274, 8, 27, "Input"], Cell[4615, 160, 158, 3, 27, "Output"] }, Open ]], Cell[4788, 166, 292, 10, 39, "Text"], Cell[CellGroupData[{ Cell[5105, 180, 300, 10, 27, "Input"], Cell[5408, 192, 178, 4, 27, "Output"] }, Open ]], Cell[5601, 199, 784, 25, 44, "Text"], Cell[CellGroupData[{ Cell[6410, 228, 400, 10, 43, "Input"], Cell[6813, 240, 173, 5, 30, "Output"], Cell[6989, 247, 171, 5, 30, "Output"] }, Open ]], Cell[7175, 255, 343, 9, 26, "Text"], Cell[CellGroupData[{ Cell[7543, 268, 193, 5, 27, "Input"], Cell[7739, 275, 173, 5, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7949, 285, 266, 7, 27, "Input"], Cell[8218, 294, 195, 5, 30, "Output"] }, Open ]], Cell[8428, 302, 405, 14, 26, "Text"], Cell[8836, 318, 610, 21, 30, "Text"], Cell[CellGroupData[{ Cell[9471, 343, 289, 7, 43, "Input"], Cell[9763, 352, 120, 3, 27, "Output"], Cell[9886, 357, 187, 5, 33, "Output"] }, Open ]], Cell[10088, 365, 345, 9, 41, "Text"], Cell[10436, 376, 465, 11, 31, "Text"], Cell[CellGroupData[{ Cell[10926, 391, 404, 10, 73, "Input"], Cell[11333, 403, 132, 3, 27, "Output"], Cell[11468, 408, 132, 3, 27, "Output"], Cell[11603, 413, 145, 4, 27, "Output"], Cell[11751, 419, 156, 4, 27, "Output"] }, Open ]], Cell[11922, 426, 446, 13, 41, "Text"] }, Open ]] } ] *) (* End of internal cache information *)