(* 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[ 13209, 480] NotebookOptionsPosition[ 10495, 388] NotebookOutlinePosition[ 10882, 405] CellTagsIndexPosition[ 10839, 402] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ StyleBox["261 ", FontColor->RGBColor[0, 0, 1]], StyleBox["Mathematica", FontSlant->"Italic", FontColor->RGBColor[0, 0, 1]], StyleBox[" Session 1", FontColor->RGBColor[0, 0, 1]] }], "Subtitle", TextAlignment->Center, TextJustification->0], Cell["\<\ Congratulations, you successfully loaded the first notebook. \ \>", "Text"], Cell[TextData[StyleBox["Be sure to switch control of the keyboard and mouse \ regularly, so that all group members can be equally frustrated.", FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]]], "Text"], Cell[CellGroupData[{ Cell["Clear symbols", "Section", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ In order to avoid interference from symbols defined in other notebooks, we \ first Clear all symbols. We assume that the relevant symbols are in the \ Global` context.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Clear[\"Global`*\"]", "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell["Overview", "Section"], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic", FontColor->RGBColor[0, 1, 0]], StyleBox[" Short Cuts", FontColor->RGBColor[0, 1, 0]] }], "Subsection"], Cell[TextData[{ StyleBox["Use the Enter key at the far right (on the numeric keypad) to \ evaluate an expression --- you don't need to hold down Shift! ", "Text"], StyleBox["Try it!", "Text", FontColor->RGBColor[1, 0, 0]], StyleBox["\n\n", "Text"], "Keyboard Copy and Paste. Whenever possible, use the Copy and Paste \ functions to save time but also to cut down on errors (for example, when \ using a function found in the Help Browser). Ctrl-c and Ctrl-p are a \ convenient shortcut to using\nthe menu versions of Copy and Paste. (Ctrl-x \ is Cut.)\n\n", StyleBox["Command completion!", FontColor->RGBColor[1, 0, 0]], " This is activated by Ctrl-k (under Windows; alt-K under Linux). If you \ start typing a function and then press Ctrl-k, a pop-up menu will show all of \ the (loaded) ", StyleBox["Mathematica", FontSlant->"Italic"], " commands that start with the letters you've typed. You can select among \ the choices to avoiding typing (and misspelling) the function name. \n", StyleBox["Try it with the letters Sin and then try your own.\n\n", FontColor->RGBColor[1, 0, 0]], "Referring to previous results: Use % to refer to the last result and %10 \ to refer to the result Out[10]. For example:" }], "Text"], Cell[BoxData[ RowBox[{"5", "^", "2"}]], "Input"], Cell[BoxData[ RowBox[{"Sqrt", "[", "%", "]"}]], "Input"], Cell[BoxData[""], "Input"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox[" Palettes --- First Pass ", FontColor->RGBColor[0, 1, 0]]], "Subsection"], Cell[TextData[{ "The BasicCalculations and BasicInputs palettes are particularly useful.\n \ 1. Open these palettes by going under the File menu, and selecting \"Palettes\ \" etc.\n 2. Try calculating ", Cell[BoxData[ FormBox[ RadicalBox["27", "3"], TraditionalForm]]], " using the BasicInputs palette.\n Use Cell -> Convert to . . . to \ convert to InputForm and then back\n to StandardForm and then to \ TraditionalForm.\n 3. Take a quick look at the BasicCalculations palette. \ We'll use it below.\n It provides a quick-reference to basic ", StyleBox["Mathematica", FontSlant->"Italic"], " functions and syntax.\n Try: a) calculate \[Pi] to 1000 digits;\n \ b) solve the quadratic equation a", Cell[BoxData[ FormBox[ SuperscriptBox["x", "2"], TraditionalForm]]], " + bx + c = 0.\n c) plot the function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"sin", "(", "x", ")"}], "/", "x"}], TraditionalForm]]], " from -10 to 10." }], "Text"] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Some Homework Related ", StyleBox["Mathematica", FontSlant->"Italic"], " Stuff" }], "Section", CellChangeTimes->{{3.4319388213710003`*^9, 3.431938823582*^9}}], Cell["", "Text"], Cell[CellGroupData[{ Cell[TextData[{ "Vectors with ", StyleBox["Mathematica", FontSlant->"Italic"], " " }], "Subsection"], Cell[TextData[{ "In ", StyleBox["Mathematica ", FontSlant->"Italic"], "a vector is just a list of its components. Let's define two specific \ vectors by evaluating the following cells. Note that the use of curly \ brackets" }], "Text"], Cell[BoxData[ RowBox[{"v1", " ", "=", " ", RowBox[{"{", RowBox[{"1", ",", "2", ",", "3"}], "}"}]}]], "Input"], Cell[BoxData[ RowBox[{"v2", " ", "=", " ", RowBox[{"{", RowBox[{"2", ",", "3", ",", "4"}], "}"}]}]], "Input"], Cell["Here are some of the things you can now compute:", "Text"], Cell[BoxData[ RowBox[{"v1", " ", "+", " ", "v2"}]], "Input"], Cell[BoxData[ RowBox[{"Dot", "[", RowBox[{"v1", ",", "v2"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"Cross", "[", RowBox[{"v1", ",", "v2"}], "]"}]], "Input"], Cell[TextData[{ "\nNote that ", StyleBox["Mathematica", FontSlant->"Italic"], " is quite content to work with symbols in place of actual numbers:" }], "Text", CellChangeTimes->{3.431938689527*^9}], Cell[BoxData[ RowBox[{"a", " ", "=", " ", RowBox[{"{", RowBox[{"Ax", ",", "Ay", ",", "Az"}], "}"}]}]], "Input"], Cell[BoxData[ RowBox[{"b", " ", "=", " ", RowBox[{"{", RowBox[{"Bx", ",", "By", ",", "Bz"}], "}"}]}]], "Input"], Cell[BoxData[ RowBox[{"Dot", "[", RowBox[{"a", ",", "b"}], "]"}]], "Input"], Cell[TextData[{ "Here is how we can show that ", StyleBox["A \[SmallCircle] (A \[Times] B)", FontWeight->"Bold"], " = 0 :" }], "Text"], Cell[BoxData[ RowBox[{"V", " ", "=", " ", RowBox[{"Dot", "[", RowBox[{"a", ",", RowBox[{"Cross", "[", RowBox[{"a", ",", "b"}], "]"}]}], "]"}]}]], "Input"], Cell[TextData[{ "This may not immediately look like zero, but it is. We just have to tell \ ", StyleBox["Mathematica", FontSlant->"Italic"], " to simplify:" }], "Text"], Cell[BoxData[ RowBox[{"Simplify", "[", "V", "]"}]], "Input"], Cell[TextData[{ "Here is an exercise you can try: use ", StyleBox["Mathematica", FontSlant->"Italic"], " to prove the vector identity\n ", StyleBox["a \[Times] (b \[Times] c) = b (a \[SmallCircle] c) - c (a \ \[SmallCircle] b). \n", FontWeight->"Bold"], "Try it first on your own before opening up the solution cell below." }], "Text"], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell[BoxData[ RowBox[{"c", " ", "=", " ", RowBox[{"{", RowBox[{"Cx", ",", "Cy", ",", "Cz"}], "}"}]}]], "Input", CellChangeTimes->{{3.431938702947*^9, 3.431938705333*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Cross", "[", RowBox[{"a", ",", RowBox[{"Cross", "[", RowBox[{"b", ",", "c"}], "]"}]}], "]"}], " ", "-", " ", RowBox[{ RowBox[{"Dot", "[", RowBox[{"a", ",", "c"}], "]"}], "*", "b"}], "+", RowBox[{ RowBox[{"Dot", "[", RowBox[{"a", ",", "b"}], "]"}], "*", "c"}]}]], "Input"], Cell[BoxData[ RowBox[{"Simplify", "[", "%", "]"}]], "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[" Plotting Functions", "Subsection"], Cell["\<\ Time and time again we will want to plot functions. For example:\ \>", "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", RowBox[{"6", " ", "Pi"}]}], "}"}]}], "]"}]], "Input"], Cell["\<\ Your job: plot Sinh[x] and Cosh[x] together, as in BTM figure 1.3\ \>", "Text", CellChangeTimes->{{3.431938879774*^9, 3.43193888385*^9}, {3.431939008425*^9, 3.43193903738*^9}}], Cell["And of course why not reproduce figure 1.7, the plot of ", "Text", CellChangeTimes->{{3.4319391294560003`*^9, 3.431939149401*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"S", "[", "x_", "]"}], " ", "=", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"x", "^", "2"}], "+", "x", "-", "6"}], ")"}], "/", RowBox[{"(", RowBox[{"4", "+", RowBox[{"Cosh", "[", "x", "]"}]}], ")"}]}]}]], "Input", CellChangeTimes->{{3.4319391549639997`*^9, 3.43193917658*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[" Calculus", "Subsection"], Cell["To take a derivative:", "Text"], Cell[BoxData[ RowBox[{"D", "[", RowBox[{ RowBox[{"Sinh", "[", "x", "]"}], ",", "x"}], "]"}]], "Input", CellChangeTimes->{3.431939049164*^9}], Cell["\<\ Now think of an ugly one and try it. In particular, you can cross-check the \ BTM homework, which asks for the derivatives of, e.g.\ \>", "Text", CellChangeTimes->{{3.4319388355220003`*^9, 3.43193886348*^9}}], Cell[BoxData[{ RowBox[{"Sin", "[", RowBox[{ RowBox[{"x", "^", "3"}], "+", "2"}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Tan", "[", "x", "]"}], "^", "3"}], "\[IndentingNewLine]", RowBox[{"ArcTanh", "[", "x", "]"}]}], "Input", CellChangeTimes->{{3.431939071678*^9, 3.431939105908*^9}}], Cell["Or to integrate (indefinite):", "Text"], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], ",", "x"}], "]"}]], "Input"], Cell["With definite limits:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Exp", "[", RowBox[{"-", "x"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "3"}], "}"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"1", "-", FractionBox["1", SuperscriptBox["\[ExponentialE]", "3"]]}]], "Output"] }, Open ]], Cell[TextData[{ "Try it with limits from 0 to Infinity.\nAnd finally, here is a game--- \ invent a truly horrible integrand, and either be impressed that ", StyleBox["Mathematica", FontSlant->"Italic"], " can find the integral, or be impressed with yourself for stumping the \ computer.\n" }], "Text", CellChangeTimes->{{3.431938738873*^9, 3.431938739568*^9}, { 3.4319392377469997`*^9, 3.43193932376*^9}}] }, Open ]] }, Open ]] }, Open ]] }, WindowToolbars->"EditBar", WindowSize->{1016, 666}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, ShowSelection->True, FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (May 21, 2008)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 266, 10, 50, "Subtitle"], Cell[859, 35, 85, 3, 47, "Text"], Cell[947, 40, 205, 3, 29, "Text"], Cell[CellGroupData[{ Cell[1177, 47, 78, 2, 71, "Section", Evaluatable->False], Cell[1258, 51, 238, 6, 29, "Text", Evaluatable->False], Cell[1499, 59, 61, 1, 31, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[1597, 65, 27, 0, 71, "Section"], Cell[CellGroupData[{ Cell[1649, 69, 171, 6, 36, "Subsection"], Cell[1823, 77, 1242, 24, 209, "Text"], Cell[3068, 103, 49, 1, 31, "Input"], Cell[3120, 106, 57, 1, 31, "Input"], Cell[3180, 109, 26, 0, 31, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3243, 114, 98, 1, 36, "Subsection"], Cell[3344, 117, 1034, 24, 197, "Text"] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[4427, 147, 181, 6, 71, "Section"], Cell[4611, 155, 16, 0, 29, "Text"], Cell[CellGroupData[{ Cell[4652, 159, 105, 5, 36, "Subsection"], Cell[4760, 166, 242, 7, 29, "Text"], Cell[5005, 175, 117, 3, 31, "Input"], Cell[5125, 180, 117, 3, 31, "Input"], Cell[5245, 185, 64, 0, 29, "Text"], Cell[5312, 187, 61, 1, 31, "Input"], Cell[5376, 190, 81, 2, 31, "Input"], Cell[5460, 194, 83, 2, 31, "Input"], Cell[5546, 198, 202, 6, 47, "Text"], Cell[5751, 206, 119, 3, 31, "Input"], Cell[5873, 211, 119, 3, 31, "Input"], Cell[5995, 216, 79, 2, 31, "Input"], Cell[6077, 220, 139, 5, 29, "Text"], Cell[6219, 227, 173, 5, 31, "Input"], Cell[6395, 234, 174, 6, 29, "Text"], Cell[6572, 242, 61, 1, 31, "Input"], Cell[6636, 245, 350, 9, 65, "Text"], Cell[CellGroupData[{ Cell[7011, 258, 33, 0, 28, "Subsubsection"], Cell[7047, 260, 179, 4, 31, "Input"], Cell[7229, 266, 343, 11, 31, "Input"], Cell[7575, 279, 61, 1, 31, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7685, 286, 41, 0, 36, "Subsection"], Cell[7729, 288, 88, 2, 29, "Text"], Cell[7820, 292, 197, 6, 31, "Input"], Cell[8020, 300, 190, 4, 29, "Text"], Cell[8213, 306, 137, 1, 29, "Text"], Cell[8353, 309, 343, 10, 31, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[8733, 324, 31, 0, 36, "Subsection"], Cell[8767, 326, 37, 0, 29, "Text"], Cell[8807, 328, 148, 4, 31, "Input"], Cell[8958, 334, 220, 4, 29, "Text"], Cell[9181, 340, 306, 7, 72, "Input"], Cell[9490, 349, 45, 0, 29, "Text"], Cell[9538, 351, 116, 3, 31, "Input"], Cell[9657, 356, 37, 0, 29, "Text"], Cell[CellGroupData[{ Cell[9719, 360, 195, 6, 31, "Input"], Cell[9917, 368, 110, 3, 46, "Output"] }, Open ]], Cell[10042, 374, 413, 9, 65, "Text"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)