(* 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[ 110961, 3592] NotebookOptionsPosition[ 96154, 3170] NotebookOutlinePosition[ 96702, 3194] CellTagsIndexPosition[ 96635, 3189] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Introduction to ", StyleBox["Mathematica \[MathematicaIcon]", FontSlant->"Italic"] }], "Title"], Cell["I. Getting Started", "Subtitle"], Cell["\<\ P. S. Cally, School of Mathematical Sciences, Monash University\ \>", "Author"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " is an extremely powerful computing environment in which to do mathematics. \ It excels at both symbolic and numerical mathematics, and also contains many \ powerful graphical utilities. It's great strength is that it enables you to \ do mathematics quickly and easily, and in a way which is close to how the \ \"mathematical mind\" operates, without having to think too much about \ computing issues.\nHowever, ", StyleBox["Mathematica", FontSlant->"Italic"], " is also a very powerful programming language. We will learn more about \ this as we proceed." }], "Text", FontSize->14, FontWeight->"Bold", FontColor->RGBColor[0.117647, 0.141176, 0.643137]], Cell[TextData[{ StyleBox["Before you start", FontSize->14, FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontWeight->"Bold"], "Is this text big enough for you? If not, you may like to adjust the \ magnification. Go to Window > Magnification and set say 150%.\n\n", StyleBox["WARNING", FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], " Which version are you using. This notebook is for Version 6.0, and will \ not work for any earlier version. A V5.2 notebook is available." }], "Text", CellChangeTimes->{{3.401221996888896*^9, 3.401222055769052*^9}, { 3.401318504663136*^9, 3.401318517713002*^9}, 3.401561764963949*^9}], Cell[CellGroupData[{ Cell["First Steps", "Section"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " consists of two parts, the ", StyleBox["front end", FontVariations->{"Underline"->True}], " and the ", Cell[BoxData[ FormBox[ StyleBox["kernel", FontVariations->{"Underline"->True}], TraditionalForm]]], ". The kernel is what does the actual work, whilst the front end is what \ displays and controls notebooks like this one. The two don't even have to be \ running on the same computer! Clearly, as I type this, the front end is \ working. However, as yet, the kernel has not been started. I ", StyleBox["could ", FontSlant->"Italic"], "start it by going to the menu item Kernel>Start kernel>Local, but this is \ not necessary. Instead, the first time I try to actually evaluate something, \ the kernel will fire up. To do this, I type a ", StyleBox["Mathematica", FontSlant->"Italic"], " expression in a new cell, ", StyleBox["and evaluate it with ", FontColor->RGBColor[1, 0, 0]], StyleBox["Shift+Enter", FontVariations->{"Underline"->True}, FontColor->RGBColor[1, 0, 0]], ":" }], "Text"], Cell[BoxData["$Version"], "Input", CellChangeTimes->{{3.401221984830967*^9, 3.401221987169182*^9}}], Cell[TextData[{ "As you will have noticed, that took a few seconds. That is not because ", StyleBox["Mathematica", FontSlant->"Italic"], " was having trouble working out its version, but just because it was \ starting the kernel. Other expressions will now be much faster:" }], "Text", CellChangeTimes->{{3.401561785367099*^9, 3.4015618018852863`*^9}}], Cell[BoxData[ RowBox[{"100", "!"}]], "Input"], Cell["\<\ Notice how there are several (actually many) types of cell in a front end. So \ far, we have seen Text, Input, and Output. Only Input is evaluated (with \ Shift+Enter), producing Output. Text cannot be evaluated, and is there just \ as a \"comment\" for the reader. Input is the default format. You can set \ format type with the menu item Format>Style>Text etc., or with keyboard \ shortcuts (e.g., Mod1+7 for Text, Mod1+9 for Input). See the Format>Style \ menu for details.\ \>", "Text", CellChangeTimes->{{3.401495252117797*^9, 3.401495254707616*^9}}], Cell["\<\ Alright, that's enough for now. Let's close this section by double-clicking \ on the cell bar at the right which encloses it all. Bye bye ..., but don't \ forget to double click on the next section's cell bar to open it. Oh, and by \ the way, hit File>Save every once in a while.\ \>", "Text", CellChangeTimes->{3.401494902771748*^9, 3.401495270152072*^9}] }, Closed]], Cell[CellGroupData[{ Cell["Basic Numerical Calculations", "Section"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " is obviously a powerful scientific calculator." }], "Text"], Cell[TextData[{ "Here is a simple example; let's evaluate ", Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["\[ExponentialE]", "2"], "."}], TraditionalForm]]] }], "Text"], Cell[BoxData[ RowBox[{"Exp", "[", "2.0", "]"}]], "Input"], Cell["I could also have written this as", "Text"], Cell[BoxData[ SuperscriptBox["\[ExponentialE]", "2.0"]], "Input"], Cell["or even", "Text"], Cell[BoxData[ RowBox[{"E", "^", "2.0"}]], "Input"], Cell[TextData[{ "I generally prefer the more \"mathematical\" style ", Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["\[ExponentialE]", "2"], ",", " ", RowBox[{"but", " ", RowBox[{"that", "'"}], "s", " ", "up", " ", "to", " ", RowBox[{"you", "."}]}]}], TraditionalForm]]] }], "Text"], Cell[TextData[{ StyleBox["Aside: ", FontColor->RGBColor[1, 0, 0]], StyleBox["How the hell did he type ", FontSlant->"Italic", FontColor->RGBColor[1, 0, 0]], Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["\[ExponentialE]", "2"], "?"}], TraditionalForm]], FontSlant->"Italic", FontColor->RGBColor[1, 0, 0]], StyleBox[" Well, you can do it from the various font palettes which ", FontColor->RGBColor[1, 0, 0]], StyleBox["Mathematica", FontSlant->"Italic", FontColor->RGBColor[1, 0, 0]], StyleBox[" makes available, but it's easier to use the keyboard shortcut \ esc-ee-esc-ctrl+2-ctrl+space.", FontColor->RGBColor[1, 0, 0]] }], "Text"], Cell[TextData[{ "But why did I write ", Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["\[ExponentialE]", "2.0"], " ", "instead", " ", "of", " ", SuperscriptBox["\[ExponentialE]", "2"], " ", "or", " ", RowBox[{ RowBox[{ RowBox[{"Exp", "[", "2", "]"}], "?", " ", "Let"}], "'"}], StyleBox["s", FontSlant->"Plain"], " ", "try", " ", "it"}], TraditionalForm]]], ":" }], "Text"], Cell[BoxData[ RowBox[{"Exp", "[", "2", "]"}]], "Input"], Cell[TextData[{ "See what happens? It stays unevaluated, as ", Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["\[ExponentialE]", "2"], " ", "is", " ", "the", " ", "exact", " ", RowBox[{"answer", ".", " ", "If"}], " ", StyleBox["I", FontSlant->"Plain"], " ", "want", " ", "to", " "}], TraditionalForm]]], "evailuate it numerically, I can use the function N[..]:" }], "Text"], Cell[BoxData[ RowBox[{"N", "[", RowBox[{"Exp", "[", "2", "]"}], "]"}]], "Input"], Cell["or equivalently", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"Exp", "[", "2", "]"}], "//", "N"}]], "Input"], Cell[TextData[{ "When you ask for Exp[2.0], ", StyleBox["Mathematica", FontSlant->"Italic"], " recognizes that you are giving it numerical input, and so gives you back \ numerical output. But does ", StyleBox["Mathematica", FontSlant->"Italic"], " only give you 6 significant figures? No, by default, it gives you full \ \"double precision\", i.e., around 16. It's just that it displays a shortened \ form unless you ask for the full expression:" }], "Text"], Cell[BoxData[ RowBox[{"%", "//", "FullForm"}]], "Input"], Cell["\<\ By the way, % means the output from the last evaluation, %%, the second last \ etc. You can also write %12 say to get the output Out[12], but use this \ feature sparingly, as the next time you open a notebook you may not have the \ same numberings.\ \>", "Text"], Cell["But what if I want more significant figures?", "Text"], Cell[BoxData[ RowBox[{"N", "[", RowBox[{ SuperscriptBox["\[ExponentialE]", "2"], ",", "40"}], "]"}]], "Input"], Cell["or even", "Text"], Cell[BoxData[ RowBox[{"N", "[", RowBox[{ SuperscriptBox["\[ExponentialE]", "2"], ",", "200"}], "]"}]], "Input"], Cell["No problem!", "Text"], Cell["But what if I try this?", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"N", "[", RowBox[{ SuperscriptBox["\[ExponentialE]", "2.0"], ",", "40"}], "]"}], "//", "FullForm"}]], "Input"], Cell[TextData[{ "What went wrong? ", StyleBox["You tell me!\n", FontWeight->"Bold", FontSlant->"Italic"], "\nEver wanted to see \[Pi] to 1000 digits? No! Well tough luck; here it \ is..." }], "Text", CellChangeTimes->{3.4015619800557203`*^9}], Cell[BoxData[ RowBox[{"N", "[", RowBox[{"\[Pi]", ",", "1000"}], "]"}]], "Input", CellChangeTimes->{{3.401562276091016*^9, 3.401562283172798*^9}}], Cell["Finally, we note that complex numbers are fine:", "Text"], Cell[BoxData[ SuperscriptBox["\[ImaginaryI]", "2"]], "Input"], Cell[TextData[{ "By the way, ", StyleBox["Mathematica", FontSlant->"Italic"], " distinguishes between the variable i and the imaginary unit \[ImaginaryI], \ which you can enter with esc-ii-esc. \n\nLet's solve a quartic equation:" }], "Text", CellChangeTimes->{{3.401562015861096*^9, 3.401562119940744*^9}, { 3.4015621531190243`*^9, 3.40156217135742*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["x", "4"], "+", SuperscriptBox["x", "2"], "+", "x", "+", "3"}], "\[Equal]", "0"}], ",", "x"}], "]"}], "//", "N"}]], "Input"], Cell[TextData[{ "Three different ways to enter ", Cell[BoxData[ FormBox[ SqrtBox[ RowBox[{"-", "1"}]], TraditionalForm]]], ": \[ImaginaryI], \[ImaginaryJ], or I. Take your pick." }], "Text"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"\[ImaginaryI]", "\[Equal]", "I"}], ",", RowBox[{"\[ImaginaryI]", "\[Equal]", "\[ImaginaryJ]"}]}], "}"}]], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["= and ==, not to mention >, &&, || etc.", "Section"], Cell["\<\ We have just seen an \[Equal] sign. What does this mean? Well, = represents \ an assignment, whereas == is used to represent a symbolic equation. This sets \ a to 3:\ \>", "Text"], Cell[BoxData[ RowBox[{"a", "=", "3"}]], "Input"], Cell[BoxData["a"], "Input"], Cell["This asks if a=3:", "Text", CellChangeTimes->{{3.401562328976901*^9, 3.4015623315988703`*^9}}], Cell[BoxData[ RowBox[{"a", "\[Equal]", "3"}]], "Input"], Cell["Is it 6?", "Text"], Cell[BoxData[ RowBox[{"a", "\[Equal]", "6"}]], "Input"], Cell["What does this return?", "Text"], Cell[BoxData[ RowBox[{"b", "\[Equal]", "4"}]], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " doesn't know, since you haven't told it what b is, so it returns the \ expression unevaluated. If you want to test if b is ", StyleBox["identical", FontSlant->"Italic"], " ", StyleBox["to 4, you can do", FontSlant->"Italic"] }], "Text"], Cell[BoxData[ RowBox[{"b", "===", "4"}]], "Input"], Cell[TextData[StyleBox["Similarly, you can test other expessions:", FontSlant->"Plain"]], "Text", FontSlant->"Italic"], Cell[BoxData[ RowBox[{"a", ">", "2"}]], "Input"], Cell[BoxData[ RowBox[{"a", "\[NotEqual]", "7"}]], "Input"], Cell["\<\ (by the way, you can enter \[NotEqual] as !=). Here we use && to represent \ the logical And operation.\ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"a", ">", "1"}], "&&", RowBox[{ SuperscriptBox["a", "2"], "<", RowBox[{"a", "+", "5"}]}]}]], "Input"], Cell["Here || os the logical Or.", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"a", ">", "1"}], "||", RowBox[{ SuperscriptBox["a", "2"], "<", RowBox[{"a", "+", "5"}]}]}]], "Input"], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"a", ",", "b"}], "]"}]], "Input"], Cell[TextData[{ StyleBox["Important", FontSize->16, FontWeight->"Bold", FontVariations->{"Underline"->True}, FontColor->RGBColor[1, 0, 0]], StyleBox[": ", FontSize->16, FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], StyleBox["you will need the == symbol when defining equations to be solved \ by various ", FontSize->16, FontWeight->"Bold"], StyleBox["Mathematica", FontSize->16, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[" routines, e.g.,", FontSize->16, FontWeight->"Bold"] }], "Text"], Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"a", "+", RowBox[{"3", "b"}]}], "\[Equal]", "5"}], ",", RowBox[{ RowBox[{ RowBox[{"3", "a"}], "-", RowBox[{"9", "b"}]}], "\[Equal]", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "b"}], "}"}]}], "]"}]], "Input"], Cell[TextData[{ "This return a list of ", StyleBox["rules. ", FontSlant->"Italic"], "It can be used to replace a and b with their numeric values:" }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"{", RowBox[{"a", ",", "b"}], "}"}], "/.", "%"}]], "Input"], Cell[TextData[{ "We'll learn more about /. in Chapter 2.\nIf you try to use = instead of == \ in Solve, ", StyleBox["Mathematica", FontSlant->"Italic"], " will complain, since it will think you're trying to set a value." }], "Text"], Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"a", "+", RowBox[{"3", "b"}]}], "=", "5"}], ",", RowBox[{ RowBox[{ RowBox[{"3", "a"}], "-", RowBox[{"9", "b"}]}], "=", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", "b"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.401218418037469*^9, 3.40121841965851*^9}, { 3.401221768542961*^9, 3.401221770915206*^9}}], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"a", ",", "b"}], "]"}]], "Input", CellChangeTimes->{{3.401562406280266*^9, 3.401562413598399*^9}}] }, Closed]], Cell[CellGroupData[{ Cell["Basic Symbolic Calculations", "Section"], Cell["Expand a binomial power", "Text"], Cell[BoxData[ RowBox[{ SuperscriptBox[ RowBox[{"(", RowBox[{"1", "+", " ", "x"}], ")"}], "10"], "//", "Expand"}]], "Input"], Cell["and factor it again", "Text"], Cell[BoxData[ RowBox[{"%", "//", "Factor"}]], "Input"], Cell["What happens with a negative power?", "Text"], Cell[BoxData[ RowBox[{ FractionBox["1", SuperscriptBox[ RowBox[{"(", RowBox[{"1", "+", "x"}], ")"}], "10"]], "//", "Expand"}]], "Input"], Cell[TextData[{ "Nothing! Of course, this can be expanded in a binomial series to any given \ extent. We do this here by using Series, and telling it to expand about x=0 \ up to and including the ", Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["x", "14"], " ", RowBox[{"term", "."}]}], TraditionalForm]]] }], "Text"], Cell[BoxData[ RowBox[{"Series", "[", RowBox[{"%", ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "14"}], "}"}]}], "]"}]], "Input"], Cell[TextData[{ "Note the ", Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox[ RowBox[{"O", "[", "x", "]"}], "15"], ",", " ", RowBox[{"indicating", " ", "terms", " ", "of", " ", "this", " ", RowBox[{"order", ".", " "}]}]}], TraditionalForm]]], "If we wish to truncate this series to a polynomial we can" }], "Text"], Cell[BoxData[ RowBox[{"Normal", "[", "%", "]"}]], "Input"], Cell["Or we can expand about another point, say x=1:", "Text"], Cell[BoxData[ RowBox[{"Series", "[", RowBox[{"%%%", ",", RowBox[{"{", RowBox[{"x", ",", "1", ",", "14"}], "}"}]}], "]"}]], "Input"], Cell["or even about \[Infinity]", "Text"], Cell[BoxData[ RowBox[{"Series", "[", RowBox[{"%%%%", ",", RowBox[{"{", RowBox[{"x", ",", "\[Infinity]", ",", "14"}], "}"}]}], "]"}]], "Input"], Cell["How about some trigonometric expressions?", "Text"], Cell[BoxData[ RowBox[{"TrigExpand", "[", RowBox[{"Sin", "[", RowBox[{"x", "+", "y"}], "]"}], "]"}]], "Input"], Cell["Put it back.", "Text"], Cell[BoxData[ RowBox[{"TrigReduce", "[", "%", "]"}]], "Input"], Cell["Transform to complex exponential form", "Text"], Cell[BoxData[ RowBox[{"TrigToExp", "[", "%", "]"}]], "Input"], Cell["Finally, let's solve a high order polynomial equation.", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"1", "+", "x", "+", SuperscriptBox["x", "9"], "+", SuperscriptBox["x", "12"]}], "\[Equal]", "0"}], ",", "x"}], "]"}], "//", "N"}]], "Input"], Cell["\<\ Notice that all 12 roots, including complex ones, are returned. Of course, \ not all non-polynomial equations can be solved so easily. We will learn \ methods for these in another chapter.\ \>", "Text"], Cell[TextData[{ "A very commonly used utility in ", StyleBox["Mathematica", FontSlant->"Italic"], " is Simplify[\[Ellipsis]]. This tries many rules to get a complicated \ expression into the simplest possible form." }], "Text"], Cell[BoxData[ RowBox[{"Simplify", "[", RowBox[{ FractionBox["1", RowBox[{"4", " ", RowBox[{"(", RowBox[{ RowBox[{"-", "1"}], "+", "x"}], ")"}]}]], "-", FractionBox["1", RowBox[{"4", " ", RowBox[{"(", RowBox[{"1", "+", "x"}], ")"}]}]], "-", FractionBox["1", RowBox[{"2", " ", RowBox[{"(", RowBox[{"1", "+", SuperscriptBox["x", "2"]}], ")"}]}]]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"Apart", "[", "%", "]"}]], "Input"], Cell["\<\ But of course the number of transformations it tries is limited. Many others \ are tried by FullSimplify[\[Ellipsis]], but beware, it can be very slow. \ Always try Simplify first.\ \>", "Text"], Cell[BoxData[ RowBox[{"Simplify", "[", RowBox[{"Log", "[", RowBox[{"z", "+", RowBox[{ SqrtBox[ RowBox[{"z", "+", "1"}]], " ", SqrtBox[ RowBox[{"z", "-", "1"}]]}]}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"FullSimplify", "[", RowBox[{"Log", "[", RowBox[{"z", "+", RowBox[{ SqrtBox[ RowBox[{"z", "+", "1"}]], " ", SqrtBox[ RowBox[{"z", "-", "1"}]]}]}], "]"}], "]"}]], "Input"], Cell["\<\ More control can be exercised with such utilities as Together, Expand, Apart, \ Cancel, Collect, Factor, TrigToExp, ExpToTrig, TrigReduce, TrigExpand, \ FunctionExpand, ComplexExpand, \[Ellipsis] Look these up in Help.\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Defining Functions", "Section"], Cell[CellGroupData[{ Cell["The = Sign in Definitions", "Subsection"], Cell[TextData[{ "Well, did you find working with %, %%, and %%% a bit awkward? It's \ certainly a nuisance, since you have to make sure all the cells are evaluated \ in the right order. There must be a better way. Of course there is. In \ mathematics, we normally give functions ", StyleBox["names", FontWeight->"Bold"], "." }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"f", "[", "x_", "]"}], "=", SuperscriptBox[ RowBox[{"(", RowBox[{"1", "+", RowBox[{"Sin", "[", "x", "]"}]}], ")"}], "5"]}], ";"}]], "Input"], Cell[TextData[{ "Here I have defined the function f. As a general policy, it is a good idea \ to start your function names with lower case letters, as all built-in ", StyleBox["Mathematica", FontSlant->"Italic"], " functions begin with upper case letters. But there are two new things \ here: what is the underscore (x_) for, and why the semicolon at the end?\n", StyleBox["Note: functions use square brackets [..]. ", FontSize->16, FontWeight->"Bold"], StyleBox["Round brackets are reserved for collecting terms in algebraic \ expressions.", FontSize->16], "\nWell, the semicolon simple stops the answer being displayed. Try it again \ without:" }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "x_", "]"}], "=", SuperscriptBox[ RowBox[{"(", RowBox[{"1", "+", RowBox[{"Sin", "[", "x", "]"}]}], ")"}], "5"]}]], "Input"], Cell["\<\ See the difference? I didn't want to have my definition echoed back at me, so \ I used \";\". But the underscore is more subtle, and IMPORTANT. Let's \ evaluate f at a couple of values.\ \>", "Text"], Cell[BoxData[ RowBox[{"f", "[", "x", "]"}]], "Input"], Cell["Fine.", "Text"], Cell[BoxData[ RowBox[{"f", "[", FractionBox["\[Pi]", "2"], "]"}]], "Input"], Cell["Fine again! Now, what if we try without the underscore?", "Text"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"g", "[", "x", "]"}], "=", RowBox[{"x", "+", RowBox[{"2", "/", "x"}]}]}], ";"}]], "Input"], Cell[BoxData[ RowBox[{"g", "[", "x", "]"}]], "Input"], Cell["OK.", "Text"], Cell[BoxData[ RowBox[{"g", "[", "2", "]"}]], "Input"], Cell[TextData[{ "Wow, what's that???? What has happened is that ", StyleBox["Mathematica", FontSlant->"Italic"], " has no idea what g[2] is. I have only told it what g[x] is! Now you see \ the point of the underscore. It tells ", StyleBox["Mathematica", FontSlant->"Italic"], " that x is a ", StyleBox["variable", FontWeight->"Bold"], " which can take any value. \nNow let's clear the definitions of f and g." }], "Text"], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"f", ",", "g"}], "]"}]], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["The := Sign in Definitions", "Subsection"], Cell[TextData[{ "Here we define a function of ", StyleBox["x", FontSlant->"Italic"], " which contains a parameter ", StyleBox["a", FontSlant->"Italic"], "." }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"a", "=", "1"}], ";", RowBox[{ RowBox[{"f", "[", "x_", "]"}], "=", RowBox[{"x", "+", "a"}]}], ";"}]], "Input"], Cell["Let's see what f(2) is.", "Text"], Cell[BoxData[ RowBox[{"f", "[", "2", "]"}]], "Input"], Cell[TextData[{ "That's right. Now let's change ", StyleBox["a,", FontSlant->"Italic"] }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"a", "=", "5"}], ";"}]], "Input"], Cell["and re-evaluate f(2)", "Text"], Cell[BoxData[ RowBox[{"f", "[", "2", "]"}]], "Input"], Cell[TextData[{ "Alright, so f doesn't know that ", StyleBox["a", FontSlant->"Italic"], " has changed. It is just using its value when the definition of f was made. \ But try this:" }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"a", "=", "1"}], ";", RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", RowBox[{"x", "+", "a"}]}]}]], "Input"], Cell[BoxData[ RowBox[{"f", "[", "2", "]"}]], "Input"], Cell[TextData[{ "as before. Now change ", StyleBox["a", FontSlant->"Italic"], " again" }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"a", "=", "5"}], ";"}]], "Input"], Cell["and evaluate f(2)", "Text"], Cell[BoxData[ RowBox[{"f", "[", "2", "]"}]], "Input"], Cell[TextData[{ "Aha!! That's different. Now f knows that it's a function of ", StyleBox["a", FontSlant->"Italic"], ", and only calls on ", StyleBox["a", FontSlant->"Italic"], " at evaluation time , rather than at definition time!!!" }], "Text"], Cell[BoxData[ RowBox[{"?", "f"}]], "Input"], Cell[TextData[StyleBox["Note that there is no need for the trailing semicolon \ when you make a definition using := as it is not actually evaluated then.", FontWeight->"Bold"]], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "y_", "]"}], ":=", RowBox[{ SuperscriptBox["y", "2"], "+", "1"}]}]], "Input"], Cell[TextData[{ "By the way, let's have a look at what ", StyleBox["Mathematica", FontSlant->"Italic"], " thinks about f now. Despite this last definition being for f[y_] rather \ than f[x_] as before, it recognizes that this is a formula for the function \ f, and x or y are just dummies." }], "Text"], Cell[BoxData[ RowBox[{"?", "f"}]], "Input"], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"f", ",", "g"}], "]"}]], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Basic Calculus", "Section"], Cell[TextData[{ "A differentiable function of ", StyleBox["x", FontSlant->"Italic"], "." }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", RowBox[{"x", "+", RowBox[{"Sin", "[", SuperscriptBox["x", "2"], "]"}]}]}]], "Input"], Cell["Easy to differentiate:", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"f", "'"}], "[", "x", "]"}]], "Input"], Cell["and again", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"f", "''"}], "[", "x", "]"}]], "Input"], Cell["The indefinite integral", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"g", "[", "x_", "]"}], "=", RowBox[{"Integrate", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", "x"}], "]"}]}]], "Input"], Cell["Definite integral on (0,1)", "Text"], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["Check using the indefinite integral:", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"g", "[", "1", "]"}], "-", RowBox[{"g", "[", "0", "]"}]}]], "Input"], Cell["Plot:", "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["And now the derivative:", "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{ SuperscriptBox["f", "\[Prime]", MultilineFunction->None], "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]], "Input"], Cell["and the integral:", "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"g", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["\<\ And now all three together, with different colours and dash styles.\ \>", "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"g", "[", "x", "]"}], ",", RowBox[{"f", "[", "x", "]"}], ",", RowBox[{ SuperscriptBox["f", "\[Prime]", MultilineFunction->None], "[", "x", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", RowBox[{"Red", ",", RowBox[{"Dashing", "[", RowBox[{"{", RowBox[{"0.05`", ",", "0.02`"}], "}"}], "]"}]}], "}"}], ",", RowBox[{"{", "Cyan", "}"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Lists, Tables, Linear Algebra", "Section"], Cell["Here is a list of the first three perfect squares.", "Text"], Cell[BoxData[ RowBox[{"v", "=", RowBox[{"Table", "[", RowBox[{ SuperscriptBox["n", "2"], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", "3"}], "}"}]}], "]"}]}]], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " writes its lists between braces {\[Ellipsis]}. We can also regard ", StyleBox["v", FontWeight->"Bold"], " as a vector. Note that ", StyleBox["Mathematica", FontSlant->"Italic"], " does not distinguish between row and column vectors. We can also make \ matrices:" }], "Text"], Cell[BoxData[ RowBox[{"m", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"m", "+", RowBox[{"2", "n"}], "+", RowBox[{"KroneckerDelta", "[", RowBox[{"m", ",", "n"}], "]"}]}], ",", RowBox[{"{", RowBox[{"m", ",", "1", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", "3"}], "}"}]}], "]"}]}]], "Input"], Cell[TextData[{ "Thus, a matrix is a ", StyleBox["list of lists", FontSlant->"Italic"], ". It doesn't ", StyleBox["look", FontSlant->"Italic"], " much like a matrix though! Well, does this help?" }], "Text"], Cell[BoxData[ RowBox[{"m", "//", "MatrixForm"}]], "Input"], Cell[BoxData[ RowBox[{"Det", "[", "m", "]"}]], "Input"], Cell["\<\ Alternatively, we can enter matrices using the Input>Create \ Table/Matrix/Palette menu item. Just select that item, choose the matrix size \ in the dialog box, and enter the elements directly (using tab to move between \ entries).\ \>", "Text"], Cell[BoxData[ RowBox[{"(", GridBox[{ {"1", "2"}, {"3", "4"} }], ")"}]], "Input"], Cell[TextData[{ StyleBox["You try it!", FontWeight->"Bold"], "\nSo, what can we do with these things? How about a dot product?" }], "Text"], Cell[BoxData[ RowBox[{"v", ".", "v"}]], "Input"], Cell["\<\ Check that that is right. But what about premultiplying a (column) vector by \ a matrix? Try this.\ \>", "Text"], Cell[BoxData[ RowBox[{"m", ".", "v"}]], "Input"], Cell["Does this give you what you want? And what about this?", "Text"], Cell[BoxData[ RowBox[{"v", ".", "m"}]], "Input"], Cell["It's different! What did it do mathematically? Now try", "Text"], Cell[BoxData[ RowBox[{"v", ".", RowBox[{"Transpose", "[", "m", "]"}]}]], "Input"], Cell["Does that make sense?", "Text"], Cell[TextData[{ "Finally, what if I want to solve a matrix equation ", StyleBox["mx", FontWeight->"Bold"], "=", StyleBox["v", FontWeight->"Bold"], ", where ", StyleBox["m", FontWeight->"Bold"], " is a square matrix and ", StyleBox["v", FontWeight->"Bold"], " a given vector?" }], "Text"], Cell[BoxData[ RowBox[{"x", "=", RowBox[{"LinearSolve", "[", RowBox[{"m", ",", "v"}], "]"}]}]], "Input"], Cell["Let's check:", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"m", ".", "x"}], "\[Equal]", "v"}]], "Input"], Cell[TextData[{ "Now let's find the ", StyleBox["eigenvalues", FontWeight->"Bold"], " of the 3\[Times]3 matrix ", StyleBox["m", FontWeight->"Bold"], ":" }], "Text"], Cell[BoxData[ RowBox[{"Eigenvalues", "[", "m", "]"}]], "Input"], Cell["or if we want both the eigenvalues and eigenvectors:", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"{", RowBox[{"eval", ",", "evec"}], "}"}], "=", RowBox[{"Eigensystem", "[", "m", "]"}]}]], "Input"], Cell["Check:", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"m", ".", RowBox[{"Transpose", "[", "evec", "]"}]}], "//", "Simplify"}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Transpose", "[", "evec", "]"}], ".", RowBox[{"DiagonalMatrix", "[", "eval", "]"}]}], "//", "Simplify"}]], "Input"], Cell[BoxData[ RowBox[{"%", "\[Equal]", "%%"}]], "Input"], Cell["Yes! Finally, let's clear our variables:", "Text"], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"m", ",", "x", ",", "v", ",", "evec", ",", "eval"}], "]"}]], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Plotting", "Section"], Cell[CellGroupData[{ Cell["Plot and Show", "Subsection"], Cell[TextData[{ "We might wish to plot the first 11 Chebyshev Polynomials ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["T", "1"], ",", " ", "\[Ellipsis]", ",", SubscriptBox["T", "10"], " "}], TraditionalForm]]], "over -1\[LessEqual]x\[LessEqual]1. We ", StyleBox["could", FontSlant->"Italic"], " do this, but what a pain!" }], "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"ChebyshevT", "[", RowBox[{"0", ",", "x"}], "]"}], ",", RowBox[{"ChebyshevT", "[", RowBox[{"1", ",", "x"}], "]"}], ",", RowBox[{"ChebyshevT", "[", RowBox[{"2", ",", "x"}], "]"}], ",", RowBox[{"ChebyshevT", "[", RowBox[{"3", ",", "x"}], "]"}], ",", RowBox[{"ChebyshevT", "[", RowBox[{"4", ",", "x"}], "]"}], ",", RowBox[{"ChebyshevT", "[", RowBox[{"5", ",", "x"}], "]"}], ",", RowBox[{"ChebyshevT", "[", RowBox[{"6", ",", "x"}], "]"}], ",", RowBox[{"ChebyshevT", "[", RowBox[{"7", ",", "x"}], "]"}], ",", RowBox[{"ChebyshevT", "[", RowBox[{"8", ",", "x"}], "]"}], ",", RowBox[{"ChebyshevT", "[", RowBox[{"9", ",", "x"}], "]"}], ",", RowBox[{"ChebyshevT", "[", RowBox[{"10", ",", "x"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"Hue", "[", FractionBox["n", "10"], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "10"}], "}"}]}], "]"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<\!\(\*SubscriptBox[\(T\), \(n\)]\)\>\""}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.401218481522441*^9, 3.4012184869254923`*^9}}], Cell["This is far more convenient.", "Text"], Cell[BoxData[ RowBox[{"chebPlot", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"ChebyshevT", "[", RowBox[{"n", ",", "x"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "10"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"Hue", "[", FractionBox["n", "10"], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "10"}], "}"}]}], "]"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<\!\(\*SubscriptBox[\(T\), \(n\)]\)\>\""}], "}"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.401218495310679*^9, 3.40121849744359*^9}}], Cell["\<\ What is the purpose of Evaluate[\[Ellipsis]]? Try it without.\ \>", "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"ChebyshevT", "[", RowBox[{"n", ",", "x"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "10"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"Hue", "[", FractionBox["n", "10"], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "10"}], "}"}]}], "]"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<\!\(\*SubscriptBox[\(T\), \(n\)]\)\>\""}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.401218507254825*^9, 3.401218509307597*^9}}], Cell[TextData[{ "What went wrong? Well, Plot takes as its first argument a single function \ or a list of functions. Table[\[Ellipsis]], makes such a list, ", StyleBox["but only when it is evaluated", FontSlant->"Italic"], ". By default, Plot holds its arguments unevaluated until numerical values \ of ", StyleBox["x", FontSlant->"Italic"], " are inserted. By using Evaluate[\[Ellipsis]], we cause the table to be \ contructed first. Before Version 6, this was necessary, or Plot would not \ work at all. In Version 6, you still need it for the colour styles to work \ properly. By the way, it is normally a good idea to Evaluate[\[Ellipsis]] all \ functions inside Plot (though there are cases where this is not advisable), \ since it usually makes for faster evaluation." }], "Text", CellChangeTimes->{{3.401218840916938*^9, 3.4012189031133127`*^9}, { 3.401553078133943*^9, 3.401553092595826*^9}}], Cell[TextData[{ "Other important graphics utilities: Plot3D, ListPlot, ContourPlot, \ DensityPlot, ParametricPlot, ParametricPlot3D, PolarPlot, \[Ellipsis] We will \ see more of these as we go on. However, one utility, ", StyleBox["Show", FontWeight->"Bold"], ", is worth mentioning here. Above, we created the graph chebPlot; say we \ wanted to see it again without re-evaluating the functions, Up till Version \ 6, we needed to do this:" }], "Text", CellChangeTimes->{{3.401553104700799*^9, 3.401553110556512*^9}, { 3.4015531975902653`*^9, 3.401553212412187*^9}}], Cell[BoxData[ RowBox[{"Show", "[", "chebPlot", "]"}]], "Input"], Cell["\<\ and as you can see, this still works. However, there was a major \ restructuring of how graphics works in V6, so that graphics is now treated as \ normal output. So, just as you can get back any previously evaluated result \ which has been named by simply typing its name:\ \>", "Text", CellChangeTimes->{{3.4015532234215307`*^9, 3.401553359643961*^9}}], Cell[BoxData[ RowBox[{"Y", "=", RowBox[{"2", "+", "5"}]}]], "Input", CellChangeTimes->{{3.401553363954679*^9, 3.401553396340711*^9}}], Cell[BoxData["Y"], "Input", CellChangeTimes->{3.4015534004679823`*^9}], Cell["you can now do the same with graphics:", "Text", CellChangeTimes->{{3.401553683028421*^9, 3.401553709779653*^9}}], Cell[BoxData["chebPlot"], "Input", CellChangeTimes->{{3.4015536995313873`*^9, 3.4015537021004477`*^9}}], Cell["\<\ However, Show[] is still very useful. Perhaps we want to superimpose some \ points on this graph, at (\[PlusMinus]0.5,\[PlusMinus]0.5) say:\ \>", "Text", CellChangeTimes->{{3.401553719380294*^9, 3.401553733675805*^9}}], Cell[BoxData[ RowBox[{"pts", "=", RowBox[{"Flatten", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"a", ",", "b"}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", RowBox[{"-", ".5"}], ",", ".5"}], "}"}], ",", RowBox[{"{", RowBox[{"b", ",", RowBox[{"-", ".5"}], ",", ".5"}], "}"}]}], "]"}], ",", "1"}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"chebPlot", ",", RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.03`", "]"}], ",", RowBox[{"Point", "/@", "pts"}]}], "}"}], "]"}]}], "]"}]], "Input"], Cell["", "Text", CellChangeTimes->{{3.401553376375704*^9, 3.401553377931367*^9}}], Cell["\<\ There are ways to do this within the original plotting process, but often it \ is very convenient to add extra features to a graph after it is drawn. The use of Map (or /@) will be discussed in Chapter 2, but for the moment, \ all you need to know is that it applies a function independently to each \ element of a list: f /@ {a,b,c} = {f[a],f[b],f[c]}. So Point /@ pts simply \ applies Point to each of our four points. You need Graphics[ ] around the \ points, since otherwise they don't form Graphics objects, and can't be \ plotted.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Colours", "Subsection"], Cell["\<\ Hue[h] can be used to specify colours for 0\[LessEqual]h\[LessEqual]1.\ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"n", "=", FractionBox["\[Pi]", "128"]}], ";", RowBox[{"Show", "[", RowBox[{"Graphics", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Hue", "[", FractionBox["#1", RowBox[{ RowBox[{"2", " ", "\[Pi]"}], "-", "n"}]], "]"}], ",", RowBox[{"Disk", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1", ",", RowBox[{"{", RowBox[{"#1", ",", RowBox[{"#1", "+", "n"}]}], "}"}]}], "]"}]}], "}"}], "&"}], ")"}], "/@", RowBox[{"Range", "[", RowBox[{"0", ",", RowBox[{ RowBox[{"2", " ", "\[Pi]"}], "-", "n"}], ",", "n"}], "]"}]}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}]}], "]"}], "]"}], ";", RowBox[{"Clear", "[", "n", "]"}]}]], "Input", CellTags->"Hue"], Cell["\<\ Note that Hue repeats cyclically. Or more generally, Hue[h,s,b] with 0 \ \[LessEqual] h,s,b \[LessEqual] 1 specifies hue, saturation, and brightness:\ \>", "Text"], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"s", ",", "h"}], "]"}]], "Input", CellChangeTimes->{{3.401218943664856*^9, 3.401218950249839*^9}}], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{ RowBox[{"Graphics", "[", RowBox[{"Raster", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"h", ",", "s", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", "0", ",", "1", ",", "0.05`"}], "}"}], ",", RowBox[{"{", RowBox[{"h", ",", "0", ",", "1", ",", "0.05`"}], "}"}]}], "]"}], ",", RowBox[{"ColorFunction", "\[Rule]", "Hue"}]}], "]"}], "]"}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}], ",", RowBox[{"Background", "\[Rule]", "Black"}]}], "]"}]], "Input", CellChangeTimes->{{3.4012189748402863`*^9, 3.401218978091851*^9}}], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{ RowBox[{"Graphics", "[", RowBox[{"Raster", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"h", ",", "1", ",", "b"}], "}"}], ",", RowBox[{"{", RowBox[{"b", ",", "0", ",", "1", ",", "0.05`"}], "}"}], ",", RowBox[{"{", RowBox[{"h", ",", "0", ",", "1", ",", "0.05`"}], "}"}]}], "]"}], ",", RowBox[{"ColorFunction", "\[Rule]", "Hue"}]}], "]"}], "]"}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}], ",", RowBox[{"Background", "\[Rule]", "Black"}]}], "]"}]], "Input", CellChangeTimes->{{3.4012189951831083`*^9, 3.401218998811612*^9}}], Cell["\<\ You can also use RGBColor, CMYKColor, or GrayLevel to set colours. \ \>", "Text"], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{ RowBox[{"Graphics", "[", RowBox[{"Raster", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"r", ",", "g", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"g", ",", "0", ",", "1", ",", "0.05`"}], "}"}], ",", RowBox[{"{", RowBox[{"r", ",", "0", ",", "1", ",", "0.05`"}], "}"}]}], "]"}], ",", RowBox[{"ColorFunction", "\[Rule]", "RGBColor"}]}], "]"}], "]"}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}], ",", RowBox[{"Background", "\[Rule]", "Black"}]}], "]"}]], "Input", CellChangeTimes->{{3.401219005738361*^9, 3.4012190091557903`*^9}}], Cell["\<\ As of Version 5.1, these colour names are also defined automatically:\ \>", "Text"], Cell[BoxData[{ FormBox[GridBox[{ {Cell[TextData[StyleBox["Black", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}], Cell[TextData[StyleBox[ "Blue", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]}, {Cell[TextData[StyleBox["Brown", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}], Cell[TextData[StyleBox[ "Cyan", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]}, {Cell[TextData[StyleBox["Gray", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}], Cell[TextData[StyleBox[ "Green", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]}, {Cell[TextData[StyleBox["Magenta", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}], Cell[TextData[StyleBox[ "Orange", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]}, {Cell[TextData[StyleBox["Pink", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}], Cell[TextData[StyleBox[ "Purple", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]}, {Cell[TextData[StyleBox["Red", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}], Cell[TextData[StyleBox[ "White", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]}, {Cell[TextData[StyleBox["Yellow", GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}]], GridBoxOptions->{ GridBoxDividers->{ "Columns" -> {{False}}, "ColumnsIndexed" -> {}, "Rows" -> {{False}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.5599999999999999]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.16]}, Offset[0.2]}, "RowsIndexed" -> {}}}], " "} }, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}], TraditionalForm], "\[IndentingNewLine]", FormBox[ RowBox[{ RowBox[{"In", " ", "Version", " ", "6"}], ",", " ", RowBox[{ "this", " ", "list", " ", "is", " ", "expanded", " ", "to", " ", "include", " ", Cell[TextData[ButtonBox["LightRed", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightRed"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], "\[NonBreakingSpace]", StyleBox["\[FilledVerySmallSquare]", "InlineSeparator"], " ", Cell[ TextData[ButtonBox["LightGreen", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightGreen"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], "\[NonBreakingSpace]", StyleBox["\[FilledVerySmallSquare]", "InlineSeparator"], " ", Cell[ TextData[ButtonBox["LightBlue", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightBlue"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], "\[NonBreakingSpace]", StyleBox["\[FilledVerySmallSquare]", "InlineSeparator"], Cell[TextData[ ButtonBox["LightGray", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightGray"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], "\[NonBreakingSpace]", StyleBox["\[FilledVerySmallSquare]", "InlineSeparator"], " ", Cell[ TextData[ButtonBox["LightCyan", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightCyan"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], "\[NonBreakingSpace]", StyleBox["\[FilledVerySmallSquare]", "InlineSeparator"], " ", Cell[ TextData[ButtonBox["LightMagenta", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightMagenta"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], "\[NonBreakingSpace]", StyleBox["\[FilledVerySmallSquare]", "InlineSeparator"], " ", Cell[ TextData[ButtonBox["LightYellow", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightYellow"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], "\[NonBreakingSpace]", StyleBox["\[FilledVerySmallSquare]", "InlineSeparator"], " ", Cell[ TextData[ButtonBox["LightBrown", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightBrown"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], "\[NonBreakingSpace]", StyleBox["\[FilledVerySmallSquare]", "InlineSeparator"], " ", Cell[ TextData[ButtonBox["LightOrange", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightOrange"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], "\[NonBreakingSpace]", StyleBox["\[FilledVerySmallSquare]", "InlineSeparator"], " ", Cell[ TextData[ButtonBox["LightPink", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightPink"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], "\[NonBreakingSpace]", StyleBox["\[FilledVerySmallSquare]", "InlineSeparator"], " ", RowBox[{Cell[TextData[ButtonBox["LightPurple", BaseStyle->"NewInVersionLink", ButtonData->"paclet:ref/LightPurple"]], "InlineFunctionSans", Background->Dynamic[ If[CurrentValue[{TaggingRules, "ModificationHighlight"}] === True, RGBColor[0.92, 1, 0.59], None]]], ".", "\[IndentingNewLine]"}]}]}], TraditionalForm]}], "Text", CellChangeTimes->{{3.40121906936805*^9, 3.401219087835188*^9}, { 3.40121914943855*^9, 3.401219169965605*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], ",", RowBox[{"Cos", "[", "x", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", RowBox[{"2", " ", "\[Pi]"}]}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", "Red", "}"}], ",", RowBox[{"{", "Cyan", "}"}]}], "}"}]}], ",", RowBox[{"Background", "\[Rule]", "Yellow"}]}], "]"}]], "Input"], Cell["\<\ As of Version 6, the functions Lighter[] and Darker[] can now be used to \ modify colours.\ \>", "Text", CellChangeTimes->{{3.401219772401121*^9, 3.401219804568878*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{"x", ",", SuperscriptBox["x", "2"], ",", SuperscriptBox["x", "3"]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"Blue", ",", RowBox[{"Thickness", "[", ".01", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Lighter", "[", "Blue", "]"}], ",", RowBox[{"Thickness", "[", ".01", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Darker", "[", "Blue", "]"}], ",", RowBox[{"Thickness", "[", ".01", "]"}]}], "}"}]}], "}"}]}], ",", RowBox[{"Background", "\[Rule]", "White"}]}], "]"}]], "Input", CellChangeTimes->{{3.40121963017163*^9, 3.401219695541525*^9}, { 3.401219733653984*^9, 3.401219760263577*^9}, {3.401219827544833*^9, 3.4012198430205173`*^9}}], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"GraphicsGrid", "[", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"Graphics3D", "[", RowBox[{"{", RowBox[{"Red", ",", RowBox[{"Sphere", "[", "]"}]}], "}"}], "]"}], ",", RowBox[{"Graphics3D", "[", RowBox[{"{", RowBox[{ RowBox[{"Lighter", "[", "Red", "]"}], ",", RowBox[{"Sphere", "[", "]"}]}], "}"}], "]"}]}], "}"}], "}"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.401219333852952*^9, 3.4012195512106647`*^9}, { 3.4012201300065413`*^9, 3.40122013258702*^9}}] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Multivariable Calculus", "Section"], Cell["Here we define a function of two variables.", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", RowBox[{"x_", ",", "y_"}], "]"}], ":=", RowBox[{ RowBox[{"(", RowBox[{ SuperscriptBox["x", "2"], "-", SuperscriptBox["y", "2"]}], ")"}], RowBox[{"Exp", "[", RowBox[{"-", RowBox[{"(", RowBox[{ SuperscriptBox["x", "2"], "+", SuperscriptBox["y", "2"]}], ")"}]}], "]"}]}]}]], "Input"], Cell["Plot it as a surface plot.", "Text"], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]], "Input", CellChangeTimes->{{3.401312326403453*^9, 3.401312326865878*^9}}], Cell["\<\ Try grabbing it with your mouse and rotating it around (new in Version 6). Or \ click on it to display a rubber bounding rectangle which can be pulled out to \ resize. To return it to the standard size, select the graphics cell (click on \ the leftmost line at the right of the window), then use the menu \ Graphics>Rendering>Make Standard Size. Or with more points (and without the mesh):\ \>", "Text", CellChangeTimes->{{3.401309142075799*^9, 3.401309369807374*^9}}], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"PlotPoints", "\[Rule]", "70"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}]}], "]"}]], "Input"], Cell["And as a contour plot.", "Text"], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]], "Input", CellChangeTimes->{{3.401309465453614*^9, 3.4013094659611607`*^9}, { 3.401311519452067*^9, 3.401311520601778*^9}, {3.40131178038988*^9, 3.401311784657251*^9}, {3.4013123336807203`*^9, 3.401312334153767*^9}}], Cell["\<\ What happens if you leave out \"PlotRange->All\"? Here we illustrate the use of a few of the many available options in \ ContourPlot.\ \>", "Text", CellChangeTimes->{{3.401309790148274*^9, 3.4013098046074743`*^9}, { 3.4013110685142612`*^9, 3.4013110776237993`*^9}, {3.401311856114996*^9, 3.401311872512569*^9}}], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2.5"}], ",", "2.5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2.5"}], ",", "2.5"}], "}"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"ContourShading", "\[Rule]", "False"}], ",", "\[IndentingNewLine]", RowBox[{"ContourStyle", "\[Rule]", RowBox[{"Join", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Lighter", "[", "Green", "]"}], ",", RowBox[{"Thickness", "[", ".003", "]"}], ",", RowBox[{"Dashing", "[", RowBox[{"{", RowBox[{".02", ",", ".02"}], "}"}], "]"}]}], "}"}], ",", RowBox[{"{", "8", "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"{", RowBox[{"Red", ",", RowBox[{"Thickness", "[", ".003", "]"}]}], "}"}], "}"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"Blue", ",", RowBox[{"Thickness", "[", ".003", "]"}]}], "}"}], ",", RowBox[{"{", "8", "}"}]}], "]"}]}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"Contours", "\[Rule]", RowBox[{"Range", "[", RowBox[{ RowBox[{"-", ".4"}], ",", ".4", ",", ".05"}], "]"}]}], ",", RowBox[{"PlotPoints", "\[Rule]", "50"}], ",", RowBox[{"ContourLabels", "\[Rule]", "Automatic"}], ",", RowBox[{"ImageSize", "\[Rule]", "500"}], ",", RowBox[{"Background", "\[Rule]", RowBox[{"GrayLevel", "[", ".4", "]"}]}], ",", RowBox[{"FrameStyle", "->", "White"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]], "Input", CellChangeTimes->{{3.401309465453614*^9, 3.401309546818026*^9}, { 3.4013096381918783`*^9, 3.401309772106834*^9}, {3.401309817245714*^9, 3.401309861932313*^9}, {3.401310433327096*^9, 3.4013104924428596`*^9}, { 3.401310532016868*^9, 3.401310664291686*^9}, {3.401310697918589*^9, 3.40131073937294*^9}, {3.401310769942664*^9, 3.401310814360244*^9}, { 3.4013108512706833`*^9, 3.4013109029560957`*^9}, {3.401310987416668*^9, 3.401310990348542*^9}, {3.4013110888372707`*^9, 3.401311110444528*^9}, 3.401311802728738*^9, {3.401311897517393*^9, 3.401311965292823*^9}, { 3.401311998743656*^9, 3.40131203403685*^9}, {3.40131206443958*^9, 3.4013122139409323`*^9}, {3.401312250317534*^9, 3.401312254308907*^9}}], Cell["And as a density plot.", "Text"], Cell[BoxData[ RowBox[{"DensityPlot", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]], "Input", CellChangeTimes->{{3.4013094733479156`*^9, 3.40130947408107*^9}, { 3.401311215668235*^9, 3.401311232273508*^9}, {3.401311560386983*^9, 3.401311572953483*^9}, {3.40131181151755*^9, 3.4013118451778193`*^9}}], Cell["\<\ There are several was to enter partial derivatives. One uses the familiar \ \[PartialD] symbol (from a palette or using pd):\ \>", "Text"], Cell[BoxData[ RowBox[{ SubscriptBox["\[PartialD]", "x"], " ", RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}]}]], "Input"], Cell["A mixed partial derivative", "Text"], Cell[BoxData[ RowBox[{ SubscriptBox["\[PartialD]", RowBox[{"x", ",", "y"}]], RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}]}]], "Input"], Cell["Here is another way:", "Text"], Cell[BoxData[ RowBox[{"D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", "x"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", "x", ",", "y"}], "]"}]], "Input"], Cell[TextData[{ "This one calculates ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["\[PartialD]", "4"], "f"}], "/", RowBox[{"\[PartialD]", "x"}]}], RowBox[{ SuperscriptBox["\[PartialD]", "3"], "y"}]}], TraditionalForm]]] }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", "x", ",", RowBox[{"{", RowBox[{"y", ",", "3"}], "}"}]}], "]"}], "//", "Simplify"}]], "Input"], Cell[TextData[{ "Now, what if I want \[PartialD]f/\[PartialD]x at ", StyleBox["x", FontSlant->"Italic"], "=1, ", StyleBox["y", FontSlant->"Italic"], "=2?" }], "Text"], Cell[BoxData[ RowBox[{"D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"1", ",", "2"}], "]"}], ",", "x"}], "]"}]], "Input"], Cell["That's not right!! Nor is", "Text"], Cell[BoxData[ RowBox[{ SubscriptBox["\[PartialD]", "x"], RowBox[{"f", "[", RowBox[{"1", ",", "2"}], "]"}]}]], "Input"], Cell[TextData[{ "It is clear why; you are differentiating a ", StyleBox["constant", FontWeight->"Bold"], ". So, how do we enter the partial derivative at a particular point? This \ will do the trick:" }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Derivative", "[", RowBox[{"1", ",", "0"}], "]"}], "[", "f", "]"}], "[", RowBox[{"1", ",", "2"}], "]"}]], "Input"], Cell["Note that", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"Derivative", "[", RowBox[{"1", ",", "0"}], "]"}], "[", "f", "]"}]], "Input"], Cell[TextData[{ "is a pure function (the first partial ", StyleBox["x", FontSlant->"Italic"], " derivative of ", StyleBox["f", FontSlant->"Italic"], "), and then this is evaluated at (1,2)." }], "Text"], Cell[BoxData[ RowBox[{"Clear", "[", "f", "]"}]], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Getting out of Trouble", "Section", CellChangeTimes->{{3.401475892475801*^9, 3.401475900491349*^9}}], Cell[TextData[{ "Sometimes, you may find that ", StyleBox["Mathematica", FontSlant->"Italic"], " gets stuck in a calculation that seems to take forever. How can you stop \ it?\nWell, the first thing to try is the menu entry Evaluation>Abort \ Evaluation, or its keyboard shortcut, which is Cmd+. on a Mac, and Alt+. \ under X and Windows. Try it with this." }], "Text", CellChangeTimes->{{3.401475914540056*^9, 3.401476050427381*^9}, { 3.4014760919667177`*^9, 3.401476140307826*^9}, {3.401476263181849*^9, 3.401476269211459*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Log", "[", RowBox[{"20000000", "!"}], "]"}], "//", "N"}]], "Input", CellChangeTimes->{{3.401476156642056*^9, 3.401476167222258*^9}, { 3.401476208100297*^9, 3.4014762398282137`*^9}}], Cell[TextData[{ "However, ", StyleBox["Mathematica", FontSlant->"Italic"], " does not always listen. If it is very deep in a calculation, Abort \ Evaluation may not work. You should then try Evaluation>Interrupt \ Evaluation..., which should pop up a window, where you can select Abort.\nIf \ all else fails, Evaluation>Quit Kernel will probably do the job! The notebook \ stays open, but the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel is killed, so you will lose the results you have already calculated \ in the session (though if they have been displayed in the notebook, they'll \ still be there)." }], "Text", CellChangeTimes->{{3.401476283884831*^9, 3.401476287252439*^9}, { 3.4014763381873827`*^9, 3.40147655418762*^9}}] }, Closed]], Cell[CellGroupData[{ Cell["Exercises", "Section", FontColor->RGBColor[0, 0, 1]], Cell["\<\ Do not look at the solution until you have completed the exercise!\ \>", "Text", TextAlignment->Center, FontFamily->"Helvetica", FontSize->18, FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], Cell[CellGroupData[{ Cell["Numbers", "Subsection"], Cell[TextData[{ "Type in ", Cell[BoxData[ SuperscriptBox["\[ExponentialE]", RowBox[{"\[ImaginaryI]", " ", RowBox[{"\[DoubledPi]", "/", "2"}]}]]]], " using either palettes or keyboard shortcuts, and evaluate it numerically \ (you should know the answer)." }], "Text"], Cell["Summation", "Exercise"], Cell[TextData[{ "Consider the sum ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox["q", "n"], "(", "x", ")"}], "="}], TraditionalForm]]], " ", Cell[BoxData[ FormBox[ RowBox[{ UnderscriptBox[ UnderoverscriptBox["\[Sum]", RowBox[{"k", "=", "1"}], "n"], RowBox[{"k", " ", "odd"}]], FractionBox[ RowBox[{"sin", " ", "k", " ", "x"}], "k"]}], TraditionalForm]]], " for odd integer ", StyleBox["n\[GreaterEqual]1", FontSlant->"Italic"], ". Evaluate it exactly using Sum[\[Ellipsis]] for n=\[Infinity]. Plot, on \ the same axes, ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox["q", "1"], "(", "x", ")"}], ",", " ", RowBox[{ SubscriptBox["q", "3"], "(", "x", ")"}], ",", "\[Ellipsis]", ",", RowBox[{ SubscriptBox["q", "9"], "(", "x", ")"}], " "}], TraditionalForm]]], "and ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["q", "\[Infinity]"], "(", "x", ")"}], TraditionalForm]]], " for -5{{3.401220840634955*^9, 3.401220891428689*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"q", "[", RowBox[{"n", ",", "x"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", "9", ",", "2"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"q", "[", RowBox[{"\[Infinity]", ",", "x"}], "]"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"{", RowBox[{"Hue", "[", "0", "]"}], "}"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\<\!\(\*SubscriptBox[\(q\), \(n\)]\)\>\""}], "}"}]}], ",", RowBox[{"ImageSize", "\[Rule]", "400"}]}], "]"}]], "Input", CellChangeTimes->{{3.401220924658432*^9, 3.401220926980597*^9}}], Cell[BoxData[ RowBox[{"Clear", "[", "q", "]"}]], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Gamma Function", "Subsection"], Cell[TextData[{ "Plot 1/\[CapitalGamma](x) for -3.5 < x < 5.5, where \[CapitalGamma](x) \ represents the gamma function, represented in ", StyleBox["Mathematica", FontSlant->"Italic"], " by Gamma[x]. Label the axes." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Solve", "Subsection"], Cell[TextData[{ "Use Solve[] to find where the curve ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SuperscriptBox["x", "2"], "+", RowBox[{"3", SuperscriptBox["y", "2"]}]}], "=", RowBox[{ RowBox[{ RowBox[{"1", " ", "cuts", " ", SuperscriptBox["x", "3"]}], "-", RowBox[{ SuperscriptBox["x", "2"], "y"}], "-", SuperscriptBox["y", "3"]}], "=", RowBox[{ FractionBox["1", "4"], "."}]}]}], TraditionalForm]]], " Only give real solutions. Plot the two curves first to see graphically \ where they cross. You can do this using ContourPlot. Check your solutions by \ superimposing the points you find on your graph." }], "Text", CellChangeTimes->{{3.401221182526037*^9, 3.401221201698471*^9}}], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell[BoxData[ RowBox[{"cp", "=", RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["x", "2"], "+", RowBox[{"3", SuperscriptBox["y", "2"]}]}], "\[Equal]", "1"}], ",", RowBox[{ RowBox[{ SuperscriptBox["x", "3"], "-", RowBox[{ SuperscriptBox["x", "2"], "y"}], "-", SuperscriptBox["y", "3"]}], "\[Equal]", RowBox[{"1", "/", "4"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1.5"}], ",", "1.5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "1.2"}], ",", "1.2"}], "}"}], ",", RowBox[{"FrameLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}], ",", RowBox[{"Axes", "\[Rule]", "True"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.401218256293606*^9, 3.401218274543433*^9}, { 3.401221022078511*^9, 3.401221084435959*^9}, {3.4012211451759253`*^9, 3.4012211627640333`*^9}, {3.401221220760435*^9, 3.4012212365480757`*^9}}], Cell[TextData[{ "All solutions. Since these are polynomial equations, the solutions are \ returned in terms of Root objects, where Root[f,k] represnts the ", Cell[BoxData[ FormBox[ SuperscriptBox["k", "th"], TraditionalForm]]], "root of the polynomial f[x]." }], "Text"], Cell[BoxData[ RowBox[{"allsols", "=", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], "/.", RowBox[{"Solve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["x", "2"], "+", RowBox[{"3", SuperscriptBox["y", "2"]}]}], "\[Equal]", "1"}], ",", RowBox[{ RowBox[{ SuperscriptBox["x", "3"], "-", RowBox[{ SuperscriptBox["x", "2"], "y"}], "-", SuperscriptBox["y", "3"]}], "\[Equal]", RowBox[{"1", "/", "4"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]}]}]], "Input"], Cell["But we can easily evaluate these numerically:", "Text"], Cell[BoxData[ RowBox[{"N", "[", "allsols", "]"}]], "Input"], Cell["Some are complex. Select only the real ones:", "Text"], Cell[BoxData[ RowBox[{"realsols", "=", RowBox[{"Select", "[", RowBox[{ RowBox[{"N", "[", "allsols", "]"}], ",", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Im", "[", RowBox[{"#", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "]"}], "\[Equal]", "0"}], "&&", RowBox[{ RowBox[{"Im", "[", RowBox[{"#", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "]"}], "\[Equal]", "0"}]}], "&"}]}], "]"}]}]], "Input"], Cell["Check these by superimposing on the graph.", "Text"], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"cp", ",", RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{"Red", ",", RowBox[{"PointSize", "[", "0.025`", "]"}], ",", RowBox[{"Point", "/@", "realsols"}]}], "}"}], "]"}]}], "]"}]], "Input", CellChangeTimes->{{3.401221123913425*^9, 3.4012211251387978`*^9}}] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Integration", "Subsection"], Cell[TextData[{ "Evaluate ", Cell[BoxData[ FormBox[ RowBox[{ SubsuperscriptBox["\[Integral]", "0", "1"], RowBox[{ SuperscriptBox["\[ExponentialE]", RowBox[{"-", SuperscriptBox["x", "2"]}]], "sinh", " ", "x", " ", RowBox[{"\[DifferentialD]", "x"}]}]}], TraditionalForm]]], " exactly. Then evaluate the answer numerically. Now try ", Cell[BoxData[ FormBox[ RowBox[{ SubsuperscriptBox["\[Integral]", "0", "1"], RowBox[{ SuperscriptBox["\[ExponentialE]", RowBox[{"-", SuperscriptBox["x", "4"]}]], "sinh", " ", "x", " ", RowBox[{"\[DifferentialD]", "x"}]}]}], TraditionalForm]]], ". Beware: not all integrals can be done analytically. You will need \ NIntegrate[\[Ellipsis]] for this last one." }], "Text"], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell["\<\ Straightforward integral gives an answer in terms of the error function,\ \>", "Text"], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"Sinh", "[", "x", "]"}], " ", SuperscriptBox["\[ExponentialE]", RowBox[{"-", SuperscriptBox["x", "2"]}]]}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["which can be numerically evaluated.", "Text"], Cell[BoxData[ RowBox[{"%", "//", "N"}]], "Input"], Cell["Now let's try it using numerical integration", "Text"], Cell[BoxData[ RowBox[{"NIntegrate", "[", RowBox[{ RowBox[{ RowBox[{"Sinh", "[", "x", "]"}], " ", SuperscriptBox["\[ExponentialE]", RowBox[{"-", SuperscriptBox["x", "2"]}]]}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["Excellent. Now for the second integral.", "Text"], Cell[BoxData[ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"Sinh", "[", "x", "]"}], " ", SuperscriptBox["\[ExponentialE]", RowBox[{"-", SuperscriptBox["x", "4"]}]]}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input"], Cell["\<\ Woops, it couldn't do it analytically. But numerically \[Ellipsis]\ \>", "Text"], Cell[BoxData[ RowBox[{"NIntegrate", "[", RowBox[{ RowBox[{ RowBox[{"Sinh", "[", "x", "]"}], " ", SuperscriptBox["\[ExponentialE]", RowBox[{"-", SuperscriptBox["x", "4"]}]]}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Matrix Equation", "Subsection"], Cell[TextData[{ "Construct the 8\[Times]8 matrix\n", StyleBox["w", FontWeight->"Bold"], "=", Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0", "4", "0", "0", "0", "0"}, {"0", RowBox[{"-", "1"}], "0", "0", "5", "0", "0", "0"}, {"0", "0", "1", "0", "0", "6", "0", "0"}, {"4", "0", "0", RowBox[{"-", "1"}], "0", "0", "7", "0"}, {"0", "5", "0", "0", "1", "0", "0", "8"}, {"0", "0", "6", "0", "0", RowBox[{"-", "1"}], "0", "0"}, {"0", "0", "0", "7", "0", "0", "1", "0"}, {"0", "0", "0", "0", "8", "0", "0", RowBox[{"-", "1"}]} }, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]]], "\nusing Table[\[Ellipsis]] and KroneckerDelta[\[Ellipsis]] (look it up in \ the help facility). Find its determinant and inverse. Construct the vector ", StyleBox["r", FontWeight->"Bold"], "={1,2,\[Ellipsis],8} (use Range[\[Ellipsis]]), and solve ", StyleBox["wx", FontWeight->"Bold"], "=", StyleBox["r", FontWeight->"Bold"], " for ", StyleBox["x", FontWeight->"Bold"], ". ", StyleBox["Never", FontWeight->"Bold"], " use the inverse for solving a numerical matrix equation! Check your \ answer." }], "Text", CellChangeTimes->{{3.401221371886401*^9, 3.401221376337551*^9}}], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell[BoxData[ RowBox[{"w", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"i", "*", RowBox[{"KroneckerDelta", "[", RowBox[{"i", ",", RowBox[{"j", "+", "3"}]}], "]"}]}], "+", RowBox[{"j", "*", RowBox[{"KroneckerDelta", "[", RowBox[{"i", ",", RowBox[{"j", "-", "3"}]}], "]"}]}], "+", RowBox[{ SuperscriptBox[ RowBox[{"(", RowBox[{"-", "1"}], ")"}], RowBox[{"i", "+", "1"}]], " ", RowBox[{"KroneckerDelta", "[", RowBox[{"i", ",", "j"}], "]"}]}]}], ",", RowBox[{"{", RowBox[{"i", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "8"}], "}"}]}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"MatrixForm", "[", "w", "]"}]], "Input"], Cell[BoxData[ RowBox[{"Det", "[", "w", "]"}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"Inverse", "[", "w", "]"}], "//", "MatrixForm"}]], "Input"], Cell[BoxData[ RowBox[{"r", "=", RowBox[{"Range", "[", "8", "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"x", "=", RowBox[{"LinearSolve", "[", RowBox[{"w", ",", "r"}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"w", ".", "x"}], "\[Equal]", "r"}]], "Input"], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"w", ",", " ", "r", ",", " ", "x"}], "]"}]], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Multiple Plots", "Subsection"], Cell[TextData[{ "Plot the Bessel functions ", Cell[BoxData[ FormBox[ RowBox[{ FormBox[ RowBox[{ RowBox[{ SubscriptBox["J", "0"], "(", "x", ")"}], ",", " ", RowBox[{ SubscriptBox["J", "1"], "(", "x", ")"}], ",", " ", "\[Ellipsis]"}], TraditionalForm], ",", RowBox[{ SubscriptBox["J", "6"], "(", "x", ")"}], " "}], TraditionalForm]]], "for 0"Bold"], "note that g is not defined where ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"1", "+", SuperscriptBox["x", "2"], "-", SuperscriptBox["y", "2"]}], "=", "0"}], TraditionalForm]]], ". However, this is a removable singularity. Use If[ ] to make a definition \ applicable everywhere. You will learn another way to do this in Chapter 2.]" }], "Text"], Cell[CellGroupData[{ Cell["Solution", "Subsubsection"], Cell[BoxData[ RowBox[{"Clear", "[", "g", "]"}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"g", "[", RowBox[{"x_", ",", "y_"}], "]"}], ":=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"1", "+", SuperscriptBox["x", "2"], "-", SuperscriptBox["y", "2"]}], "==", "0"}], ",", "1", ",", FractionBox[ RowBox[{"Sin", "[", RowBox[{"1", "+", SuperscriptBox["x", "2"], "-", SuperscriptBox["y", "2"]}], "]"}], RowBox[{"1", "+", SuperscriptBox["x", "2"], "-", SuperscriptBox["y", "2"]}]]}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}]}], "]"}]], "Input"], Cell["More points to make it look smoother. ", "Text"], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "200"}]}], "]"}]], "Input"], Cell["The mesh is now too dense, so try this.", "Text"], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "200"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "200"}], ",", RowBox[{"Mesh", "\[Rule]", "False"}], ",", RowBox[{"Lighting", "\[Rule]", "None"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "50"}], ",", RowBox[{"ColorFunction", "\[Rule]", RowBox[{"(", RowBox[{"White", "&"}], ")"}]}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "50"}], ",", RowBox[{"MeshStyle", "\[Rule]", RowBox[{"{", "Blue", "}"}]}], ",", RowBox[{"ColorFunction", "\[Rule]", RowBox[{"(", RowBox[{"White", "&"}], ")"}]}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "5"}], ",", RowBox[{"ContourShading", "\[Rule]", "False"}]}], "]"}]], "Input", CellChangeTimes->{{3.401222886383165*^9, 3.401222951939375*^9}}], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "100"}], ",", RowBox[{"ContourShading", "\[Rule]", "False"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "100"}], ",", RowBox[{"ContourShading", "\[Rule]", "False"}], ",", RowBox[{"ContourStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Hue", "[", "0", "]"}], ",", RowBox[{"Dashing", "[", RowBox[{"{", RowBox[{"0.01`", ",", "0.01`"}], "}"}], "]"}]}], "}"}]}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"DensityPlot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.401223004670294*^9, 3.401223026747069*^9}}], Cell[BoxData[ RowBox[{"DensityPlot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "100"}]}], "]"}]], "Input", CellChangeTimes->{{3.401223004670294*^9, 3.401223009611104*^9}}], Cell[BoxData[ RowBox[{"DensityPlot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"ColorFunction", "\[Rule]", "Hue"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"DensityPlot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"g", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"ColorFunction", "\[Rule]", "\"\\""}], ",", RowBox[{"PlotPoints", "\[Rule]", "100"}]}], "]"}]], "Input", CellChangeTimes->{{3.401221555613765*^9, 3.401221571874969*^9}, { 3.401221616398115*^9, 3.401221620667403*^9}, {3.4012232584935427`*^9, 3.4012232637195587`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Derivative", "[", RowBox[{"2", ",", "1"}], "]"}], "[", "g", "]"}], "[", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"%", "//", "N"}]], "Input"] }, Closed]] }, Closed]] }, Closed]] }, Open ]] }, WindowSize->{968, 849}, WindowMargins->{{Automatic, 224}, {-1, Automatic}}, ShowSelection->True, Magnification->1., FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (June 19, 2007)", StyleDefinitions->FrontEnd`FileName[{"Creative"}, "NaturalColor.nb", CharacterEncoding -> "UTF-8"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "Hue"->{ Cell[39034, 1428, 975, 30, 208, "Input", CellTags->"Hue"]} } *) (*CellTagsIndex CellTagsIndex->{ {"Hue", 96547, 3183} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 118, 4, 66, "Title"], Cell[711, 29, 38, 0, 31, "Subtitle"], Cell[752, 31, 89, 2, 20, "Author"], Cell[844, 35, 727, 16, 96, "Text"], Cell[1574, 53, 665, 16, 58, "Text"], Cell[CellGroupData[{ Cell[2264, 73, 30, 0, 72, "Section"], Cell[2297, 75, 1090, 29, 71, "Text"], Cell[3390, 106, 100, 1, 37, "Input"], Cell[3493, 109, 358, 7, 41, "Text"], Cell[3854, 118, 46, 1, 37, "Input"], Cell[3903, 121, 566, 9, 56, "Text"], Cell[4472, 132, 367, 6, 41, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[4876, 143, 47, 0, 42, "Section"], Cell[4926, 145, 127, 4, 26, "Text"], Cell[5056, 151, 181, 6, 30, "Text"], Cell[5240, 159, 58, 1, 37, "Input"], Cell[5301, 162, 49, 0, 26, "Text"], Cell[5353, 164, 66, 1, 40, "Input"], Cell[5422, 167, 23, 0, 26, "Text"], Cell[5448, 169, 51, 1, 37, "Input"], Cell[5502, 172, 312, 9, 30, "Text"], Cell[5817, 183, 666, 20, 45, "Text"], Cell[6486, 205, 422, 14, 30, "Text"], Cell[6911, 221, 56, 1, 37, "Input"], Cell[6970, 224, 405, 11, 30, "Text"], Cell[7378, 237, 84, 2, 37, "Input"], Cell[7465, 241, 31, 0, 26, "Text"], Cell[7499, 243, 80, 2, 37, "Input"], Cell[7582, 247, 467, 11, 56, "Text"], Cell[8052, 260, 57, 1, 37, "Input"], Cell[8112, 263, 272, 5, 41, "Text"], Cell[8387, 270, 60, 0, 26, "Text"], Cell[8450, 272, 117, 3, 43, "Input"], Cell[8570, 277, 23, 0, 26, "Text"], Cell[8596, 279, 118, 3, 43, "Input"], Cell[8717, 284, 27, 0, 26, "Text"], Cell[8747, 286, 39, 0, 26, "Text"], Cell[8789, 288, 155, 5, 43, "Input"], Cell[8947, 295, 250, 8, 56, "Text"], Cell[9200, 305, 150, 3, 37, "Input"], Cell[9353, 310, 63, 0, 26, "Text"], Cell[9419, 312, 62, 1, 40, "Input"], Cell[9484, 315, 363, 8, 56, "Text"], Cell[9850, 325, 245, 8, 43, "Input"], Cell[10098, 335, 202, 7, 31, "Text"], Cell[10303, 344, 170, 4, 37, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[10510, 353, 58, 0, 42, "Section"], Cell[10571, 355, 189, 4, 26, "Text"], Cell[10763, 361, 49, 1, 37, "Input"], Cell[10815, 364, 27, 0, 37, "Input"], Cell[10845, 366, 101, 1, 26, "Text"], Cell[10949, 369, 56, 1, 37, "Input"], Cell[11008, 372, 24, 0, 26, "Text"], Cell[11035, 374, 56, 1, 37, "Input"], Cell[11094, 377, 38, 0, 26, "Text"], Cell[11135, 379, 56, 1, 37, "Input"], Cell[11194, 382, 311, 10, 26, "Text"], Cell[11508, 394, 51, 1, 37, "Input"], Cell[11562, 397, 120, 2, 26, "Text"], Cell[11685, 401, 49, 1, 37, "Input"], Cell[11737, 404, 59, 1, 37, "Input"], Cell[11799, 407, 127, 3, 26, "Text"], Cell[11929, 412, 145, 5, 40, "Input"], Cell[12077, 419, 42, 0, 26, "Text"], Cell[12122, 421, 145, 5, 40, "Input"], Cell[12270, 428, 81, 2, 37, "Input"], Cell[12354, 432, 533, 21, 49, "Text"], Cell[12890, 455, 368, 13, 37, "Input"], Cell[13261, 470, 163, 5, 26, "Text"], Cell[13427, 477, 97, 3, 37, "Input"], Cell[13527, 482, 237, 6, 41, "Text"], Cell[13767, 490, 468, 15, 37, "Input"], Cell[14238, 507, 147, 3, 37, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[14422, 515, 46, 0, 42, "Section"], Cell[14471, 517, 39, 0, 33, "Text"], Cell[14513, 519, 134, 4, 70, "Input"], Cell[14650, 525, 35, 0, 33, "Text"], Cell[14688, 527, 55, 1, 66, "Input"], Cell[14746, 530, 51, 0, 33, "Text"], Cell[14800, 532, 153, 5, 99, "Input"], Cell[14956, 539, 334, 9, 60, "Text"], Cell[15293, 550, 142, 4, 66, "Input"], Cell[15438, 556, 341, 10, 39, "Text"], Cell[15782, 568, 59, 1, 66, "Input"], Cell[15844, 571, 62, 0, 33, "Text"], Cell[15909, 573, 144, 4, 66, "Input"], Cell[16056, 579, 41, 0, 33, "Text"], Cell[16100, 581, 155, 4, 66, "Input"], Cell[16258, 587, 57, 0, 33, "Text"], Cell[16318, 589, 117, 3, 66, "Input"], Cell[16438, 594, 28, 0, 33, "Text"], Cell[16469, 596, 63, 1, 66, "Input"], Cell[16535, 599, 53, 0, 33, "Text"], Cell[16591, 601, 62, 1, 66, "Input"], Cell[16656, 604, 70, 0, 33, "Text"], Cell[16729, 606, 244, 8, 75, "Input"], Cell[16976, 616, 212, 4, 55, "Text"], Cell[17191, 622, 232, 6, 33, "Text"], Cell[17426, 630, 446, 16, 103, "Input"], Cell[17875, 648, 58, 1, 66, "Input"], Cell[17936, 651, 204, 4, 55, "Text"], Cell[18143, 657, 224, 8, 82, "Input"], Cell[18370, 667, 228, 8, 82, "Input"], Cell[18601, 677, 243, 4, 55, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[18881, 686, 37, 0, 42, "Section"], Cell[CellGroupData[{ Cell[18943, 690, 47, 0, 34, "Subsection"], Cell[18993, 692, 341, 8, 41, "Text"], Cell[19337, 702, 207, 7, 40, "Input"], Cell[19547, 711, 672, 15, 75, "Text"], Cell[20222, 728, 184, 6, 40, "Input"], Cell[20409, 736, 209, 4, 41, "Text"], Cell[20621, 742, 54, 1, 37, "Input"], Cell[20678, 745, 21, 0, 26, "Text"], Cell[20702, 747, 79, 2, 54, "Input"], Cell[20784, 751, 71, 0, 26, "Text"], Cell[20858, 753, 145, 5, 37, "Input"], Cell[21006, 760, 54, 1, 37, "Input"], Cell[21063, 763, 19, 0, 26, "Text"], Cell[21085, 765, 54, 1, 37, "Input"], Cell[21142, 768, 434, 12, 56, "Text"], Cell[21579, 782, 81, 2, 37, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[21697, 789, 48, 0, 26, "Subsection"], Cell[21748, 791, 177, 8, 33, "Text"], Cell[21928, 801, 154, 5, 66, "Input"], Cell[22085, 808, 39, 0, 33, "Text"], Cell[22127, 810, 54, 1, 66, "Input"], Cell[22184, 813, 102, 4, 33, "Text"], Cell[22289, 819, 67, 2, 66, "Input"], Cell[22359, 823, 36, 0, 33, "Text"], Cell[22398, 825, 54, 1, 66, "Input"], Cell[22455, 828, 198, 6, 33, "Text"], Cell[22656, 836, 150, 5, 66, "Input"], Cell[22809, 843, 54, 1, 66, "Input"], Cell[22866, 846, 103, 5, 33, "Text"], Cell[22972, 853, 67, 2, 66, "Input"], Cell[23042, 857, 33, 0, 33, "Text"], Cell[23078, 859, 54, 1, 66, "Input"], Cell[23135, 862, 254, 8, 33, "Text"], Cell[23392, 872, 44, 1, 66, "Input"], Cell[23439, 875, 186, 2, 33, "Text"], Cell[23628, 879, 127, 4, 70, "Input"], Cell[23758, 885, 307, 7, 55, "Text"], Cell[24068, 894, 44, 1, 66, "Input"], Cell[24115, 897, 81, 2, 66, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[24245, 905, 33, 0, 42, "Section"], Cell[24281, 907, 105, 5, 26, "Text"], Cell[24389, 914, 159, 5, 43, "Input"], Cell[24551, 921, 38, 0, 26, "Text"], Cell[24592, 923, 72, 2, 37, "Input"], Cell[24667, 927, 25, 0, 26, "Text"], Cell[24695, 929, 73, 2, 37, "Input"], Cell[24771, 933, 39, 0, 26, "Text"], Cell[24813, 935, 168, 5, 37, "Input"], Cell[24984, 942, 42, 0, 26, "Text"], Cell[25029, 944, 173, 5, 37, "Input"], Cell[25205, 951, 52, 0, 26, "Text"], Cell[25260, 953, 105, 3, 37, "Input"], Cell[25368, 958, 21, 0, 26, "Text"], Cell[25392, 960, 168, 5, 37, "Input"], Cell[25563, 967, 39, 0, 26, "Text"], Cell[25605, 969, 281, 8, 37, "Input"], Cell[25889, 979, 33, 0, 26, "Text"], Cell[25925, 981, 168, 5, 37, "Input"], Cell[26096, 988, 91, 2, 26, "Text"], Cell[26190, 992, 819, 25, 53, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[27046, 1022, 48, 0, 42, "Section"], Cell[27097, 1024, 66, 0, 33, "Text"], Cell[27166, 1026, 192, 6, 75, "Input"], Cell[27361, 1034, 350, 11, 55, "Text"], Cell[27714, 1047, 364, 11, 66, "Input"], Cell[28081, 1060, 216, 8, 33, "Text"], Cell[28300, 1070, 59, 1, 66, "Input"], Cell[28362, 1073, 56, 1, 66, "Input"], Cell[28421, 1076, 255, 5, 55, "Text"], Cell[28679, 1083, 92, 4, 93, "Input"], Cell[28774, 1089, 143, 4, 73, "Text"], Cell[28920, 1095, 49, 1, 66, "Input"], Cell[28972, 1098, 122, 3, 33, "Text"], Cell[29097, 1103, 49, 1, 66, "Input"], Cell[29149, 1106, 70, 0, 33, "Text"], Cell[29222, 1108, 49, 1, 66, "Input"], Cell[29274, 1111, 70, 0, 33, "Text"], Cell[29347, 1113, 85, 2, 66, "Input"], Cell[29435, 1117, 37, 0, 33, "Text"], Cell[29475, 1119, 304, 14, 33, "Text"], Cell[29782, 1135, 111, 3, 66, "Input"], Cell[29896, 1140, 28, 0, 33, "Text"], Cell[29927, 1142, 79, 2, 66, "Input"], Cell[30009, 1146, 173, 8, 33, "Text"], Cell[30185, 1156, 64, 1, 66, "Input"], Cell[30252, 1159, 68, 0, 33, "Text"], Cell[30323, 1161, 140, 4, 66, "Input"], Cell[30466, 1167, 22, 0, 33, "Text"], Cell[30491, 1169, 120, 3, 66, "Input"], Cell[30614, 1174, 168, 5, 66, "Input"], Cell[30785, 1181, 57, 1, 66, "Input"], Cell[30845, 1184, 56, 0, 33, "Text"], Cell[30904, 1186, 117, 2, 66, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[31058, 1193, 27, 0, 42, "Section"], Cell[CellGroupData[{ Cell[31110, 1197, 35, 0, 34, "Subsection"], Cell[31148, 1199, 358, 11, 28, "Text"], Cell[31509, 1212, 1523, 42, 96, "Input"], Cell[33035, 1256, 44, 0, 26, "Text"], Cell[33082, 1258, 934, 27, 81, "Input"], Cell[34019, 1287, 85, 2, 26, "Text"], Cell[34107, 1291, 833, 24, 81, "Input"], Cell[34943, 1317, 912, 17, 71, "Text"], Cell[35858, 1336, 573, 11, 56, "Text"], Cell[36434, 1349, 64, 1, 27, "Input"], Cell[36501, 1352, 364, 6, 35, "Text"], Cell[36868, 1360, 138, 3, 27, "Input"], Cell[37009, 1365, 71, 1, 27, "Input"], Cell[37083, 1368, 120, 1, 20, "Text"], Cell[37206, 1371, 104, 1, 27, "Input"], Cell[37313, 1374, 229, 4, 20, "Text"], Cell[37545, 1380, 420, 14, 27, "Input"], Cell[37968, 1396, 252, 7, 27, "Input"], Cell[38223, 1405, 82, 1, 20, "Text"], Cell[38308, 1408, 560, 9, 65, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[38905, 1422, 29, 0, 31, "Subsection"], Cell[38937, 1424, 94, 2, 33, "Text"], Cell[39034, 1428, 975, 30, 208, "Input", CellTags->"Hue"], Cell[40012, 1460, 173, 3, 33, "Text"], Cell[40188, 1465, 147, 3, 66, "Input"], Cell[40338, 1470, 709, 18, 90, "Input"], Cell[41050, 1490, 709, 18, 90, "Input"], Cell[41762, 1510, 91, 2, 33, "Text"], Cell[41856, 1514, 714, 18, 90, "Input"], Cell[42573, 1534, 93, 2, 33, "Text"], Cell[42669, 1538, 16973, 388, 274, "Text"], Cell[59645, 1928, 496, 15, 66, "Input"], Cell[60144, 1945, 180, 4, 33, "Text"], Cell[60327, 1951, 964, 26, 127, "Input"], Cell[61294, 1979, 603, 17, 66, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[61946, 2002, 41, 0, 42, "Section"], Cell[61990, 2004, 59, 0, 20, "Text"], Cell[62052, 2006, 387, 14, 33, "Input"], Cell[62442, 2022, 42, 0, 20, "Text"], Cell[62487, 2024, 559, 16, 27, "Input"], Cell[63049, 2042, 479, 8, 50, "Text"], Cell[63531, 2052, 590, 17, 43, "Input"], Cell[64124, 2071, 38, 0, 20, "Text"], Cell[64165, 2073, 690, 17, 27, "Input"], Cell[64858, 2092, 327, 7, 35, "Text"], Cell[65188, 2101, 2586, 60, 88, "Input"], Cell[67777, 2163, 38, 0, 20, "Text"], Cell[67818, 2165, 689, 17, 27, "Input"], Cell[68510, 2184, 158, 3, 20, "Text"], Cell[68671, 2189, 133, 4, 27, "Input"], Cell[68807, 2195, 42, 0, 20, "Text"], Cell[68852, 2197, 152, 5, 29, "Input"], Cell[69007, 2204, 36, 0, 20, "Text"], Cell[69046, 2206, 131, 4, 27, "Input"], Cell[69180, 2212, 141, 4, 27, "Input"], Cell[69324, 2218, 292, 11, 26, "Text"], Cell[69619, 2231, 226, 7, 27, "Input"], Cell[69848, 2240, 175, 8, 20, "Text"], Cell[70026, 2250, 131, 4, 27, "Input"], Cell[70160, 2256, 41, 0, 20, "Text"], Cell[70204, 2258, 128, 4, 27, "Input"], Cell[70335, 2264, 217, 6, 20, "Text"], Cell[70555, 2272, 168, 5, 27, "Input"], Cell[70726, 2279, 25, 0, 20, "Text"], Cell[70754, 2281, 115, 3, 27, "Input"], Cell[70872, 2286, 211, 8, 20, "Text"], Cell[71086, 2296, 58, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[71181, 2302, 107, 1, 42, "Section"], Cell[71291, 2305, 540, 11, 35, "Text"], Cell[71834, 2318, 223, 5, 27, "Input"], Cell[72060, 2325, 753, 16, 65, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[72850, 2346, 59, 1, 42, "Section"], Cell[72912, 2349, 207, 7, 32, "Text"], Cell[CellGroupData[{ Cell[73144, 2360, 29, 0, 34, "Subsection"], Cell[73176, 2362, 280, 8, 23, "Text"], Cell[73459, 2372, 29, 0, 20, "Exercise"], Cell[73491, 2374, 1065, 37, 55, "Text"], Cell[CellGroupData[{ Cell[74581, 2415, 33, 0, 18, "Subsubsection"], Cell[74617, 2417, 312, 10, 43, "Input"], Cell[74932, 2429, 153, 3, 23, "Input"], Cell[75088, 2434, 1146, 34, 39, "Input"], Cell[76237, 2470, 58, 1, 23, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[76344, 2477, 36, 0, 26, "Subsection"], Cell[76383, 2479, 233, 6, 20, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[76653, 2490, 27, 0, 26, "Subsection"], Cell[76683, 2492, 769, 22, 44, "Text"], Cell[CellGroupData[{ Cell[77477, 2518, 33, 0, 18, "Subsubsection"], Cell[77513, 2520, 1150, 31, 49, "Input"], Cell[78666, 2553, 278, 7, 29, "Text"], Cell[78947, 2562, 666, 22, 29, "Input"], Cell[79616, 2586, 61, 0, 26, "Text"], Cell[79680, 2588, 60, 1, 23, "Input"], Cell[79743, 2591, 60, 0, 26, "Text"], Cell[79806, 2593, 496, 14, 23, "Input"], Cell[80305, 2609, 58, 0, 26, "Text"], Cell[80366, 2611, 332, 8, 23, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[80747, 2625, 33, 0, 26, "Subsection"], Cell[80783, 2627, 786, 23, 46, "Text"], Cell[CellGroupData[{ Cell[81594, 2654, 33, 0, 18, "Subsubsection"], Cell[81630, 2656, 96, 2, 26, "Text"], Cell[81729, 2660, 290, 9, 36, "Input"], Cell[82022, 2671, 51, 0, 26, "Text"], Cell[82076, 2673, 50, 1, 23, "Input"], Cell[82129, 2676, 60, 0, 26, "Text"], Cell[82192, 2678, 291, 9, 36, "Input"], Cell[82486, 2689, 55, 0, 26, "Text"], Cell[82544, 2691, 290, 9, 36, "Input"], Cell[82837, 2702, 90, 2, 26, "Text"], Cell[82930, 2706, 291, 9, 36, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[83270, 2721, 37, 0, 26, "Subsection"], Cell[83310, 2723, 1726, 52, 179, "Text"], Cell[CellGroupData[{ Cell[85061, 2779, 33, 0, 18, "Subsubsection"], Cell[85097, 2781, 715, 23, 34, "Input"], Cell[85815, 2806, 63, 1, 27, "Input"], Cell[85881, 2809, 56, 1, 27, "Input"], Cell[85940, 2812, 93, 2, 27, "Input"], Cell[86036, 2816, 81, 2, 27, "Input"], Cell[86120, 2820, 111, 3, 27, "Input"], Cell[86234, 2825, 79, 2, 27, "Input"], Cell[86316, 2829, 101, 2, 27, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[86466, 2837, 36, 0, 26, "Subsection"], Cell[86505, 2839, 447, 15, 20, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[86989, 2859, 44, 0, 26, "Subsection"], Cell[87036, 2861, 1321, 40, 62, "Text"], Cell[CellGroupData[{ Cell[88382, 2905, 33, 0, 18, "Subsubsection"], Cell[88418, 2907, 58, 1, 27, "Input"], Cell[88479, 2910, 528, 17, 54, "Input"], Cell[89010, 2929, 344, 11, 27, "Input"], Cell[89357, 2942, 54, 0, 20, "Text"], Cell[89414, 2944, 395, 12, 27, "Input"], Cell[89812, 2958, 55, 0, 20, "Text"], Cell[89870, 2960, 442, 13, 27, "Input"], Cell[90315, 2975, 492, 14, 27, "Input"], Cell[90810, 2991, 496, 15, 27, "Input"], Cell[91309, 3008, 572, 17, 27, "Input"], Cell[91884, 3027, 349, 11, 27, "Input"], Cell[92236, 3040, 521, 14, 27, "Input"], Cell[92760, 3056, 457, 13, 27, "Input"], Cell[93220, 3071, 699, 21, 43, "Input"], Cell[93922, 3094, 415, 12, 27, "Input"], Cell[94340, 3108, 466, 13, 27, "Input"], Cell[94809, 3123, 403, 12, 27, "Input"], Cell[95215, 3137, 644, 16, 27, "Input"], Cell[95862, 3155, 187, 6, 27, "Input"], Cell[96052, 3163, 50, 1, 27, "Input"] }, Closed]] }, Closed]] }, Closed]] }, Open ]] } ] *) (* End of internal cache information *)