(* 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[ 15024, 522] NotebookOptionsPosition[ 12721, 455] NotebookOutlinePosition[ 13121, 472] CellTagsIndexPosition[ 13078, 469] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[TextData[{ "A brief intro to what ", StyleBox["Mathematica", FontSlant->"Italic"], " can do" }], "Title", CellChangeTimes->{3.454518558171875*^9}], Cell["", "Subsubtitle", CellChangeTimes->{{3.45451854003125*^9, 3.454518558171875*^9}}], Cell["Getting Help and basic Calculus", "Subsubsection"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " has a tremendous amount of information in its help files. The problem is \ knowing what to look for... Lets say we wanted a command to calculate the \ Taylor Series of a function, we might think the function that does this is \ called 'Taylor'. If 'Taylor' is a function, typing '?Taylor' will display \ the syntax of that function." }], "Text"], Cell[BoxData[ RowBox[{"?", "Taylor"}]], "Input", FontSize->18], Cell["\<\ Well, that didn't work. Maybe the function is called 'Series'...\ \>", "Text"], Cell[BoxData[ RowBox[{"?", "Series"}]], "Input", FontSize->18], Cell["Typing '??Series' will give us even more information!", "Text"], Cell[BoxData[ RowBox[{"??", "Series"}]], "Input", FontSize->18], Cell["\<\ Lets try this out on a few functions. What is the Taylor series of f(x)=e^x \ about the point x=0?\ \>", "Text"], Cell[BoxData[ RowBox[{"Series", "[", RowBox[{ RowBox[{"Exp", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "12"}], "}"}]}], "]"}]], "Input", FontSize->18], Cell["What about f(x)=sin(x)?", "Text"], Cell[BoxData[ RowBox[{"Series", "[", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "12"}], "}"}]}], "]"}]], "Input", FontSize->18], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " can also easilly take derivatives. If f(x)=Sin(x), what is f'(x)? f''(x)? \ The 97th derivative of f(x)?" }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"Sin", "'"}], "[", "x", "]"}]], "Input", FontSize->18], Cell[BoxData[ RowBox[{ RowBox[{"Sin", "''"}], "[", "x", "]"}]], "Input", FontSize->18], Cell[BoxData[ RowBox[{"D", "[", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "97"}], "}"}]}], "]"}]], "Input", FontSize->18], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " can also integrate!" }], "Text"], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{"x", "^", "2"}], ",", "x"}], "]"}]], "Input", FontSize->18], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Tan", "[", "x", "]"}], ",", "x"}], "]"}]], "Input", FontSize->18], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Sin", "[", RowBox[{"Log", "[", "x", "]"}], "]"}], ",", "x"}], "]"}]], "Input", FontSize->18], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{"1", "/", RowBox[{"Sqrt", "[", RowBox[{"1", "-", RowBox[{"x", "^", "2"}]}], "]"}]}], ",", "x"}], "]"}]], "Input", FontSize->18], Cell["Types of cells", "Subsubsection"], Cell[TextData[{ "See the blue lines on the right side of the window? They are called cells. \ Everything you INPUT and everything ", StyleBox["Mathematica", FontSlant->"Italic"], " OUTPUTS are in cells. Cells can also be NESTED.\nThere are many different \ types of cells, here are some examples:" }], "Text"], Cell["Title", "Title"], Cell["Subtitle", "Subtitle"], Cell["Subsubtitle", "Subsubtitle"], Cell["Text", "Text"], Cell[BoxData[ RowBox[{"1", "+", "1", " "}]], "Input"], Cell["Plots and animations", "Subsubsection"], Cell["Lets plot f(x)=x^6.", "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"x", "^", "6"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "]"}]], "Input", FontSize->18], Cell["\<\ We can also display multiple plots on the same graph. Here are plots of \ f(x)=x^6 and its first 5 derivatives.\ \>", "Text"], Cell[BoxData[ RowBox[{"Show", "[", "\[IndentingNewLine]", RowBox[{"Table", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"D", "[", RowBox[{ RowBox[{"x", "^", "6"}], ",", RowBox[{"{", RowBox[{"x", ",", "i"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "5"}], "}"}]}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", "]"}]], "Input", FontSize->18], Cell[TextData[{ "We can also do animations! What does the parameter ", StyleBox["a", FontSlant->"Italic"], " do to the function f(x)=(x-a)^2?" }], "Text"], Cell[BoxData[ RowBox[{"Animate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"x", "-", "a"}], ")"}], "^", "2"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "8"}], ",", "8"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "10"}], "}"}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"a", ",", RowBox[{"-", "5"}], ",", "5", ",", ".2"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.454518235953125*^9, 3.454518236875*^9}}, FontSize->18], Cell["Plots and animations in 3D", "Subsubsection"], Cell["\<\ One of the things we will be doing in Calc III is plotting 3D functions, \ functions of two variables!\ \>", "Text"], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{ RowBox[{"Exp", "[", RowBox[{"-", RowBox[{"Sqrt", "[", RowBox[{"(", RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ")"}], "]"}]}], "]"}], "*", RowBox[{"Sin", "[", RowBox[{"3", "*", "x"}], "]"}], "*", RowBox[{"Cos", "[", RowBox[{"Pi", "*", "y"}], "]"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "Pi"}], ",", "Pi"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "Pi"}], ",", "Pi"}], "}"}]}], "]"}]], "Input", FontSize->18], Cell["\<\ That really does not look too good. The Plot3D (and Plot - for 2D) command \ can take additional arguments that sometimes improve the way the plot looks. \ This adjusts the z-axis.\ \>", "Text"], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{ RowBox[{"Exp", "[", RowBox[{"-", RowBox[{"Sqrt", "[", RowBox[{"(", RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ")"}], "]"}]}], "]"}], "*", RowBox[{"Sin", "[", RowBox[{"3", "*", "x"}], "]"}], "*", RowBox[{"Cos", "[", RowBox[{"Pi", "*", "y"}], "]"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "Pi"}], ",", "Pi"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "Pi"}], ",", "Pi"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]], "Input", FontSize->18], Cell["\<\ See how the plot looks 'blocky'? We can increase the resolution of the plot.\ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{ RowBox[{"Exp", "[", RowBox[{"-", RowBox[{"Sqrt", "[", RowBox[{"(", RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ")"}], "]"}]}], "]"}], "*", RowBox[{"Sin", "[", RowBox[{"3", "*", "x"}], "]"}], "*", RowBox[{"Cos", "[", RowBox[{"Pi", "*", "y"}], "]"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "Pi"}], ",", "Pi"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "Pi"}], ",", "Pi"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"PlotPoints", "\[Rule]", "40"}], ",", RowBox[{"Mesh", "\[Rule]", "True"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}], "\[IndentingNewLine]"}]], "Input", FontSize->18], Cell["\<\ That looks better, but maybe we do not want the black 'mesh' lines.\ \>", "Text"], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{ RowBox[{"Exp", "[", RowBox[{"-", RowBox[{"Sqrt", "[", RowBox[{"(", RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ")"}], "]"}]}], "]"}], "*", RowBox[{"Sin", "[", RowBox[{"3", "*", "x"}], "]"}], "*", RowBox[{"Cos", "[", RowBox[{"Pi", "*", "y"}], "]"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "Pi"}], ",", "Pi"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "Pi"}], ",", "Pi"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"PlotPoints", "\[Rule]", "120"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]], "Input", FontSize->18], Cell["How about a 3D animation or two?", "Text"], Cell[BoxData[ RowBox[{"Animate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{ RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", "t"}], "*", RowBox[{"Sqrt", "[", RowBox[{"(", RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ")"}], "]"}]}], "]"}], "*", RowBox[{"Sin", "[", RowBox[{"3", "*", "x"}], "]"}], "*", RowBox[{"Cos", "[", RowBox[{"Pi", "*", "y"}], "]"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "Pi"}], ",", "Pi"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "Pi"}], ",", "Pi"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "80"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", ".75"}], ",", ".75"}], "}"}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"t", ",", ".5", ",", "3", ",", "0.05"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.454518352453125*^9, 3.454518353046875*^9}}, FontSize->18], Cell[BoxData[ RowBox[{"Animate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"Sin", "[", RowBox[{ RowBox[{"x", "^", "i"}], "*", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", "0", ",", "3"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "50"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"i", ",", "1", ",", "2.5", ",", ".025"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.454518355453125*^9, 3.45451835609375*^9}}, FontSize->18], Cell["Other types of plots", "Subsubsection"], Cell["We can also do polar and parametric plots!", "Text"], Cell[BoxData[ RowBox[{"PolarPlot", "[", RowBox[{ RowBox[{ RowBox[{"Cos", "[", "t", "]"}], "*", RowBox[{"Sin", "[", "t", "]"}]}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", RowBox[{"2", "*", "Pi"}]}], "}"}]}], "]"}]], "Input", FontSize->18], Cell[BoxData[ RowBox[{"ParametricPlot", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Sin", "[", RowBox[{"5", "*", "t"}], "]"}], ",", RowBox[{"Cos", "[", RowBox[{"3", "*", "t"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"t", ",", "0", ",", RowBox[{"2", "*", "Pi"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}]}], "]"}]], "Input", FontSize->18], Cell[BoxData[ RowBox[{"ParametricPlot", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Sin", "[", RowBox[{"5", "*", "t"}], "]"}], ",", RowBox[{"Cos", "[", RowBox[{"Pi", "*", "t"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"t", ",", "0", ",", RowBox[{"20", "*", "Pi"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}]}], "]"}]], "Input", FontSize->18] }, ScreenStyleEnvironment->"Working", WindowSize->{976, 904}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, ShowSelection->True, FrontEndVersion->"7.0 for Microsoft Windows (32-bit) (February 18, 2009)", StyleDefinitions->"DemoText.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[545, 20, 157, 6, 56, "Title"], Cell[705, 28, 88, 1, 56, "Subsubtitle"], Cell[796, 31, 56, 0, 44, "Subsubsection"], Cell[855, 33, 415, 8, 43, "Text"], Cell[1273, 43, 64, 2, 43, "Input"], Cell[1340, 47, 89, 2, 25, "Text"], Cell[1432, 51, 64, 2, 43, "Input"], Cell[1499, 55, 69, 0, 25, "Text"], Cell[1571, 57, 65, 2, 43, "Input"], Cell[1639, 61, 123, 3, 25, "Text"], Cell[1765, 66, 188, 6, 43, "Input"], Cell[1956, 74, 39, 0, 25, "Text"], Cell[1998, 76, 188, 6, 43, "Input"], Cell[2189, 84, 186, 5, 25, "Text"], Cell[2378, 91, 89, 3, 43, "Input"], Cell[2470, 96, 90, 3, 43, "Input"], Cell[2563, 101, 173, 6, 43, "Input"], Cell[2739, 109, 100, 4, 25, "Text"], Cell[2842, 115, 124, 4, 43, "Input"], Cell[2969, 121, 131, 4, 43, "Input"], Cell[3103, 127, 163, 5, 43, "Input"], Cell[3269, 134, 210, 7, 43, "Input"], Cell[3482, 143, 39, 0, 44, "Subsubsection"], Cell[3524, 145, 317, 7, 73, "Text"], Cell[3844, 154, 22, 0, 56, "Title"], Cell[3869, 156, 28, 0, 37, "Subtitle"], Cell[3900, 158, 34, 0, 56, "Subsubtitle"], Cell[3937, 160, 20, 0, 25, "Text"], Cell[3960, 162, 54, 1, 38, "Input"], Cell[4017, 165, 45, 0, 44, "Subsubsection"], Cell[4065, 167, 35, 0, 25, "Text"], Cell[4103, 169, 199, 7, 43, "Input"], Cell[4305, 178, 136, 3, 25, "Text"], Cell[4444, 183, 624, 18, 152, "Input"], Cell[5071, 203, 160, 5, 25, "Text"], Cell[5234, 210, 651, 18, 125, "Input"], Cell[5888, 230, 51, 0, 44, "Subsubsection"], Cell[5942, 232, 126, 3, 25, "Text"], Cell[6071, 237, 627, 21, 71, "Input"], Cell[6701, 260, 206, 4, 43, "Text"], Cell[6910, 266, 677, 22, 71, "Input"], Cell[7590, 290, 101, 2, 25, "Text"], Cell[7694, 294, 857, 26, 125, "Input"], Cell[8554, 322, 91, 2, 25, "Text"], Cell[8648, 326, 798, 24, 98, "Input"], Cell[9449, 352, 48, 0, 25, "Text"], Cell[9500, 354, 1175, 34, 125, "Input"], Cell[10678, 390, 671, 18, 98, "Input"], Cell[11352, 410, 45, 0, 44, "Subsubsection"], Cell[11400, 412, 58, 0, 25, "Text"], Cell[11461, 414, 274, 9, 43, "Input"], Cell[11738, 425, 487, 13, 125, "Input"], Cell[12228, 440, 489, 13, 125, "Input"] } ] *) (* End of internal cache information *)