(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 4.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 96349, 3701]*) (*NotebookOutlinePosition[ 120588, 4576]*) (* CellTagsIndexPosition[ 120544, 4572]*) (*WindowFrame->Normal*) Notebook[{ Cell["Complex I: Algebra", "Title", Evaluatable->False, AspectRatioFixed->True], Cell["R.G. Palmer", "Subsubtitle", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Background and Copyright", "Subsection"], Cell[TextData[{ "This ", StyleBox["Mathematica", FontSlant->"Italic"], " Notebook was written by Richard G. Palmer (Physics Department, Duke \ University) for use in a course he taught. As of 1999, it has been made \ available for general non-profit use under the following copyright \ provision." }], "Text"], Cell[TextData[{ StyleBox["This Mathematica Notebook is Copyright Richard G. Palmer, 1997", FontWeight->"Bold"], ". It may be freely used by individuals, and by classes at academic \ institutions, provided:\n1. Credit is given to Richard Palmer as the original \ author; and\n2. It is not bought or sold or exchanged for profit, or \ incorporated into material that is bought or sold or exchanged for profit.\n\ Any other use requires the written permission of Richard Palmer, Dept. of \ Physics, Box 90305, Duke University, Durham, NC 27708, USA. See ", StyleBox["http://www.phy.duke.edu/~palmer", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for the email address." }], "Text"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " Version: 4.\nDate: 7/21/00." }], "Text"], Cell[TextData[{ "See ", StyleBox["http://www.phy.duke.edu/~palmer/notebooks/", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for other ", StyleBox["Mathematica", FontSlant->"Italic"], " noteboks by Richard Palmer." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Preface"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ This notebook is mainly about Mathematica techniques for dealing \ with complex algebra. And it introduces several new Mathematica operators \ and functions.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "This is an optional section, but you might find it interesting. ", StyleBox[ "Just for the fun of it, here is a way to plot a picture of the famous \ Mandelbrot set.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["There are 3 problems embedded in the text.", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Complex Arithmetic, and Some Operators", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData["Examples"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Mathematica will do ordinary complex algebra as a matter of course if \ expressions are complex. You must use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["I", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" or ", Evaluatable->False, AspectRatioFixed->True], StyleBox["\[ImaginaryI]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" (but not ", Evaluatable->False, AspectRatioFixed->True], StyleBox["i", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ") for imaginary parts. For example, try evaluating the following \ (one-by-one):", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["(3 + 2I)^2", "Input", AspectRatioFixed->True], Cell["(2 + 3I)(4 - 2I)", "Input", AspectRatioFixed->True], Cell["(7 + 10I)/(2 - 3I)^2", "Input", AspectRatioFixed->True], Cell[TextData[ "Surprised at the last result? Remember that Mathematica does integer \ arithmetic to infinite precision; this includes rational numbers too. If \ you want an approximate numerical result you can make one of the numbers \ real:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["(7.0 + 10I)/(2 - 3I)^2", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["or you can use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["//N", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" at the end:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["(7 + 10I)/(2 - 3I)^2 //N", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Mathematica may also produce complex results itself from expressions not \ containing any ", Evaluatable->False, AspectRatioFixed->True], StyleBox["I", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["'s, like", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Sqrt[-25]", "Input", AspectRatioFixed->True], Cell[TextData["or"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Sqrt[-20]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Again, Mathematica doesn't make approximations unless asked to do so, so \ it leaves ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Sqrt[5]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" or ", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`\@5\)]], StyleBox[" unevaluated.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "Here are two more examples, asking for the solutions of a quadratic equation \ and a cubic equation:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Solve[ x^2 - 2x +2 == 0, x]", "Input", AspectRatioFixed->True], Cell["Solve [ x^3 == 1, x]", "Input", AspectRatioFixed->True], Cell["% //N", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "You can get real and imaginary parts, absolute value (modulus), argument \ (phase), and complex conjugate with the functions ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Re[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Im[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Abs[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Arg[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Conjugate[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[". For example (first defining ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["): ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["z = 2 - 3I", "Input", AspectRatioFixed->True], Cell["Re[z]", "Input", AspectRatioFixed->True], Cell["Im[z]", "Input", AspectRatioFixed->True], Cell["Conjugate[z]", "Input", AspectRatioFixed->True], Cell["Abs[z]", "Input", AspectRatioFixed->True], Cell["Arg[z]", "Input", AspectRatioFixed->True], Cell["Re[z / (z^2 + z + 1)]", "Input", AspectRatioFixed->True], Cell["Im[(z+1)^3]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Note that, like ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Sqrt[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Arg[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" doesn't give a ", Evaluatable->False, AspectRatioFixed->True], StyleBox["numerical", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " answer unless it can give an exact one, although you can force an \ approximate answer with ", Evaluatable->False, AspectRatioFixed->True], StyleBox["//N", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[":", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Arg[z] //N", "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Removing definitions: =. and Clear[]", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Note", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ ": This section and the next wander off from the topic of complex \ arithmetic. They discuss some important Mathematica operators that we'll \ need to understand. Roughly the same material is discussed in Section 1.4.2 \ of the Mathematica book.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Before we go on, we're going to remove the definition that we made earlier \ for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[". Otherwise every ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" from now on would get replaced by ", Evaluatable->False, AspectRatioFixed->True], StyleBox["2 - 3I", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[". It's ", Evaluatable->False, AspectRatioFixed->True], StyleBox["very", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " important to remember to remove old definitions when you want to reuse a \ name; not doing so is probably the most common beginner's error in \ Mathematica. For example, the following innocent-looking command fails \ because ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" has a fixed value already:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Integrate[1/(1+z^2), {z,0,1}]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["You can remove a definition with the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["unset", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" operator \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["=.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\", so here we need:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["z =.", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Now the above ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Integrate[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" will work; try it again.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["You're allowed to leave a space between the \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\" and the \"", Evaluatable->False, AspectRatioFixed->True], StyleBox[".", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\", so I could have written \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["z = .", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ "\", but it's still really only one operator. You should think of it as \ unsetting or undefining the left hand side, not as setting it equal to \ \".\".", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Another way to remove a value for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" is ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Clear[z]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ", but this is not quite the same in general, though here either would do.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Clear[", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["symbol", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" only works on ", Evaluatable->False, AspectRatioFixed->True], StyleBox["symbols", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[", and clears ", Evaluatable->False, AspectRatioFixed->True], StyleBox["all", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" the associated definitions (though not ", Evaluatable->False, AspectRatioFixed->True], StyleBox["attributes", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[", but we won't discuss them here). ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["\"", Evaluatable->False, AspectRatioFixed->True], StyleBox["lhs", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[" =.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\" removes any definitions for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["lhs", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ ", which could be anything that could appear on the left-hand-side of an ", Evaluatable->False, AspectRatioFixed->True], StyleBox["=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" or a ", Evaluatable->False, AspectRatioFixed->True], StyleBox[":=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" operator.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["For example, let's define some rules for a symbol ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[":", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ a[1] := 0; a[foo] := -1 a[n_] := n^2; a[n_,m_] := (n-m)^2\ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Note that the first rule would be used for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a[1]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" and the rule for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a[foo]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", but the third rule would be used for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a[2]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[". The general idea is that the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["most specific", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " applicable rule is used. The fourth rule would only be used for a two \ argument case. Try it out:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["{ a[1], a[foo], a[2], a[3,4] }", "Input", AspectRatioFixed->True], Cell[TextData[{ "(A compact way to try several things at once is to put them in a list like \ this.) ", StyleBox["We can see all the rules for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" with:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(?a\)\)], "Input"], Cell[TextData[{ StyleBox[ "Suppose that we now wanted to remove the first rule, so that the third one \ would be used in one-argument cases (but not ", Evaluatable->False, AspectRatioFixed->True], StyleBox["foo", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox["). ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Clear[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" does ", Evaluatable->False, AspectRatioFixed->True], StyleBox["not", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" work, because it only applies to ", Evaluatable->False, AspectRatioFixed->True], StyleBox["symbols", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[", and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a[1]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" is not a plain symbol: ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Clear[a[1]]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["But ", Evaluatable->False, AspectRatioFixed->True], StyleBox["lhs", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[" =.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" does:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["a[1] =.", "Input", AspectRatioFixed->True], Cell[TextData[{ "Now the ", StyleBox["second", FontSlant->"Italic"], " rule applies:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["a[1]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["We can see all the rules remaining for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" with:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["?a", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Now let's try clearing the rule for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a[n_]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ". Let's see whether or not it works if we change the name of the label ", Evaluatable->False, AspectRatioFixed->True], StyleBox["n", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" to ", Evaluatable->False, AspectRatioFixed->True], StyleBox["x", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[":", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["a[x_] =.", "Input", AspectRatioFixed->True], Cell["?a", "Input", AspectRatioFixed->True], Cell["Good. Of course we can always use", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Clear[a]", "Input", AspectRatioFixed->True], Cell["?a", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["to clear all the rules associated with ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" if that's what we want. But remember that \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["lhs", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[" =.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ "\" is a lot more flexible, and can be used for selective editing of \ rules.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Rules and Replacements: /. -> :>", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Note:", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" Most of this material was also covered (more briefly) in the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Series", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" notebook.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["One approach to avoiding trouble after making definitions like ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z = 2 - 3I ", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ "(and forgetting to remove them) is not to make them at all! Some \ Mathematica purists avoid such definitions almost entirely. The idea is to \ work only with symbols (like ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ "), and to do all your calculations symbolically, only substituting in \ numbers at the end (if at all). I don't advocate such a purist approach, but \ it is useful to avoid definitions in some cases.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "But how do you substitute in numbers without defining a value for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["? I'm glad you asked. That's where the replacement operator ", Evaluatable->False, AspectRatioFixed->True], StyleBox["/.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" comes in. ", Evaluatable->False, AspectRatioFixed->True], StyleBox["/.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" is one of the most important operators in Mathematica after ", Evaluatable->False, AspectRatioFixed->True], StyleBox["=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" and ", Evaluatable->False, AspectRatioFixed->True], StyleBox[":=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ". It specifies the replacement of a symbol (or subexpression) in an \ expression using a ", Evaluatable->False, AspectRatioFixed->True], StyleBox["rule", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" specified with ", Evaluatable->False, AspectRatioFixed->True], StyleBox["->", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[". You've already seen that options to functions like ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Plot[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" are specified by such ", Evaluatable->False, AspectRatioFixed->True], StyleBox["rules", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" (e.g. ", Evaluatable->False, AspectRatioFixed->True], StyleBox["PlotLabel->\"Pretty Plot\"", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["). The usual syntax for a ", Evaluatable->False, AspectRatioFixed->True], StyleBox["/.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" replacement is: ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["expression", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" /. ", Evaluatable->False, AspectRatioFixed->True], StyleBox["symbol", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" -> ", Evaluatable->False, AspectRatioFixed->True], StyleBox["replacement", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"] }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Every occurrence of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["symbol", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[" in ", Evaluatable->False, AspectRatioFixed->True], StyleBox["expression", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[" is replaced by ", Evaluatable->False, AspectRatioFixed->True], StyleBox["replacement", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[". This is usually read as \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["expression", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" at the point where ", Evaluatable->False, AspectRatioFixed->True], StyleBox["symbol", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" goes to ", Evaluatable->False, AspectRatioFixed->True], StyleBox["replacement", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox["\". Thinking of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["/.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" as \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["at the point where", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox["\"", Evaluatable->False, AspectRatioFixed->True, FontSize->12], StyleBox[" makes it easy to remember. For example:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["z^4 /. z -> 2 - 3I", "Input", AspectRatioFixed->True], Cell["Sin[5 t] /. t -> 2.1", "Input", AspectRatioFixed->True], Cell["x^2 Log[x + y] /. x -> a", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "This is very different from using a definition (assignment) like ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z = 2 - 3I", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" or ", Evaluatable->False, AspectRatioFixed->True], StyleBox[" ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["t = 2.1", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" which would permanently change ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" or ", Evaluatable->False, AspectRatioFixed->True], StyleBox["t", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" (until changed again). ", Evaluatable->False, AspectRatioFixed->True], StyleBox["/.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" only makes the replacement for the expression at its left.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["More than one replacement rule may be specified after ", Evaluatable->False, AspectRatioFixed->True], StyleBox["/.", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" ", Evaluatable->False, AspectRatioFixed->True, FontSize->12], StyleBox["by putting them in a list. For example:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["x^2 + 3 x y /. {x -> r Cos[theta], y -> r Sin[theta]}", "Input", AspectRatioFixed->True], Cell[TextData[ "It is also possible to have a subexpression instead of a symbol on the left \ hand side of the rule part:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Exp[Sin[x]] /. Sin[x] -> s", "Input", AspectRatioFixed->True], Cell["x^2 (1 + x^2) /. x^2 -> a", "Input", AspectRatioFixed->True], Cell[TextData[ "But this only works if your representation of the subexpression matches \ Mathematica's internal one. For example:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["x^2 + a/x^2 /. x^2 -> b", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["It didn't substitute for ", Evaluatable->False, AspectRatioFixed->True], StyleBox["x^2", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " in the second term because Mathematica's internal representation of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a/x^2", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" is actually ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a*x^", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["-2", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontVariations->{"CompatibilityType"->"Superscript"}], StyleBox[". You can see this with ", Evaluatable->False, AspectRatioFixed->True], StyleBox["//FullForm", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ", which shows Mathematica's internal representation of an expression:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["% //FullForm", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Rules can even use dummy arguments (specified by ", Evaluatable->False, AspectRatioFixed->True], StyleBox["name", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["_", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["), just as in defining functions:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["x^2 + y^2 /. n_^2 -> n^3", "Input", AspectRatioFixed->True], Cell["Gamma[p] Gamma[q] / Gamma[p+q] /. Gamma[z_] -> (z-1)!", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Besides making substitutions to specialize or simplify an equation, you \ also need to use the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["/.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " replacement operator to extract actual values when a Mathematica function \ returns a rule. For example, we found the location of the minimum of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["\[CapitalGamma]", Evaluatable->False, AspectRatioFixed->True, FontSize->12], StyleBox["(z) between 1 and 2 with:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["FindMinimum[Gamma[z], {z,1,2}]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "The result is returned as a list, of which the second element is a ", Evaluatable->False, AspectRatioFixed->True], StyleBox["rule", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " for z. Suppose I now want to calculate z^2 at that point; I need to \ extract a value for z itself. The following is the standard way:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["z^2 /. %[[2]]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Make sure you understand that; it's a very common idiom. The ", Evaluatable->False, AspectRatioFixed->True], StyleBox["[[2]]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" takes the second element of the list referred to as ", Evaluatable->False, AspectRatioFixed->True], StyleBox["%", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[". That still leaves an unneccessary extra pair of braces ", Evaluatable->False, AspectRatioFixed->True], StyleBox["{...}", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", but that doesn't matter because ", Evaluatable->False, AspectRatioFixed->True], StyleBox["/.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " is willing to accept a list (even with only one argument) for its \ right-hand-side.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["There's one last twist to this business. When a rule ", Evaluatable->False, AspectRatioFixed->True], StyleBox["symbol", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontSlant->"Italic"], StyleBox[" -> ", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12], StyleBox["replacement", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontSlant->"Italic"], StyleBox[" is encountered, the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["replacement", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontSlant->"Italic"], StyleBox[ " is evaluated immediately as far as possible. This usually doesn't \ matter, but in some cases can mess you up. For example", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["int[x^2] /. int[z_] -> Integrate[z, {x,0,10}]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "What happened? The integral was done before the rule was used, obtaining \ 10z (unknown variables are treated as constants in an integral). When this \ is a problem, we can use a \"delayed rule\" instead, replacing \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["->", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\" by \"", Evaluatable->False, AspectRatioFixed->True], StyleBox[":>", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\". Thus:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["int[x^2] /. int[z_] :> Integrate[z, {x,0,10}]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[":> ", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" is to ", Evaluatable->False, AspectRatioFixed->True], StyleBox["->", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" as ", Evaluatable->False, AspectRatioFixed->True], StyleBox[":=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" is to ", Evaluatable->False, AspectRatioFixed->True], StyleBox["=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " . In the \":\" versions, the right hand side is only evaluated when the \ rule is actually used, after substitutions for pattern variables (like ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" above) have been made.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Problem 1"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "a. Find a numerical value for exp(x) at the real root of x^3 +3 x + 1 = \ 0. Use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Solve[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" and the replacement operator.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "b. Make a plot of the root of the equation exp(-x) = cx as c varies from 1 \ to 2. You must use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["FindRoot[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" instead of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Solve[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" to find numerical roots to general equations; ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Solve[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " can only deal with polynomials and a few other special cases. But ", Evaluatable->False, AspectRatioFixed->True], StyleBox["FindRoot[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " can only deal with numerical (not symbolic) cases. Look it up in the \ book or use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["?FindRoot", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" to learn how to use it. ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Complex Algebra, Real and Imaginary Parts"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData["Introduction"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Let's return to complex numbers. Up to now we were working with actual \ numers (like ", Evaluatable->False, AspectRatioFixed->True], StyleBox["7 + 10 I", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["), or symbols (like ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ") that had numerical values. But of course we can also do complex ", Evaluatable->False, AspectRatioFixed->True], StyleBox["algebra", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" with symbolic expressions:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["(x + I y) + (2x - 3I y)", "Input", AspectRatioFixed->True], Cell[TextData["Be very careful about how you type such expressions:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["x + Iy", "Input", AspectRatioFixed->True], Cell[TextData["is not at all the same as"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["x + I y", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["In the first case you're talking about a variable called ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Iy", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[".", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Mathematica does not automatically expand out complex expressions, \ generally preferring a factored form. But you can force it to multiply \ things out with ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Expand[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" or ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ExpandAll[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[". Try the following (in order; note the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["%", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["'s).", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["I (x + I y)", "Input", AspectRatioFixed->True], Cell["Expand[%]", "Input", AspectRatioFixed->True], Cell["(x + I y)^3", "Input", AspectRatioFixed->True], Cell["Expand[%]", "Input", AspectRatioFixed->True], Cell[TextData[ "Suppose we want to extract the real or imaginary part (or modulus, etc) of a \ symbolic expression like this. Let's name it \"e\" so we can play with it \ more easily:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["e = %", "Input", AspectRatioFixed->True], Cell[TextData["You might expect this to work ..."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Re[e]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["... but it doesn't. The functions ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Re[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Im[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Abs[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Arg[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Conjugate[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" are only set up to work with ", Evaluatable->False, AspectRatioFixed->True], StyleBox["numerical", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " arguments. This is a major annoyance when you're trying to do complex \ algebra. There are several ways around it, though none are 100% \ satisfactory. We'll explore two approaches.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Algebra`ReIm`"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["There's a standard Mathematica package called ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Algebra`ReIm`", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" that is intended to extend ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Re[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Im[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" to symbolic arguments. Let's read it in:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["<< Algebra`ReIm`", "Input", AspectRatioFixed->True], Cell[TextData[ "Now let's try the above evaluation again (be patient):"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Re[e]", "Input", AspectRatioFixed->True], Cell[TextData[ "Hmm, that probably wasn't what you expected. Do you see what the trouble \ is? It doesn't know that we meant x and y to be real, so it's given us a \ more general answer without that assumption. We can get what we want if we \ replace the imaginary parts by 0 and the real parts by themselves:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["% /. {Im[_] -> 0, Re[thing_] -> thing}", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Make sure you understand that one", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ ". In the imaginary part I used a pattern \"_\" that matches anything, and \ didn't bother to name it; I could have used something like \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["Im[stuff_] -> 0", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\" but since it's not needed again I simply dropped the name \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["stuff", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\". In the real part I did need a name, and used \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["thing", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\". I could even have used \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["x", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\" instead of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["thing", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" -- that ", Evaluatable->False, AspectRatioFixed->True], StyleBox["x", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" would have no relation to the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["x", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " on the left hand side (but it sure would be confusing for neophytes).", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "OK, so we successfully extracted the real part. But it was a bit like a \ dental extraction (painful). Can't we tell the stupid machine that x and y \ are supposed to be real in the first place? Yes, we can: we just have to ", Evaluatable->False, AspectRatioFixed->True], StyleBox["tell it that the imaginary part of the variable is zero", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[". Let's try the obvious approach:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Im[x] = 0", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Hmm. This is a fairly common error message that you should learn to \ interpret. The trouble is that Mathematica tries to associate the above rule \ with the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Im[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" function, but can't because ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Im[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" is ", Evaluatable->False, AspectRatioFixed->True], StyleBox["protected", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " -- it cannot (and should not) be changed (unless you first \"unprotect\" \ it).", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["Here's another example of the same error message:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["a + b = 3", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["In this case the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Tag", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " -- the symbol with which the rule is to be associated -- is the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Plus[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" function, because the full form of the left hand side is ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Plus[a,b]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[".", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "The solution in our case is to specify that the rule is to be associated \ with x instead of with ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Im[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", using an ", Evaluatable->False, AspectRatioFixed->True], StyleBox["explicit tag", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" ", Evaluatable->False, AspectRatioFixed->True], StyleBox["x/:", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" in front of the rule:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["x/: Im[x] = 0", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "For a further discussion of this, see section 2.4.10 of the Mathematica \ book. There's also a shorthand for the above syntax; if you use the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["^=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " operator the tag is taken automatically from the inner symbol \ (technically the first argument of the outermost function). So I can make \ the equivalent definition for y with", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Im[y] ^= 0", "Input", AspectRatioFixed->True], Cell[TextData["Let's check the definitions associated with x and y:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["?x", "Input", AspectRatioFixed->True], Cell["?y", "Input", AspectRatioFixed->True], Cell[TextData[ "Note that they both got put into the same form, even though we entered them \ differently."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["There's also an ", Evaluatable->False, AspectRatioFixed->True], StyleBox["^:=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" operator that is just like ", Evaluatable->False, AspectRatioFixed->True], StyleBox[":=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " except that it associates the rule with the inner symbol. It's a matter \ of choice whether you use the shorthand notations (", Evaluatable->False, AspectRatioFixed->True], StyleBox["^=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["^:=", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[") or the explicit tag notation ", Evaluatable->False, AspectRatioFixed->True], StyleBox["name", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["/:", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", but you do need to recognize both.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Now at last we can get sensible values for the real or imaginary parts of \ our expression ", Evaluatable->False, AspectRatioFixed->True], StyleBox["e", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[":", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Re[e]", "Input", AspectRatioFixed->True], Cell["Im[e]", "Input", AspectRatioFixed->True], Cell[TextData["Let's try the other elementary operations:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Conjugate[e]", "Input", AspectRatioFixed->True], Cell["Abs[e]", "Input", AspectRatioFixed->True], Cell["Arg[e]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Sigh. Time for a pronouncement: ", Evaluatable->False, AspectRatioFixed->True], StyleBox["the ", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox["Algebra`ReIm`", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[ " package is more trouble than it's worth. It's a major pain. It sucks. \ It's uncool. Etc -- fill in the epithet of your choice.", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" Specifically:\n1. It doesn't do ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Abs[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Arg[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ", as we saw.\n2. It assumes variables are complex unless you use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Im[...]^=0.\n", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["3. It's slow.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "This discussion hasn't been pointless though. You need to know what doesn't \ work well, as well as what does. And the idea of tags (/:) and the ^= and \ ^:= operators are important."], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData["ComplexExpand"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Now we'll try a different approach, using the function ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ComplexExpand[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ". But first let's wipe out all all trace of the deposed package, so what \ follows is independent of the definitions that it produced. The safest way \ is to quit and restart Mathematica, but the following shortcut will also work \ (don't worry about the details):", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Unprotect[Re, Im, Abs, Conjugate, Arg, RealValued]; Clear[Re, Im, Abs, Conjugate, Arg, RealValued]; Clear[\"Algebra`ReIm`*\"]; Protect[Re, Im, Abs, Conjugate, Arg];\ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["ComplexExpand[", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["expr", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" expands the expression ", Evaluatable->False, AspectRatioFixed->True], StyleBox["expr", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[ " assuming that all variables are real. It usually gives a decent \ separation of real and imaginary parts. Let's try it:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["ComplexExpand[e]", "Input", AspectRatioFixed->True], Cell["ComplexExpand[Exp[I x]]", "Input", AspectRatioFixed->True], Cell["ComplexExpand[Exp[Cosh[I x]*(x + I y)^2]]", "Input", AspectRatioFixed->True], Cell["\<\ Not bad, huh? This is generally all that you'll need when doing \ complex algebra. But what if you really need just the real part (or just the \ imaginary part)? Or the modulus or phase (arg)? There are several \ approaches:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData["a) Extraction by hand"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["It's normally simplest to use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ComplexExpand[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " and then extract the part of the expression you want \"by hand\" after \ seeing the result. So, for example:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["cee = ComplexExpand[e]\t(* define a shorthand *)", "Input", AspectRatioFixed->True], Cell["cee[[1]] + cee[[3]]\t\t (* real part *)", "Input", AspectRatioFixed->True], Cell["cee[[2]]/I + cee[[4]]/I (* imaginary part *)", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "You have to be a little careful with this general approach, because the \ way that Mathematica counts parts of an expression may not always be the \ obvious one. You can use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["//FullForm", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " to see the detailed structure of an expression if you wish. But when the \ expression is a simple sum of parts (as normally produced by ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ComplexExpand[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["), it's usually pretty easy to guess the part numbers you need.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData["b) Using the conjugate identities"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "Another approach to extracting real and imaginary parts is to use the \ identities: "], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Re[z]\ = \ \((z + \(z\^*\))\)/2\)], "DisplayFormula"], Cell[BoxData[ \(Im[z]\ = \ \((z - \(z\^*\))\)/2 I\)], "DisplayFormula"], Cell[TextData[{ StyleBox[ "This has the advantage that it can be automated, in a larger procedure or \ program for example. It's usually best to put the above identities ", Evaluatable->False, AspectRatioFixed->True], StyleBox["inside", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ComplexExpand[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[". Here are some examples:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["ComplexExpand[(e + Conjugate[e])/2]\t\t(* real part *)", "Input", AspectRatioFixed->True], Cell["\<\ e2 = Exp[I x]; ComplexExpand[(e2 + Conjugate[e2])/2]\t\t(* real part *)\ \>", "Input", AspectRatioFixed->True], Cell["\<\ e3 = Exp[Cosh[I x]*(x + I y)^2]; ComplexExpand[(e3 - Conjugate[e3])/(2I)]\t(* imag part *)\ \>", "Input", AspectRatioFixed->True], Cell[TextData[ "The same approach can be used to get moduli, using the identity"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\( | z | \)\ = \@\(\ \(zz\^*\)\)\)], "DisplayFormula"], Cell[TextData["For example:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Sqrt[ComplexExpand[e Conjugate[e]]]", "Input", AspectRatioFixed->True], Cell["Sqrt[ComplexExpand[e3 Conjugate[e3]]]", "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["c) Complex[_,_] -> 0", "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "A quick and dirty method to get the real part is to set as ", StyleBox["Complex[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " to 0! E.g." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["cee\t\t(* reminder *)", "Input", AspectRatioFixed->True], Cell[BoxData[ \(cee /. \ Complex[_, _]\ -> \ 0\)], "Input"], Cell[TextData[{ "But this isn't reliable ", StyleBox["for reason you'll understand shortly", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["--------------------- end ---------------------", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[TextData[{ StyleBox[ "Tired of this yet? OK, just let me show you one more example, where ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ComplexExpand[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" doesn't seem work so well:", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["ComplexExpand[Log[x + I y]]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["The presence of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Arg[x + I y]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12], StyleBox[ " in the answer suggests at first thought that the real/imaginary \ separation wasn't completed. But in fact it's OK; ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Arg[x + I y]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12], StyleBox[" is always real. You might consider replacing it by ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ArcTan[y/x]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12], StyleBox[", but that could be off by ", Evaluatable->False, AspectRatioFixed->True], StyleBox["\[Pi]", Evaluatable->False, AspectRatioFixed->True], StyleBox[". E.g.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["{Arg[1 + I], ArcTan[1]}\t\t\t(* OK *)", "Input", AspectRatioFixed->True], Cell["{Arg[-1 - I], ArcTan[1]}\t\t(* Wrong! *)", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Actually there's a two-argument form of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ArcTan[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" that correctly takes into account the quadrant; you use ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ArcTan[x, y]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[":", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["{Arg[-1 - I], ArcTan[-1,-1]}\t(* Right *)", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["Of course, now you understand why the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Complex[_,_]->0", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" trick is dangerous. Right?", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Problem 2"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Find the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["real part", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["modulus", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" of each of the following, where all variables are real except ", Evaluatable->False, AspectRatioFixed->True], StyleBox["w = u + iv", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[". ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Get the answers into a reasonably simple form", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ ". You shouldn't have any I's left in an answer, except perhaps ", Evaluatable->False, AspectRatioFixed->True], StyleBox["at most one I inside an ", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox["Arg[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[ ". Copying expressions by hand (or mouse) is cheating; you need to extract \ the required results by applying Mathematica operations. Some of these are a \ bit tricky; you'll need to give Mathematica a helping hand, usually with a \ replacement rule. Also consider using ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Simplify[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Together[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Expand[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Factor[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["PowerExpand[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" (see sections 1.4.3 -- 1.4.5 of the Mathematica book). ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["(-1)^(1/3)"], "Input", AspectRatioFixed->True], Cell[TextData["SphericalHarmonicY[1,1,theta,phi]"], "Input", AspectRatioFixed->True], Cell[TextData["(u + 2I v)^2 / (I u -v)"], "Input", AspectRatioFixed->True], Cell[TextData["Sin[w^2]"], "Input", AspectRatioFixed->True], Cell["a^w\t\t\t\t\t\t(* a positive *)", "Input", AspectRatioFixed->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Operator Review"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "You'll probably be relieved to know that I'm done for now with introducing \ new Mathematica operators and \"special forms\". We've met most of the \ important ones in fact. Here are the ones you should know about so far; \ check that you recognize each of them. It's the 3rd and 4th categories we've \ been focusing on in this notebook:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "Arithmetic:\n + - * / ^ ! !! ++\nComparison:\n == != < \ <= > >=\nAssignments and rules:\n = := =. /: ^= ^:= /. \ -> :>\nParts:\n [[...]]\nPatterns:\n _\nFile operations\n <<\n\ Applying functions\n [...] //\nLists\n {...}\nComments:\n (* ... *)\n\ Miscellaneous:\n ; % %% ?"], "Info", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "If you don't remember some of the above, you can look in the book (index, or \ Appendix A2) or try the ? operator. For example:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["?:>", "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Argand Diagrams"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData["ArgandPlot"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Here's a function called ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ArgandPlot[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " that takes a list of complex numbers and makes an Argand diagram (a \ picture of the complex plane). It's based on an example that used to be \ provided with an earlier version of Mathematica. Evaluate the function, and \ then try the example that follows: ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ ArgandPlot[z_List] := \tShow[Graphics[ \t\t{ \t\t\tPointSize[0.03], \t\t(Point[{Re[#], Im[#]}])& /@ N[z], \t\tPointSize[0.015], Point[{0,0}] \t}, \t\tAxes->Automatic, \t\tAspectRatio->Automatic, \t\tAxesLabel->{\"Re[z]\",\"Im[z]\"} \t]]\ \>", "Input", AspectRatioFixed->True], Cell[TextData["Example:"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["ArgandPlot[{2+I, 2-I, -1}]", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["You needn't worry about the details of how ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ArgandPlot[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " works, but do note that the arguments have to be given as a single-level \ list, even if there's only one of them.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Here's a fancier example where we look at z, z^2, z^3, ... for an initial \ value of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[":", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ z = 0.7 + 0.4I; ArgandPlot[ Table[z^n, {n,1,10}] ]\ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "And here we find and display the 10 roots of z^10 == 1. It's a little \ tricky because ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Solve[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" gives a list of replacements (with the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["->", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " operator), whereas we need a list of values. The third line does the \ conversion using the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["/.", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " replacement operator; we give it a list of lists and it returns a list. \ Study this carefully -- it's another standard Mathematica idiom. The first \ line is crucial, to undefine (again) the value of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" that we just used.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["z =.", "Input", AspectRatioFixed->True], Cell["Solve[ z^10 == 1, z]", "Input", AspectRatioFixed->True], Cell["list = z /. %", "Input", AspectRatioFixed->True], Cell["ArgandPlot[list]", "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Problem 3"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Explore what happens to the roots of the equation ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z^3 - z^2 - z + a = 0", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" as ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " varies from 0 to 2. Describe it in words, and make an Argand diagram for \ illustration.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "You'll probably want to superimpose solutions for a sequence of different \ ", Evaluatable->False, AspectRatioFixed->True], StyleBox["a", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["'s on the same plot, and may find ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Table[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Flatten[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " useful. Please don't print out long lists of solutions; a picture is \ worth a thousand numbers.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[TextData["The Mandelbrot Set [optional]"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Note: This is an optional section, but you might find it \ interesting.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "Just for the fun of it, here is a way to plot a picture of the famous \ Mandelbrot set. Each point ", Evaluatable->False, AspectRatioFixed->True], StyleBox["c = x + iy", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " in the complex plane is either in the Mandelbrot set or not; it is \ defined to be in the set if iteration of the equation", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["z := z^2 + c"], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["does ", Evaluatable->False, AspectRatioFixed->True], StyleBox["not", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" take ", Evaluatable->False, AspectRatioFixed->True], StyleBox["|z|", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" to infinity, starting from ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z = 0", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ". The Mandelbrot set has structure, often very beautiful, down to \ arbitrarily fine length scales; see for example the pictures in Gleick's book \ \"Chaos\".", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["We obviously can't iterate ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z := z^2 + c", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" for ever, or expect ", Evaluatable->False, AspectRatioFixed->True], StyleBox["|z|", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" to reach infinity (if ", Evaluatable->False, AspectRatioFixed->True], StyleBox["c", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" is not in the set) in any ", Evaluatable->False, AspectRatioFixed->True], StyleBox["finite", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" number of iterations. But it turns out that if ", Evaluatable->False, AspectRatioFixed->True], StyleBox["|z|", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " gets larger than 2 then it will certainly go off to infinity, so we can \ stop iterating whenever ", Evaluatable->False, AspectRatioFixed->True], StyleBox["|z| > 2", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ". If this doesn't happen after a reasonable number of iterations (40 in \ the program below), we'll assume that ", Evaluatable->False, AspectRatioFixed->True], StyleBox["c", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " is in the set; the error set (points that would only get outside ", Evaluatable->False, AspectRatioFixed->True], StyleBox["|z| = 2", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" after ", Evaluatable->False, AspectRatioFixed->True], StyleBox["more", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" than 40 iterations) is very small.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "This is an example of writing a quick program in Mathematica, rather like \ one in C or Fortran. ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Compile", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " is useful in situations where you have to evaluate a particular numerical \ expression many times. By taking the time to call ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Compile", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ ", you can get a compiled function which can be executed more quickly than \ an ordinary Mathematica function (Mathematica book 2.5). ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Compile", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" creates a \"", Evaluatable->False, AspectRatioFixed->True], StyleBox["CompiledFunction", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\" object.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["The main list inside the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Module[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" declares local variables ", Evaluatable->False, AspectRatioFixed->True], StyleBox["c", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["t", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["iterations", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", and gives them initial values. Then the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["While[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" loop iterates the equation up to ", Evaluatable->False, AspectRatioFixed->True], StyleBox["iterations", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" (40) times, or until ", Evaluatable->False, AspectRatioFixed->True], StyleBox["|z| ", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["\[GreaterEqual]", Evaluatable->False, AspectRatioFixed->True, FontSize->12], StyleBox[" 2", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[".", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Mandelbrot\ = \ Compile[{x, y}, \[IndentingNewLine]Module[{z, t = 0, c = x + I\ y, iterations = 40}, \[IndentingNewLine]\tz = c; \[IndentingNewLine]\t While[\((Abs[z] < 2.0)\) && \((t < iterations)\), \[IndentingNewLine]\t\tt = t + 1; \[IndentingNewLine]\t\t z = z*z + c; \[IndentingNewLine]\t]; \[IndentingNewLine]\tt] \[IndentingNewLine]]\)], "Input"], Cell["Examples:", "Text"], Cell[BoxData[ \(Mandelbrot[\(-0.5\), 1.0]\)], "Input"], Cell[BoxData[ \(Mandelbrot[\(-0.5\), 0.67]\)], "Input"], Cell[BoxData[ \(Mandelbrot[0.0, 0.0]\)], "Input"], Cell[TextData[{ StyleBox["DensityPlot[]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " makes a plot of a function of two variables by showing different \ densities of \"colors\" for different values; we plot the number of \ iterations of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["z := z^2 + c", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" it took to get outside the circle ", Evaluatable->False, AspectRatioFixed->True], StyleBox["|z| = 2", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[", or ", Evaluatable->False, AspectRatioFixed->True], StyleBox["iterations", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" if we didn't get outside in that time", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["You can change the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["PlotPoints", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[ " value up or down from 100 to get a coarser or finer plot; the time it \ takes is proportional to the number of points squared (but if you make it too \ large you might run out of memory, if not patience). You can also change the \ x and y limits to zoom in on any region, though you might need to increase \ the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["iterations", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" beyond 40 if you blow up a very small region.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "DensityPlot[-Mandelbrot[x,y],\n\t{x,-1.75,0.75}, {y,-1.25,1.25},\n\t\ PlotPoints->100,\n\tMesh->False,\n\t", StyleBox["ColorFunction->Hue", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "\n]" }], "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "If you get seriously interested in the Mandelbrot set, you should actually \ ", Evaluatable->False, AspectRatioFixed->True], StyleBox["not", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " use Mathematica to explore it; there are much faster programs around.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]] }, FrontEndVersion->"4.2 for X", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{545, 575}, WindowMargins->{{142, Automatic}, {Automatic, 142}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, StyleDefinitions -> Notebook[{ Cell[CellGroupData[{ Cell["Style Definitions", "Subtitle"], Cell["\<\ Modify the definitions below to change the default appearance of \ all cells in a given style. Make modifications to any definition using \ commands in the Format menu.\ \>", "Text"], Cell[CellGroupData[{ Cell["Style Environment Names", "Section"], Cell[StyleData[All, "Working"], PageWidth->WindowWidth, ScriptMinSize->9], Cell[StyleData[All, "Presentation"], PageWidth->WindowWidth, ScriptMinSize->12, FontSize->16], Cell[StyleData[All, "Condensed"], PageWidth->WindowWidth, CellBracketOptions->{"Margins"->{1, 1}, "Widths"->{0, 5}}, ScriptMinSize->8, FontSize->11], Cell[StyleData[All, "Printout"], PageWidth->PaperWidth, ScriptMinSize->5, FontSize->10, PrivateFontOptions->{"FontType"->"Outline"}] }, Closed]], Cell[CellGroupData[{ Cell["Notebook Options", "Section"], Cell["\<\ The options defined for the style below will be used at the \ Notebook level.\ \>", "Text"], Cell[StyleData["Notebook"], PageHeaders->{{Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"], None, Cell[ TextData[ { ValueBox[ "FileName"]}], "Header"]}, {Cell[ TextData[ { ValueBox[ "FileName"]}], "Header"], None, Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"]}}, CellFrameLabelMargins->6, StyleMenuListing->None] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Headings", "Section", FontColor->RGBColor[0, 0, 1]], Cell[CellGroupData[{ Cell[StyleData["Title"], CellMargins->{{12, Inherited}, {20, 40}}, CellGroupingRules->{"TitleGrouping", 0}, PageBreakBelow->False, CounterIncrements->"Title", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}, { "Subtitle", 0}, {"Subsubtitle", 0}}, FontFamily->"Helvetica", FontSize->36, FontWeight->"Bold", FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Title", "Presentation"], CellMargins->{{24, 10}, {20, 40}}, LineSpacing->{1, 0}, FontSize->44], Cell[StyleData["Title", "Condensed"], CellMargins->{{8, 10}, {4, 8}}, FontSize->20], Cell[StyleData["Title", "Printout"], CellMargins->{{2, 10}, {12, 30}}, FontSize->24] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subtitle"], CellMargins->{{12, Inherited}, {20, 15}}, CellGroupingRules->{"TitleGrouping", 10}, PageBreakBelow->False, CounterIncrements->"Subtitle", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}, { "Subsubtitle", 0}}, FontFamily->"Helvetica", FontSize->24, FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Subtitle", "Presentation"], CellMargins->{{24, 10}, {20, 20}}, LineSpacing->{1, 0}, FontSize->36], Cell[StyleData["Subtitle", "Condensed"], CellMargins->{{8, 10}, {4, 4}}, FontSize->14], Cell[StyleData["Subtitle", "Printout"], CellMargins->{{2, 10}, {12, 8}}, FontSize->18] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subsubtitle"], CellMargins->{{12, Inherited}, {20, 15}}, CellGroupingRules->{"TitleGrouping", 20}, PageBreakBelow->False, CounterIncrements->"Subsubtitle", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}}, FontFamily->"Helvetica", FontSize->14, FontSlant->"Italic", FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Subsubtitle", "Presentation"], CellMargins->{{24, 10}, {20, 20}}, LineSpacing->{1, 0}, FontSize->24], Cell[StyleData["Subsubtitle", "Condensed"], CellMargins->{{8, 10}, {8, 8}}, FontSize->12], Cell[StyleData["Subsubtitle", "Printout"], CellMargins->{{2, 10}, {12, 8}}, FontSize->14] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Section"], CellDingbat->"\[FilledSquare]", CellMargins->{{25, Inherited}, {8, 24}}, CellGroupingRules->{"SectionGrouping", 30}, PageBreakBelow->False, CounterIncrements->"Section", CounterAssignments->{{"Subsection", 0}, {"Subsubsection", 0}}, FontFamily->"Helvetica", FontSize->16, FontWeight->"Bold", FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Section", "Presentation"], CellMargins->{{40, 10}, {11, 32}}, LineSpacing->{1, 0}, FontSize->24], Cell[StyleData["Section", "Condensed"], CellMargins->{{18, Inherited}, {6, 12}}, FontSize->12], Cell[StyleData["Section", "Printout"], CellMargins->{{13, 0}, {7, 22}}, FontSize->14] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subsection"], CellDingbat->"\[FilledSmallSquare]", CellMargins->{{22, Inherited}, {8, 20}}, CellGroupingRules->{"SectionGrouping", 40}, PageBreakBelow->False, CounterIncrements->"Subsection", CounterAssignments->{{"Subsubsection", 0}}, FontSize->14, FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], Cell[StyleData["Subsection", "Presentation"], CellMargins->{{36, 10}, {11, 32}}, LineSpacing->{1, 0}, FontSize->22], Cell[StyleData["Subsection", "Condensed"], CellMargins->{{16, Inherited}, {6, 12}}, FontSize->12], Cell[StyleData["Subsection", "Printout"], CellMargins->{{9, 0}, {7, 22}}, FontSize->12] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Subsubsection"], CellDingbat->"\[FilledSmallSquare]", CellMargins->{{22, Inherited}, {8, 18}}, CellGroupingRules->{"SectionGrouping", 50}, PageBreakBelow->False, CounterIncrements->"Subsubsection", FontWeight->"Bold", FontColor->RGBColor[1, 0, 1]], Cell[StyleData["Subsubsection", "Presentation"], CellMargins->{{34, 10}, {11, 26}}, LineSpacing->{1, 0}, FontSize->18], Cell[StyleData["Subsubsection", "Condensed"], CellMargins->{{17, Inherited}, {6, 12}}, FontSize->10], Cell[StyleData["Subsubsection", "Printout"], CellMargins->{{9, 0}, {7, 14}}, FontSize->11] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Body Text", "Section"], Cell[CellGroupData[{ Cell[StyleData["Text"], CellMargins->{{12, 10}, {7, 7}}, LineSpacing->{1, 3}, CounterIncrements->"Text", FontSize->14], Cell[StyleData["Text", "Presentation"], CellMargins->{{24, 10}, {10, 10}}, LineSpacing->{1, 5}], Cell[StyleData["Text", "Condensed"], CellMargins->{{8, 10}, {6, 6}}, LineSpacing->{1, 1}], Cell[StyleData["Text", "Printout"], CellMargins->{{2, 2}, {6, 6}}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["SmallText"], CellMargins->{{12, 10}, {6, 6}}, LineSpacing->{1, 3}, CounterIncrements->"SmallText", FontFamily->"Helvetica", FontSize->9], Cell[StyleData["SmallText", "Presentation"], CellMargins->{{24, 10}, {8, 8}}, LineSpacing->{1, 5}, FontSize->12], Cell[StyleData["SmallText", "Condensed"], CellMargins->{{8, 10}, {5, 5}}, LineSpacing->{1, 2}, FontSize->9], Cell[StyleData["SmallText", "Printout"], CellMargins->{{2, 2}, {5, 5}}, FontSize->7] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Input/Output", "Section"], Cell["\<\ The cells in this section define styles used for input and output \ to the kernel. Be careful when modifying, renaming, or removing these \ styles, because the front end associates special meanings with these style \ names. Some attributes for these styles are actually set in FormatType Styles \ (in the last section of this stylesheet). \ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["Input"], CellMargins->{{45, 10}, {5, 7}}, Evaluatable->True, CellGroupingRules->"InputGrouping", PageBreakWithin->False, GroupPageBreakWithin->False, CellLabelMargins->{{11, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultInputFormatType, AutoItalicWords->{}, FormatType->InputForm, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", FontWeight->"Bold"], Cell[StyleData["Input", "Presentation"], CellMargins->{{72, Inherited}, {8, 10}}, LineSpacing->{1, 0}], Cell[StyleData["Input", "Condensed"], CellMargins->{{40, 10}, {2, 3}}], Cell[StyleData["Input", "Printout"], CellMargins->{{39, 0}, {4, 6}}, FontSize->9] }, Closed]], Cell[StyleData["InputOnly"], Evaluatable->True, CellGroupingRules->"InputGrouping", DefaultFormatType->DefaultInputFormatType, AutoItalicWords->{}, FormatType->InputForm, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", StyleMenuListing->None, FontWeight->"Bold"], Cell[CellGroupData[{ Cell[StyleData["Output"], CellMargins->{{47, 10}, {7, 5}}, CellEditDuplicate->True, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, CellLabelMargins->{{11, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Output"], Cell[StyleData["Output", "Presentation"], CellMargins->{{72, Inherited}, {10, 8}}, LineSpacing->{1, 0}], Cell[StyleData["Output", "Condensed"], CellMargins->{{41, Inherited}, {3, 2}}], Cell[StyleData["Output", "Printout"], CellMargins->{{39, 0}, {6, 4}}, FontSize->9] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Message"], CellMargins->{{45, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"OutputGrouping", PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, CellLabelMargins->{{11, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Message", StyleMenuListing->None, FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Message", "Presentation"], CellMargins->{{72, Inherited}, {Inherited, Inherited}}, LineSpacing->{1, 0}], Cell[StyleData["Message", "Condensed"], CellMargins->{{41, Inherited}, {Inherited, Inherited}}], Cell[StyleData["Message", "Printout"], CellMargins->{{39, Inherited}, {Inherited, Inherited}}, FontSize->8, FontColor->GrayLevel[0]] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Print"], CellMargins->{{45, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"OutputGrouping", PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, CellLabelMargins->{{11, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Print", StyleMenuListing->None], Cell[StyleData["Print", "Presentation"], CellMargins->{{72, Inherited}, {Inherited, Inherited}}, LineSpacing->{1, 0}], Cell[StyleData["Print", "Condensed"], CellMargins->{{41, Inherited}, {Inherited, Inherited}}], Cell[StyleData["Print", "Printout"], CellMargins->{{39, Inherited}, {Inherited, Inherited}}, FontSize->8] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Graphics"], CellMargins->{{4, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"GraphicsGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, DefaultFormatType->DefaultOutputFormatType, FormatType->InputForm, CounterIncrements->"Graphics", ImageMargins->{{43, Inherited}, {Inherited, 0}}, StyleMenuListing->None], Cell[StyleData["Graphics", "Presentation"], ImageMargins->{{62, Inherited}, {Inherited, 0}}], Cell[StyleData["Graphics", "Condensed"], ImageMargins->{{38, Inherited}, {Inherited, 0}}, Magnification->0.6], Cell[StyleData["Graphics", "Printout"], ImageMargins->{{30, Inherited}, {Inherited, 0}}, FontSize->9, Magnification->0.8] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["CellLabel"], StyleMenuListing->None, FontFamily->"Helvetica", FontSize->9, FontColor->RGBColor[0, 0, 1]], Cell[StyleData["CellLabel", "Presentation"], FontSize->12], Cell[StyleData["CellLabel", "Condensed"], FontSize->9], Cell[StyleData["CellLabel", "Printout"], FontFamily->"Courier", FontSize->8, FontSlant->"Italic", FontColor->GrayLevel[0]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Formulas and Programming", "Section"], Cell[CellGroupData[{ Cell[StyleData["InlineFormula"], CellMargins->{{10, 4}, {0, 8}}, CellHorizontalScrolling->True, ScriptLevel->1, SingleLetterItalics->True], Cell[StyleData["InlineFormula", "Presentation"], CellMargins->{{24, 10}, {10, 10}}, LineSpacing->{1, 5}], Cell[StyleData["InlineFormula", "Condensed"], CellMargins->{{8, 10}, {6, 6}}, LineSpacing->{1, 1}], Cell[StyleData["InlineFormula", "Printout"], CellMargins->{{2, 0}, {6, 6}}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["DisplayFormula"], CellMargins->{{42, Inherited}, {Inherited, Inherited}}, CellHorizontalScrolling->True, DefaultFormatType->DefaultInputFormatType, ScriptLevel->0, SingleLetterItalics->True, UnderoverscriptBoxOptions->{LimitsPositioning->True}], Cell[StyleData["DisplayFormula", "Presentation"], LineSpacing->{1, 5}], Cell[StyleData["DisplayFormula", "Condensed"], LineSpacing->{1, 1}], Cell[StyleData["DisplayFormula", "Printout"]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Headers and Footers", "Section"], Cell[StyleData["Header"], CellMargins->{{0, 0}, {4, 1}}, StyleMenuListing->None, FontSize->10, FontSlant->"Italic"], Cell[StyleData["Footer"], CellMargins->{{0, 0}, {0, 4}}, StyleMenuListing->None, FontSize->9, FontSlant->"Italic"], Cell[StyleData["PageNumber"], CellMargins->{{0, 0}, {4, 1}}, StyleMenuListing->None, FontFamily->"Times", FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell["Palette Styles", "Section"], Cell["\<\ The cells below define styles that define standard \ ButtonFunctions, for use in palette buttons.\ \>", "Text"], Cell[StyleData["Paste"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`NotebookApply[ FrontEnd`InputNotebook[ ], #, After]}]&)}], Cell[StyleData["Evaluate"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`NotebookApply[ FrontEnd`InputNotebook[ ], #, All], SelectionEvaluate[ FrontEnd`InputNotebook[ ], All]}]&)}], Cell[StyleData["EvaluateCell"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`NotebookApply[ FrontEnd`InputNotebook[ ], #, All], FrontEnd`SelectionMove[ FrontEnd`InputNotebook[ ], All, Cell, 1], FrontEnd`SelectionEvaluateCreateCell[ FrontEnd`InputNotebook[ ], All]}]&)}], Cell[StyleData["CopyEvaluate"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`SelectionCreateCell[ FrontEnd`InputNotebook[ ], All], FrontEnd`NotebookApply[ FrontEnd`InputNotebook[ ], #, All], FrontEnd`SelectionEvaluate[ FrontEnd`InputNotebook[ ], All]}]&)}], Cell[StyleData["CopyEvaluateCell"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`SelectionCreateCell[ FrontEnd`InputNotebook[ ], All], FrontEnd`NotebookApply[ FrontEnd`InputNotebook[ ], #, All], FrontEnd`SelectionEvaluateCreateCell[ FrontEnd`InputNotebook[ ], All]}]&)}] }, Closed]], Cell[CellGroupData[{ Cell["Hyperlink Styles", "Section"], Cell["\<\ The cells below define styles useful for making hypertext \ ButtonBoxes. The \"Hyperlink\" style is for links within the same Notebook, \ or between Notebooks.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["Hyperlink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`NotebookLocate[ #2]}]&), Active->True, ButtonNote->ButtonData}], Cell[StyleData["Hyperlink", "Presentation"]], Cell[StyleData["Hyperlink", "Condensed"]], Cell[StyleData["Hyperlink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]], Cell["\<\ The following styles are for linking automatically to the on-line \ help system.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["MainBookLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "MainBook", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["MainBookLink", "Presentation"]], Cell[StyleData["MainBookLink", "Condensed"]], Cell[StyleData["MainBookLink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["AddOnsLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontFamily->"Courier", FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "AddOns", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["AddOnsLink", "Presentation"]], Cell[StyleData["AddOnsLink", "Condensed"]], Cell[StyleData["AddOnLink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["RefGuideLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontFamily->"Courier", FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "RefGuideLink", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["RefGuideLink", "Presentation"]], Cell[StyleData["RefGuideLink", "Condensed"]], Cell[StyleData["RefGuideLink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["GettingStartedLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "GettingStarted", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["GettingStartedLink", "Presentation"]], Cell[StyleData["GettingStartedLink", "Condensed"]], Cell[StyleData["GettingStartedLink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["OtherInformationLink"], StyleMenuListing->None, ButtonStyleMenuListing->Automatic, FontColor->RGBColor[0, 0, 1], FontVariations->{"Underline"->True}, ButtonBoxOptions->{ButtonFunction:>(FrontEndExecute[ { FrontEnd`HelpBrowserLookup[ "OtherInformation", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["OtherInformationLink", "Presentation"]], Cell[StyleData["OtherInformationLink", "Condensed"]], Cell[StyleData["OtherInformationLink", "Printout"], FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Placeholder Styles", "Section"], Cell["\<\ The cells below define styles useful for making placeholder \ objects in palette templates.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["Placeholder"], Editable->False, Selectable->False, StyleBoxAutoDelete->True, Placeholder->True, StyleMenuListing->None], Cell[StyleData["Placeholder", "Presentation"]], Cell[StyleData["Placeholder", "Condensed"]], Cell[StyleData["Placeholder", "Printout"]] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["SelectionPlaceholder"], Editable->False, Selectable->False, StyleBoxAutoDelete->True, StyleMenuListing->None, DrawHighlighted->True], Cell[StyleData["SelectionPlaceholder", "Presentation"]], Cell[StyleData["SelectionPlaceholder", "Condensed"]], Cell[StyleData["SelectionPlaceholder", "Printout"]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["FormatType Styles", "Section"], Cell["\<\ The cells below define styles that are mixed in with the styles \ of most cells. If a cell's FormatType matches the name of one of the styles \ defined below, then that style is applied between the cell's style and its \ own options. This is particularly true of Input and Output.\ \>", "Text"], Cell[StyleData["CellExpression"], PageWidth->Infinity, CellMargins->{{6, Inherited}, {Inherited, Inherited}}, ShowCellLabel->False, ShowSpecialCharacters->False, AllowInlineCells->False, AutoItalicWords->{}, StyleMenuListing->None, FontFamily->"Courier", FontSize->12, Background->GrayLevel[1]], Cell[StyleData["InputForm"], AllowInlineCells->False, StyleMenuListing->None, FontFamily->"Courier"], Cell[StyleData["OutputForm"], PageWidth->Infinity, TextAlignment->Left, LineSpacing->{0.6, 1}, StyleMenuListing->None, FontFamily->"Courier"], Cell[StyleData["StandardForm"], LineSpacing->{1.25, 0}, StyleMenuListing->None, FontFamily->"Courier"], Cell[StyleData["TraditionalForm"], LineSpacing->{1.25, 0}, SingleLetterItalics->True, TraditionalFunctionNotation->True, DelimiterMatching->None, StyleMenuListing->None], Cell["\<\ The style defined below is mixed in to any cell that is in an \ inline cell within another.\ \>", "Text"], Cell[StyleData["InlineCell"], TextAlignment->Left, ScriptLevel->1, StyleMenuListing->None], Cell[StyleData["InlineCellEditing"], StyleMenuListing->None, Background->RGBColor[1, 0.749996, 0.8]] }, Closed]] }, Open ]] }] ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 83, 2, 110, "Title", Evaluatable->False], Cell[1840, 55, 107, 3, 53, "Subsubtitle", Evaluatable->False], Cell[CellGroupData[{ Cell[1972, 62, 46, 0, 45, "Subsection"], Cell[2021, 64, 320, 8, 71, "Text"], Cell[2344, 74, 719, 14, 166, "Text"], Cell[3066, 90, 112, 4, 52, "Text"], Cell[3181, 96, 266, 10, 52, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[3484, 111, 87, 2, 29, "Subsection", Evaluatable->False], Cell[3574, 115, 230, 6, 52, "Text", Evaluatable->False], Cell[3807, 123, 303, 9, 52, "Text", Evaluatable->False], Cell[4113, 134, 106, 2, 33, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[4256, 141, 105, 2, 35, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[4386, 147, 88, 2, 45, "Subsection", Evaluatable->False], Cell[4477, 151, 985, 37, 71, "Text", Evaluatable->False], Cell[5465, 190, 53, 1, 27, "Input"], Cell[5521, 193, 59, 1, 27, "Input"], Cell[5583, 196, 63, 1, 27, "Input"], Cell[5649, 199, 304, 6, 71, "Text", Evaluatable->False], Cell[5956, 207, 65, 1, 27, "Input"], Cell[6024, 210, 377, 15, 33, "Text", Evaluatable->False], Cell[6404, 227, 67, 1, 27, "Input"], Cell[6474, 230, 449, 17, 52, "Text", Evaluatable->False], Cell[6926, 249, 52, 1, 27, "Input"], Cell[6981, 252, 76, 2, 33, "Text", Evaluatable->False], Cell[7060, 256, 52, 1, 27, "Input"], Cell[7115, 259, 577, 22, 52, "Text", Evaluatable->False], Cell[7695, 283, 175, 4, 52, "Text", Evaluatable->False], Cell[7873, 289, 70, 1, 27, "Input"], Cell[7946, 292, 63, 1, 27, "Input"], Cell[8012, 295, 48, 1, 27, "Input"], Cell[8063, 298, 1576, 62, 71, "Text", Evaluatable->False], Cell[9642, 362, 53, 1, 27, "Input"], Cell[9698, 365, 48, 1, 27, "Input"], Cell[9749, 368, 48, 1, 27, "Input"], Cell[9800, 371, 55, 1, 27, "Input"], Cell[9858, 374, 49, 1, 27, "Input"], Cell[9910, 377, 49, 1, 27, "Input"], Cell[9962, 380, 64, 1, 27, "Input"], Cell[10029, 383, 54, 1, 27, "Input"], Cell[10086, 386, 1072, 42, 52, "Text", Evaluatable->False], Cell[11161, 430, 53, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[11251, 436, 107, 2, 29, "Subsection", Evaluatable->False], Cell[11361, 440, 487, 14, 71, "Text", Evaluatable->False], Cell[11851, 456, 1539, 55, 109, "Text", Evaluatable->False], Cell[13393, 513, 72, 1, 27, "Input"], Cell[13468, 516, 584, 22, 33, "Text", Evaluatable->False], Cell[14055, 540, 47, 1, 27, "Input"], Cell[14105, 543, 397, 15, 33, "Text", Evaluatable->False], Cell[14505, 560, 1009, 36, 71, "Text", Evaluatable->False], Cell[15517, 598, 680, 26, 52, "Text", Evaluatable->False], Cell[16200, 626, 1197, 46, 53, "Text", Evaluatable->False], Cell[17400, 674, 1216, 48, 53, "Text", Evaluatable->False], Cell[18619, 724, 399, 15, 33, "Text", Evaluatable->False], Cell[19021, 741, 108, 6, 72, "Input"], Cell[19132, 749, 1182, 42, 71, "Text", Evaluatable->False], Cell[20317, 793, 73, 1, 27, "Input"], Cell[20393, 796, 474, 17, 52, "Text", Evaluatable->False], Cell[20870, 815, 39, 1, 27, "Input"], Cell[20912, 818, 1258, 47, 71, "Text", Evaluatable->False], Cell[22173, 867, 54, 1, 27, "Input"], Cell[22230, 870, 525, 22, 34, "Text", Evaluatable->False], Cell[22758, 894, 50, 1, 27, "Input"], Cell[22811, 897, 155, 7, 33, "Text", Evaluatable->False], Cell[22969, 906, 47, 1, 27, "Input"], Cell[23019, 909, 393, 15, 33, "Text", Evaluatable->False], Cell[23415, 926, 45, 1, 27, "Input"], Cell[23463, 929, 880, 34, 52, "Text", Evaluatable->False], Cell[24346, 965, 51, 1, 27, "Input"], Cell[24400, 968, 45, 1, 27, "Input"], Cell[24448, 971, 98, 2, 33, "Text", Evaluatable->False], Cell[24549, 975, 51, 1, 27, "Input"], Cell[24603, 978, 45, 1, 27, "Input"], Cell[24651, 981, 885, 33, 53, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[25573, 1019, 107, 2, 29, "Subsection", Evaluatable->False], Cell[25683, 1023, 478, 17, 33, "Text", Evaluatable->False], Cell[26164, 1042, 1008, 30, 128, "Text", Evaluatable->False], Cell[27175, 1074, 2810, 104, 128, "Text", Evaluatable->False], Cell[29988, 1180, 525, 21, 24, "Print", Evaluatable->False], Cell[30516, 1203, 2006, 77, 72, "Text", Evaluatable->False], Cell[32525, 1282, 61, 1, 27, "Input"], Cell[32589, 1285, 63, 1, 27, "Input"], Cell[32655, 1288, 67, 1, 27, "Input"], Cell[32725, 1291, 1473, 56, 71, "Text", Evaluatable->False], Cell[34201, 1349, 485, 17, 52, "Text", Evaluatable->False], Cell[34689, 1368, 96, 1, 27, "Input"], Cell[34788, 1371, 180, 4, 52, "Text", Evaluatable->False], Cell[34971, 1377, 69, 1, 27, "Input"], Cell[35043, 1380, 68, 1, 27, "Input"], Cell[35114, 1383, 190, 4, 52, "Text", Evaluatable->False], Cell[35307, 1389, 66, 1, 27, "Input"], Cell[35376, 1392, 1388, 51, 77, "Text", Evaluatable->False], Cell[36767, 1445, 55, 1, 27, "Input"], Cell[36825, 1448, 596, 22, 53, "Text", Evaluatable->False], Cell[37424, 1472, 67, 1, 27, "Input"], Cell[37494, 1475, 98, 1, 27, "Input"], Cell[37595, 1478, 791, 26, 90, "Text", Evaluatable->False], Cell[38389, 1506, 73, 1, 27, "Input"], Cell[38465, 1509, 517, 16, 71, "Text", Evaluatable->False], Cell[38985, 1527, 56, 1, 27, "Input"], Cell[39044, 1530, 1270, 44, 90, "Text", Evaluatable->False], Cell[40317, 1576, 1040, 37, 73, "Text", Evaluatable->False], Cell[41360, 1615, 88, 1, 27, "Input"], Cell[41451, 1618, 796, 27, 71, "Text", Evaluatable->False], Cell[42250, 1647, 88, 1, 27, "Input"], Cell[42341, 1650, 1304, 50, 71, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[43682, 1705, 89, 2, 29, "Subsection", Evaluatable->False], Cell[43774, 1709, 470, 17, 52, "Text", Evaluatable->False], Cell[44247, 1728, 1553, 56, 109, "Text", Evaluatable->False] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[45849, 1790, 118, 2, 35, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[45992, 1796, 92, 2, 45, "Subsection", Evaluatable->False], Cell[46087, 1800, 936, 34, 71, "Text", Evaluatable->False], Cell[47026, 1836, 66, 1, 27, "Input"], Cell[47095, 1839, 126, 2, 33, "Text", Evaluatable->False], Cell[47224, 1843, 49, 1, 27, "Input"], Cell[47276, 1846, 99, 2, 33, "Text", Evaluatable->False], Cell[47378, 1850, 50, 1, 27, "Input"], Cell[47431, 1853, 407, 15, 33, "Text", Evaluatable->False], Cell[47841, 1870, 989, 36, 71, "Text", Evaluatable->False], Cell[48833, 1908, 54, 1, 27, "Input"], Cell[48890, 1911, 52, 1, 27, "Input"], Cell[48945, 1914, 54, 1, 27, "Input"], Cell[49002, 1917, 52, 1, 27, "Input"], Cell[49057, 1920, 243, 5, 52, "Text", Evaluatable->False], Cell[49303, 1927, 48, 1, 27, "Input"], Cell[49354, 1930, 107, 2, 33, "Text", Evaluatable->False], Cell[49464, 1934, 48, 1, 27, "Input"], Cell[49515, 1937, 1631, 61, 90, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[51183, 2003, 93, 2, 29, "Subsection", Evaluatable->False], Cell[51279, 2007, 899, 33, 52, "Text", Evaluatable->False], Cell[52181, 2042, 59, 1, 27, "Input"], Cell[52243, 2045, 129, 3, 33, "Text", Evaluatable->False], Cell[52375, 2050, 48, 1, 27, "Input"], Cell[52426, 2053, 371, 6, 90, "Text", Evaluatable->False], Cell[52800, 2061, 81, 1, 27, "Input"], Cell[52884, 2064, 2149, 76, 128, "Text", Evaluatable->False], Cell[55036, 2142, 621, 16, 90, "Text", Evaluatable->False], Cell[55660, 2160, 52, 1, 27, "Input"], Cell[55715, 2163, 1009, 36, 90, "Text", Evaluatable->False], Cell[56727, 2201, 123, 2, 33, "Text", Evaluatable->False], Cell[56853, 2205, 52, 1, 27, "Input"], Cell[56908, 2208, 875, 32, 52, "Text", Evaluatable->False], Cell[57786, 2242, 867, 33, 52, "Text", Evaluatable->False], Cell[58656, 2277, 56, 1, 27, "Input"], Cell[58715, 2280, 676, 20, 90, "Text", Evaluatable->False], Cell[59394, 2302, 53, 1, 27, "Input"], Cell[59450, 2305, 126, 2, 33, "Text", Evaluatable->False], Cell[59579, 2309, 45, 1, 27, "Input"], Cell[59627, 2312, 45, 1, 27, "Input"], Cell[59675, 2315, 165, 4, 52, "Text", Evaluatable->False], Cell[59843, 2321, 1591, 60, 72, "Text", Evaluatable->False], Cell[61437, 2383, 443, 17, 52, "Text", Evaluatable->False], Cell[61883, 2402, 48, 1, 27, "Input"], Cell[61934, 2405, 48, 1, 27, "Input"], Cell[61985, 2408, 116, 2, 33, "Text", Evaluatable->False], Cell[62104, 2412, 55, 1, 27, "Input"], Cell[62162, 2415, 49, 1, 27, "Input"], Cell[62214, 2418, 49, 1, 27, "Input"], Cell[62266, 2421, 1501, 54, 129, "Text", Evaluatable->False], Cell[63770, 2477, 259, 5, 71, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[64066, 2487, 93, 2, 29, "Subsection", Evaluatable->False], Cell[64162, 2491, 686, 19, 90, "Text", Evaluatable->False], Cell[64851, 2512, 215, 6, 72, "Input"], Cell[65069, 2520, 980, 37, 53, "Text", Evaluatable->False], Cell[66052, 2559, 59, 1, 27, "Input"], Cell[66114, 2562, 66, 1, 27, "Input"], Cell[66183, 2565, 84, 1, 27, "Input"], Cell[66270, 2568, 300, 7, 71, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[66595, 2579, 104, 2, 42, "Subsubsection", Evaluatable->False], Cell[66702, 2583, 505, 17, 52, "Text", Evaluatable->False], Cell[67210, 2602, 91, 1, 27, "Input"], Cell[67304, 2605, 83, 1, 27, "Input"], Cell[67390, 2608, 89, 1, 27, "Input"], Cell[67482, 2611, 959, 29, 109, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[68478, 2645, 116, 2, 28, "Subsubsection", Evaluatable->False], Cell[68597, 2649, 159, 4, 33, "Text", Evaluatable->False], Cell[68759, 2655, 74, 1, 23, "DisplayFormula"], Cell[68836, 2658, 77, 1, 23, "DisplayFormula"], Cell[68916, 2661, 707, 24, 71, "Text", Evaluatable->False], Cell[69626, 2687, 97, 1, 27, "Input"], Cell[69726, 2690, 122, 4, 42, "Input"], Cell[69851, 2696, 141, 4, 42, "Input"], Cell[69995, 2702, 138, 3, 33, "Text", Evaluatable->False], Cell[70136, 2707, 75, 1, 27, "DisplayFormula"], Cell[70214, 2710, 86, 2, 33, "Text", Evaluatable->False], Cell[70303, 2714, 78, 1, 27, "Input"], Cell[70384, 2717, 80, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[70501, 2723, 93, 2, 28, "Subsubsection", Evaluatable->False], Cell[70597, 2727, 251, 9, 33, "Text", Evaluatable->False], Cell[70851, 2738, 64, 1, 27, "Input"], Cell[70918, 2741, 64, 1, 27, "Input"], Cell[70985, 2744, 208, 7, 33, "Text", Evaluatable->False], Cell[71196, 2753, 111, 2, 33, "Text", Evaluatable->False] }, Closed]], Cell[71322, 2758, 461, 16, 49, "Text", Evaluatable->False], Cell[71786, 2776, 70, 1, 27, "Input"], Cell[71859, 2779, 1086, 38, 90, "Text", Evaluatable->False], Cell[72948, 2819, 80, 1, 27, "Input"], Cell[73031, 2822, 83, 1, 27, "Input"], Cell[73117, 2825, 670, 24, 52, "Text", Evaluatable->False], Cell[73790, 2851, 84, 1, 27, "Input"], Cell[73877, 2854, 428, 15, 33, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[74342, 2874, 89, 2, 29, "Subsection", Evaluatable->False], Cell[74434, 2878, 2818, 100, 167, "Text", Evaluatable->False], Cell[77255, 2980, 63, 1, 27, "Input"], Cell[77321, 2983, 86, 1, 27, "Input"], Cell[77410, 2986, 76, 1, 27, "Input"], Cell[77489, 2989, 61, 1, 27, "Input"], Cell[77553, 2992, 74, 1, 27, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[77676, 2999, 92, 2, 35, "Section", Evaluatable->False], Cell[77771, 3003, 415, 7, 109, "Text", Evaluatable->False], Cell[78189, 3012, 416, 7, 328, "Info", Evaluatable->False], Cell[78608, 3021, 203, 4, 52, "Text", Evaluatable->False], Cell[78814, 3027, 46, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[78897, 3033, 92, 2, 35, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[79014, 3039, 90, 2, 45, "Subsection", Evaluatable->False], Cell[79107, 3043, 649, 19, 90, "Text", Evaluatable->False], Cell[79759, 3064, 303, 13, 177, "Input"], Cell[80065, 3079, 82, 2, 33, "Text", Evaluatable->False], Cell[80150, 3083, 69, 1, 27, "Input"], Cell[80222, 3086, 520, 17, 52, "Text", Evaluatable->False], Cell[80745, 3105, 437, 17, 33, "Text", Evaluatable->False], Cell[81185, 3124, 101, 4, 42, "Input"], Cell[81289, 3130, 1428, 49, 128, "Text", Evaluatable->False], Cell[82720, 3181, 47, 1, 27, "Input"], Cell[82770, 3184, 63, 1, 27, "Input"], Cell[82836, 3187, 56, 1, 27, "Input"], Cell[82895, 3190, 59, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[82991, 3196, 89, 2, 29, "Subsection", Evaluatable->False], Cell[83083, 3200, 721, 26, 52, "Text", Evaluatable->False], Cell[83807, 3228, 993, 37, 71, "Text", Evaluatable->False] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[84849, 3271, 106, 2, 35, "Section", Evaluatable->False], Cell[84958, 3275, 143, 5, 33, "Text", Evaluatable->False], Cell[85104, 3282, 586, 19, 71, "Text", Evaluatable->False], Cell[85693, 3303, 87, 2, 23, "Print", Evaluatable->False], Cell[85783, 3307, 927, 34, 71, "Text", Evaluatable->False], Cell[86713, 3343, 2419, 88, 128, "Text", Evaluatable->False], Cell[89135, 3433, 1391, 48, 128, "Text", Evaluatable->False], Cell[90529, 3483, 2225, 88, 71, "Text", Evaluatable->False], Cell[92757, 3573, 446, 8, 155, "Input"], Cell[93206, 3583, 25, 0, 33, "Text"], Cell[93234, 3585, 58, 1, 27, "Input"], Cell[93295, 3588, 59, 1, 27, "Input"], Cell[93357, 3591, 53, 1, 27, "Input"], Cell[93413, 3594, 1169, 42, 90, "Text", Evaluatable->False], Cell[94585, 3638, 954, 29, 109, "Text", Evaluatable->False], Cell[95542, 3669, 329, 11, 102, "Input"], Cell[95874, 3682, 459, 16, 52, "Text", Evaluatable->False] }, Closed]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)