(************** 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[ 115882, 4497]*) (*NotebookOutlinePosition[ 151575, 5721]*) (* CellTagsIndexPosition[ 151531, 5717]*) (*WindowFrame->Normal*) Notebook[{ Cell["Legendre Polynomials and Functions", "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"], " notebooks by Richard Palmer." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Preface", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "This Notebook concerns mainly the Legendre polynomials P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x). It also treats the Legendre functions of the second kind Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x), and discusses Chebyshev polynomials briefly. Associated Legendre \ functions are ", StyleBox["not", FontSlant->"Italic"], " covered here; they're in the Spherical Harmonics Notebook." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "A secondary purpose of this Notebook is further exploration of several \ important Mathematica operators and idioms, including especially ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", ", StyleBox["/;", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", ", StyleBox["Normal[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", and saving intermediate results." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "I have used the notation P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) instead of P", StyleBox["l", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) because letter l's look too much like digit 1's. There are a lot of \ subscripts and superscripts in this notebook, so I recommend using it only on \ Mathematica platforms that treat these properly. If you're seeing things \ like Pn(x), without n being subscripted, you're not on a such a platform and \ may have trouble later." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ There are 4 problems embedded in the text, mainly related to \ Chebyshev polynomials.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Exploring LegendreP[]", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Explicit Form", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Mathematica uses ", StyleBox["LegendreP[n, x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for the n", StyleBox["th", FontVariations->{"CompatibilityType"->"Superscript"}], " Legendre Polynomial P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x), where n is a non-negative integer (0, 1, 2, ...). For example:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["LegendreP[3, x]", "Input", AspectRatioFixed->True], Cell["LegendreP[10, x]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Let's use ", StyleBox["Table[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " to make a list of them up to n = 6: " }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Table[LegendreP[n, x], {n, 0, 6}]", "Input", AspectRatioFixed->True], Cell[TextData[{ "That would be clearer with ", StyleBox["//ColumnForm", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", which displays a list in an aligned column:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["%//ColumnForm", "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["//ColumnForm", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", ", StyleBox["//TableForm", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", and ", StyleBox["//MatrixForm", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " all do much the same thing for a simple list, though the spacing varies a \ bit. For nested lists (including matrices) they behave quite differently." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "In any case, we see that P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) is a polynomial of order n in x. We also see immediately that it's an \ even polynomial if n is even, and an odd polynomial if n is odd. This \ obviously makes it an even or odd function:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[Cell[BoxData[ \(TraditionalForm \`\(P\_n\)(\(-x\))\ = \ \(\((\(-1\))\)\^n\) \(\(P\_n\)(x)\)\)]]], "InlineFormula", FontSize->17], Cell[TextData[{ "and also implies that P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(0) = 0 if n is odd." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "In physics, the argument x is usually cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], ", where ", StyleBox["\[Theta]", FontFamily->"Symbol"], " is the angle from the z axis in spherical polar coordinates. We can of \ course write out the series in terms of cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], ", as in" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["LegendreP[8,Cos[\[Theta]]]"], "Input", AspectRatioFixed->True], Cell[TextData[{ "This suggests all sorts of possible trig substitutions, the most \ interesting of which is to write everything in terms of cos n", StyleBox["\[Theta]", FontFamily->"Symbol"], " instead of (cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], ")^n. Mathematica makes that very easy with ", StyleBox["TrigReduce[]:", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["TrigReduce[%]", "Input", AspectRatioFixed->True], Cell[TextData[{ "The interesting thing about this is that ", StyleBox["all the coefficients are positive", FontSlant->"Italic"], ". And this is generally true; here are the first 6 in this multiple-angle \ form:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "Table[TrigReduce[LegendreP[n, Cos[\[Theta]]]],{n, 0, 6}] //ColumnForm"], "Input", AspectRatioFixed->True], Cell[TextData[{ "One immediate consequence (why?) of this is that |P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], ")| ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(1) = 1 for all ", StyleBox["\[Theta]", FontFamily->"Symbol"], ", corresponding to the bound" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " |P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)| ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " 1 for -1 ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " x ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " 1" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Of course to ", StyleBox["prove", FontSlant->"Italic"], " this bound we'd need to ", StyleBox["prove", FontSlant->"Italic"], " that all the above coefficients are positive. Arfken & Weber does that \ (from the generating function)." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Plot? Not!", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Let's make a picture of P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) against x for n = 0, 1, ... 6. The conventional domain on which to \ evaluate P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) is from -1 to 1, so that's what we'll use. First let's try the \ obvious approach, giving ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " a list produced as before:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Plot[Table[LegendreP[n, x], {n, 0, 6}], {x, -1, 1}]", "Input", AspectRatioFixed->True], Cell[TextData[{ "That's not right! What went wrong? The following subsection discusses \ this in detail; you can skip it if you know the answer (use ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "), ", StyleBox["and know when and why it applies", FontSlant->"Italic"], "." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Evaluate[]", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "First look at the definition of ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ":" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["?Plot", "Input", AspectRatioFixed->True], Cell[TextData[{ "So it looks as though it's OK to use a list of functions for the first \ argument, and ", StyleBox["Table[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " does produce such a list, as we saw earlier. Indeed, an ", StyleBox["explicit", FontSlant->"Italic"], " list does work:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Plot[{LegendreP[3,x], LegendreP[10,x]}, {x,-1,1}]", "Input", AspectRatioFixed->True], Cell[TextData[{ "So if ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " accepts a list, and ", StyleBox["Table[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " produces one, what's wrong with ", StyleBox["Plot[Table[...],...]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "? The error messages say something about the ", StyleBox["Table[]", FontFamily->"Courier", FontWeight->"Bold"], " not being a machine-size real number at each successive value of x. The \ trouble is that:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "1. ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " initially sees only a ", StyleBox["single", FontSlant->"Italic"], " function ", StyleBox["Table[...]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " as its first argument, so it uses the algorithms for the single-function \ case; but" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "2. evaluating this function at a particular value of x gives a ", StyleBox["list", FontSlant->"Italic"], " of real numbers, not just one." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "At that point (for each value of x in fact), ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " complains that its first argument is not producing a single real number." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "More technically, in step 1, ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " looks at the ", StyleBox["Head", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " of its first argument, and switches into single function mode or \ multi-function mode depending on whether or not the head is ", StyleBox["List", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The solution is to make sure that the ", StyleBox["Table[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " is evaluated before ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " gets to look at it, thus changing step 1. ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " will then see a list from the start. Then step 2 will be OK; ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " ", StyleBox["will", FontSlant->"Italic"], " be expecting a list of real numbers when it evaluates its first argument \ at each x. It'll also be more efficient, since we'll only do the list-making \ once, instead of once for each x." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We can achieve this by wrapping ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " around the ", StyleBox["Table[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", telling Mathematica to evaluate it as soon as it sees it, before \ evaluating the ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " function itself. Thus we'll use" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Plot[Evaluate[Table[...]],...]", "Print", Evaluatable->False, AspectRatioFixed->True], Cell["which is actually a pretty common Mathematica idiom.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Most", FontSlant->"Italic"], " functions evaluate their arguments before themselves in any case, but ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " is an exception, to allow for plotting a function that only makes sense \ for numerical values. This is implemented by giving ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " the ", StyleBox["HoldAll", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " attribute, as can be seen in the ", StyleBox["Attributes[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " part of the following:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["??Plot", "Input", AspectRatioFixed->True], Cell["You could also ask just for the Attributes part of this with", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Attributes[Plot]", "Input", AspectRatioFixed->True], Cell[TextData[{ "In any case, using ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " overrules the effect of ", StyleBox["HoldAll", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", thus evaluating ", StyleBox["Table[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " before ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "OK, so ", StyleBox["when", FontSlant->"Italic"], " should we use ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " in the first argument of ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "? The simple answer is ", StyleBox["whenever possible", FontSlant->"Italic"], ". More specifically: " }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "1. It ", StyleBox["must", FontSlant->"Italic"], " be used if the first argument evaluates to a list, as above." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "2. It ", StyleBox["must not", FontSlant->"Italic"], " be used if the first argument only makes sense, or can only be evaluated, \ for ", StyleBox["numerical", FontSlant->"Italic"], " values of the independent variable. For example" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Plot[y /. FindRoot[Exp[-y]==x*y, {y,1}], {x,1,2}]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Here the construction ", StyleBox["y /. FindRoot[...]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " gives the value of y where the equation ", StyleBox["Exp[-y] = x*y", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " is satisfied, but only if x has a defined numerical value. Putting ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " around it would give an error." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "3. In almost all other cases using ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " will speed things up somewhat, and will sometimes make a gigantic speed \ difference. This is because it does an initial evaluation for ", StyleBox["symbolic", FontSlant->"Italic"], " x, then ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " ", StyleBox["compiles", FontSlant->"Italic"], " the function if possible (to make it evaluate quickly), and evaluates the \ compiled function for each particular value of x. The initial evaluation is \ done once only, instead of for each x, and can often make compilation \ possible when it wouldn't be otherwise. It's particularly important when \ plotting a function that you yourself defined. For example" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ myfunction[x_] := ... Plot[Evaluate[myfunction[x]], ...]\ \>", "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Without the ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " would not be able to compile ", StyleBox["myfunction", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "; it would try (and fail) to compile ", StyleBox["myfunction", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " itself, as opposed to compiling the right-hand side of ", StyleBox["myfunction", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "'s definition. It still works without the ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", but is slower." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Section 2.5.5 of the Mathematica book discusses ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " and ", StyleBox["HoldAll", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " in more detail, along with other ways to control just when an argument \ does or does not get evaluated." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The idiom ", StyleBox["Plot[Evaluate[...],...]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " is so common that I sometimes define a special version of ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " to do it:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ SetAttributes[ePlot,HoldAll] ePlot[fun_,range_,opts___] := Plot[Evaluate[fun],range,opts];\ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ "(Ignore the spelling warning). Now you can use ", StyleBox["ePlot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " just like ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " whenever you want an ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " around the first argument. Note that I gave ", StyleBox["ePlot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " the ", StyleBox["HoldAll", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " attribute so that it doesn't try to evaluate its second and third \ arguments (the first wouldn't matter, since we're overriding ", StyleBox["HoldAll", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " with ", StyleBox["Evaluate", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " anyway). It's important to set some attributes, including ", StyleBox["HoldAll", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", ", StyleBox["before", FontSlant->"Italic"], " defining the function to which they pertain. Also note the \ \"triple-blank\" pattern ", StyleBox["opts___", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " used to pass on any optional arguments." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "I won't use ", StyleBox["ePlot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " in what follows, because some people might have skipped all this, \ thinking they knew all about ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " already. Of course we could trick them now. But that wouldn't be nice." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Plots", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ OK, so let's get back to Legendre polythings. What we need to use \ is\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Plot[Evaluate[Table[LegendreP[n, x], {n, 0, 6}]], \t {x, -1, 1}]\ \>", "Input", AspectRatioFixed->True], Cell["Note the following:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "1. The first few curves are obvious: P", StyleBox["0", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) = 1, P", StyleBox["1", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) = x,\n P", StyleBox["2", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) = (3x", StyleBox["2", FontVariations->{"CompatibilityType"->"Superscript"}], "-1)/2, etc." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "2. All curves go to 1 at x = 1. Indeed P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(1) = 1 is an identity." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "3. At x = -1 we get either +1 or -1: P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) = (-1)", StyleBox["n", FontVariations->{"CompatibilityType"->"Superscript"}], ". This also follows immediately from (2) and the even/odd property of P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) itself." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ 4. At x = 0 we get 0 for the odd ones, and alternately a positive \ or negative value for the even ones. We'll figure out the magnitude later \ on.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "5. P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) lies between -1 and +1: | P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) | ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " 1 for -1 ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " x ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " 1." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Actually, we don't have to restrict ourselves to the domain [-1, 1] --- \ they're just polynomials after all:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Plot[Evaluate[Table[LegendreP[n, x], {n, 0, 6}]], \t {x, -2, 2}]\ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ "Notice however, that the P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)'s grow pretty large pretty quickly outside the [-1, 1] domain, \ especially for large n. Adding ", StyleBox["PlotRange->All", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " shows just how big they grow, though our own favorite wiggles pale into \ insignificance by contrast:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Show[%, PlotRange->All]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Similarly we could evaluate the P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)'s for complex x. Since they're polynomials, they're entire functions \ (analytic everywhere)." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "But neither of these extensions is of much practical use in physics or \ engineering, because the normal application of P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) is to the solution of PDE's (Laplace's equation etc.) in spherical (r, \ ", StyleBox["\[Theta]", FontFamily->"Symbol"], ", ", StyleBox["\[Phi]", FontFamily->"Symbol"], ") coordinates with\n\n(a) No ", StyleBox["\[Phi]", FontFamily->"Symbol"], " dependence (rotational symmetry around the z axis), and\n\n(b) x = cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], ", with 0 ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " ", StyleBox["\[Theta]", FontFamily->"Symbol"], " ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " ", StyleBox["\[Pi]", FontFamily->"Symbol"], ".\n\nThus we are normally only interested in the [-1, 1] domain." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "In fact, a more relevant plot for physics or engineering is of P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], ") versus ", StyleBox["\[Theta]", FontFamily->"Symbol"], ":" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "Plot[Evaluate[Table[LegendreP[n, Cos[\[Theta]]],\n \t\t\t\t\t{n, 0, 6}]],\n \ \t {\[Theta], 0, \[Pi]}]"], "Input", AspectRatioFixed->True], Cell["\<\ But this doesn't actually look so much different from the plot \ against x, except for the n = 1 case (obviously no longer a straight line) \ and the left-right reversal (x = 1 is now on the left).\ \>", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Problem 1", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The Chebyshev polynomials T", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) are another set of orthogonal polynomials similar in many ways to the \ Legendre polynomials. They're much used in making numerical approximations, \ but otherwise have less application in physics. Mathematica knows them as ", StyleBox["ChebyshevT[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". Officially these are called Chebyshev polynomials of the first kind, \ but the other (second) kind is rarely used at all." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "List the first few Chebyshev polynomials as functions of x, and also as \ functions of ", StyleBox["\[Theta]", FontFamily->"Symbol"], " with x = cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], ", using the multiple-angle form just as for the Legendre polynomials." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The multiple-angle form should be extremely simple, and provides a simple \ way to define T", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x); give a definition involving arccos(x). (You don't need to make this \ into a working Mathematica function yet; that's part of problem 2.)" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Plot a set of Chebyshev polynomials together in one picture, as we did for \ the Legendre polynomials, either against x or against ", StyleBox["\[Theta]", FontFamily->"Symbol"], ". Note what happens at the point x = -0.5 (", StyleBox["\[Theta]", FontFamily->"Symbol"], " = 2", StyleBox["\[Pi]/3).", FontFamily->"Symbol"] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Comment on the order, parity (odd/even), and bounds of T", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Defining our own P[n,x]", "Section", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ This section is mainly concerned with Mathematica issues related to \ defining functions with side conditions and functions that need local dummy \ variables.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Rodrigues' Formula", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Until now we've just taken the Legendre polynomials to be those given by \ Mathematica's ", StyleBox["LegendreP[n, x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "; we haven't really defined them. Defining them as \"whatever Mathematica \ says they are\" is hardly satisfactory." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "There are actually many different ways to define P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x), including:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ a. As solutions to the Legendre differential equation with certain \ boundary conditions.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["b. From explicit expressions for the coefficients.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["c. From Rodrigues' formula.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ d. From an integral representation (e.g. Schl\[ADoubleDot]fli's, or \ Laplace's).\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["e. From the generating function.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "f. From the expansion of 1 / | ", StyleBox["r", FontWeight->"Bold"], " - ", StyleBox["s", FontWeight->"Bold"], " | (equivalent to e)." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["g. From recurrence relations.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ One of the most generally useful is (c), Rodrigues' formula:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[Cell[BoxData[ FormBox[ RowBox[{ FormBox[ \(\(P\_n\)(x)\ = \(\ 1\)\/\(\(2\^n\) \(n!\)\)\ d\^n\/\(dx\^n\ \)\), "TraditionalForm"], \(\((x\^2 - 1)\)\^n\)}], TraditionalForm]]]], "InlineFormula", FontSize->17], Cell["or", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["P[n_, x_] := D[(x^2-1)^n, {x,n}]/(2^n n!)", "Input", AspectRatioFixed->True], Cell[TextData[{ "(Remember that ", StyleBox["D[f[x], {x,n}]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " means the n", StyleBox["th", FontVariations->{"CompatibilityType"->"Superscript"}], " derivative of ", StyleBox["f[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " with respect to x.) We've now defined our own Legendre Polynomial \ function ", StyleBox["P[n, x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", which should give the same polynomials as Mathematica's. Let's try it:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["P[4, x]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Hmm, that's not a very clear expression, is it? We can tidy it up with ", StyleBox["Expand[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ":" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Expand[%]\)], "Input"], Cell["Now we can compare with Mathematica's version:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["LegendreP[4, x]", "Input", AspectRatioFixed->True], Cell["Good. Here's another check:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Expand[P[10, x]]", "Input", AspectRatioFixed->True], Cell["LegendreP[10, x]", "Input", AspectRatioFixed->True], Cell["\<\ The form of Rodrigues' formula immediately tells us several things \ that we've already observed in the explicit forms, such as\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "1. ", StyleBox["P[n, x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " is a polynomial in x of order n. (Why?)" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "2. ", StyleBox["P[n, x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " has only even powers of x if n is even, only odd powers of x if n is odd. \ (Why?)" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "3. Therefore, ", StyleBox["P[n, x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " is an even or odd function of x, according to whether n is even or odd." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "A function for P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(0)" }], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "It's not much harder to figure out a general formula for P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(0). Of course it's 0 for n odd. For n even, P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(0) comes (using Rodrigues' formula) from the n", StyleBox["th", FontVariations->{"CompatibilityType"->"Superscript"}], " derivative of the x", StyleBox["n", FontVariations->{"CompatibilityType"->"Superscript"}], " term in (x", StyleBox["2", FontVariations->{"CompatibilityType"->"Superscript"}], " - 1)", StyleBox["n", FontVariations->{"CompatibilityType"->"Superscript"}], ", which is" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ Cell[BoxData[ \(TraditionalForm\`\((\(-1\))\)\^\(n/2\)\)]], " ", Cell[BoxData[ FormBox[ RowBox[{"(", "\[NegativeThinSpace]", GridBox[{ {"n"}, {\(n/2\)} }], "\[NegativeThinSpace]", ")"}], TraditionalForm]]], " ", Cell[BoxData[ \(TraditionalForm\`x\^n\)]] }], "Info", Evaluatable->False, AspectRatioFixed->True, FontSize->15], Cell[TextData[{ "from the binomial expansion. Differentiating n times gives a factor of n! \ and gets rid of the ", Cell[BoxData[ \(TraditionalForm\`x\^n\)]], ". Finally, dividing by ", Cell[BoxData[ \(TraditionalForm\`2\^n\)]], " n! (see Rodrigues' formula) leaves" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["zeroeven[n_] := (-1)^(n/2) Binomial[n,n/2] / 2^n", "Input", AspectRatioFixed->True], Cell["Let's check that:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["{zeroeven[10], LegendreP[10,0]}", "Input", AspectRatioFixed->True], Cell["Looks good.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "If we want to make a general function ", StyleBox["zero[n]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " that works for odd n too, and doesn't work unless n is an integer, we can \ use:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["zero[n_Integer] := If[ EvenQ[n], zeroeven[n], 0]", "Input", AspectRatioFixed->True], Cell["Let's try it out:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["zero[6]", "Input", AspectRatioFixed->True], Cell["zero[7]", "Input", AspectRatioFixed->True], Cell["zero[6.5]", "Input", AspectRatioFixed->True], Cell[TextData[{ "The ", StyleBox["n_Integer", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " on the left is a ", StyleBox["pattern", FontSlant->"Italic"], " that only matches explicit integers. If you try ", StyleBox["zero[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " on a non-integer it doesn't match, so Mathematica acts as though it's \ never heard of", StyleBox[" ", FontWeight->"Bold"], StyleBox["zero[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". The ", StyleBox["If[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " function evaluates either its second or its third argument, according to \ whether its first argument is true or false respectively. And of course ", StyleBox["EvenQ[", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["n", FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " is a function that is true if ", StyleBox["n", FontSlant->"Italic"], " is even (the ", StyleBox["Q", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " stands for \"Question\"; there are several Mathematica functions ending \ in ", StyleBox["Q", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " that ask a question and return ", StyleBox["True", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " or ", StyleBox["False", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ")." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Conditions", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Actually, the above definition of ", StyleBox["zero[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " still isn't quite general; it should also reject negative values of n. \ When we start getting compounded conditions like this, the best approach is \ to use the ", StyleBox["condition", FontSlant->"Italic"], " operator \"", StyleBox["/;", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "\" which is often read as ", StyleBox["whenever", FontSlant->"Italic"], ". For example, we could write:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ zero2[n_Integer] := zeroeven[n] /; n>=0 && EvenQ[n]; zero2[n_Integer] := 0 /; n>=0 && OddQ[n]\ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ "The expressions following the ", StyleBox["/;", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " are conditions, with ", StyleBox["&&", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " meaning logical And. So you read the first line as \"zero2[n], for \ integer n, is given by zeroeven[n] whenever n is greater or equal to 0 ", StyleBox["and", FontSlant->"Italic"], " n is even\". We can have multiple definitions for a function if they \ have different conditions." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Now try it out:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["{zero2[6], zero2[7], zero2[6.5], zero2[-3]}", "Input", AspectRatioFixed->True], Cell["\<\ Conditions are generally quite useful. They can be used directly \ in patterns as well as after definitions like the above. For example the \ following are equivalent to the above: \ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ zero3[n_Integer /; n>=0 && EvenQ[n]] := zeroeven[n]; zero3[n_Integer /; n>=0 && OddQ[n]] := 0\ \>", "Input", AspectRatioFixed->True], Cell["{zero3[6], zero3[7], zero3[6.5], zero3[-3]}", "Input", AspectRatioFixed->True], Cell["\<\ It doesn't matter much whether you use the zero2 form or the zero3 \ form. Afficionados usually prefer the zero3 form, keeping the condition as \ close as possible to the pattern being matched.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Section 2.3.5 of the Mathematica book discusses conditions further.\ \ \>", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Improving our P[n, x]", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Whereas ", StyleBox["LegendreP[n, x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " works perfectly well with a numerical value for x, our own definition \ doesn't:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["P[10, 0]", "Input", AspectRatioFixed->True], Cell["\<\ Do you see what went wrong? We tried to differentiate with respect \ to 0, which Mathematica rightly objects to. So we need to use:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["P[10, x] /. x -> 0", "Input", AspectRatioFixed->True], Cell[TextData[{ "But how could we redefine ", StyleBox["P[n, x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " so we didn't have to do this? It would be easy to encapsulate the above \ idea with a dummy variable, say ", StyleBox["t ", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "(also putting in the ", StyleBox["Expand[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " now):" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["P[n_, x_] := Expand[D[(t^2-1)^n, {t,n}] / (2^n n!)] /. t->x", "Input", AspectRatioFixed->True], Cell["P[4, x]", "Input", AspectRatioFixed->True], Cell["P[10, 0]", "Input", AspectRatioFixed->True], Cell[TextData[{ "But then we're in trouble if the user of our function happens to be using \ ", StyleBox["t", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for something else. For example:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["t = 0.5;", "Input", AspectRatioFixed->True], Cell["P[6, 4]", "Input", AspectRatioFixed->True], Cell[TextData[{ "The solution to this dilemma is to use Mathematica's ", StyleBox["Module[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " construction, in which the first argument is a list of local \"dummy\" \ variables. So we just wrap ", StyleBox["Module[{t},...]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " around our previous definition:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ P[n_, x_] := Module[{t}, Expand[D[(t^2-1)^n,{t,n}]/(2^n n!)]/.t->x]\ \ \>", "Input", AspectRatioFixed->True], Cell["and try it out:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["P[3, x]", "Input", AspectRatioFixed->True], Cell["P[10, 0]", "Input", AspectRatioFixed->True], Cell["P[6, t]", "Input", AspectRatioFixed->True], Cell[TextData[{ "In the last case the global value of ", StyleBox["t", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " (0.5) does not affect the local dummy variable ", StyleBox["t", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", or vice-versa." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Exploring Module[] and Block[]", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The ", StyleBox["Module[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " construction is often useful for encapsulating a definition or \ calculation, using local variables to avoid any possible conflict with \ \"outside\" ones. It does it by constructing a unique name for each of the \ local variables, as we can see with:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Module[{t}, Print[t]]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Try it twice! ", StyleBox["Print[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " justs prints the values of its argument(s), which will just be their \ names if they don't have any more specific value." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The first argument of ", StyleBox["Module[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " can also include initial values for the variables, as in" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Module[{t = 5}, t^2]", "Input", AspectRatioFixed->True], Cell[TextData[{ "In more detail,", StyleBox[" Module[", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["variable-list", FontSlant->"Italic"], StyleBox[", ", FontWeight->"Bold"], StyleBox["expression", FontSlant->"Italic"], StyleBox["]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " does the following:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "1. Construct a unique name for each local variable (those in the ", StyleBox["variable-list", FontSlant->"Italic"], "), by appending ", StyleBox["$", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox["n", FontFamily->"Courier", FontSize->12, FontWeight->"Bold", FontSlant->"Italic"], " to the name, as we saw." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["2. Assign the initial values, if any are given.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "3. Substitute the new name for each occurrence of each local variable in \ the expression, which is ", StyleBox["not", FontSlant->"Italic"], " evaluated before ", StyleBox["Module[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " sees it; ", StyleBox["Module[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " has the ", StyleBox["HoldAll", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " attribute, like ", StyleBox["Plot[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["4. Evaluate the resulting expression.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "That may seem like the obvious way to do it, but isn't really. There are \ other possible approaches, as we'll see shortly. ", StyleBox[ "See if you can figure out what each of the following will give, before \ evaluating it", FontSlant->"Italic"], ". The last one should be worth a prize. First we'll make a definition to \ make it tricky." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["t = x^2 +3", "Input", AspectRatioFixed->True], Cell["Module[{t}, t]", "Input", AspectRatioFixed->True], Cell["Module[{u=4}, t + u]", "Input", AspectRatioFixed->True], Cell["Module[{x=4}, t + x]", "Input", AspectRatioFixed->True], Cell["Module[{x=4}, Evaluate[t + x]]", "Input", AspectRatioFixed->True], Cell["Module[{u=t}, t + u]", "Input", AspectRatioFixed->True], Cell["Module[{t=t}, t]", "Input", AspectRatioFixed->True], Cell["Module[{x=t}, t + x]", "Input", AspectRatioFixed->True], Cell["Module[{t=x^3, x=t}, t + x]", "Input", AspectRatioFixed->True], Cell["Module[{t=x^3, x=t}, Evaluate[t + x]]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Got it? The most crucial thing to remember in practice is that \ substitutions are only made for variables that appear ", StyleBox["explicitly", FontSlant->"Italic"], " in the ", StyleBox["expression", FontSlant->"Italic"], "." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "A different approach is used by ", StyleBox["Block[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". This has the same syntax as ", StyleBox["Module[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", but does ", StyleBox["not", FontSlant->"Italic"], " construct new unique names for the local variables. Instead it remembers \ their old values (if any), re-initializes them, evaluates the expression, and \ finally restores the old values. Thus it temporarily changes the ", StyleBox["global", FontSlant->"Italic"], " meaning of the symbols that are specified as variables." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "If you feel like exploring this, try changing the ", StyleBox["Module", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " to ", StyleBox["Block", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " in each of the above cases and re-evaluating them. ", StyleBox[ "But be ready to abort the evaluation using Command-period as soon as it \ hits the recursion limit. And don't even try the last two", FontSlant->"Italic"], "." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Usually you'll want to use ", StyleBox["Module[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " to encapsulate a calculation and protect local variables. But ", StyleBox["Block[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " is occasionally useful too." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "If you still need a challenge, find a case in which ", StyleBox["Evaluate[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " ", StyleBox["does", FontSlant->"Italic"], " make a difference within ", StyleBox["Block[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["Important:", FontWeight->"Bold", FontSlant->"Italic"], " let's clear the value we gave to ", StyleBox["t", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". I've also included ", StyleBox["x", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", because I fancy that you might have given it a value to solve the above \ challenge. If you defined something else, clear that too." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Clear[t,x]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Sections 2.6.1-2.6.7 of the Mathematica book have more discussion of ", StyleBox["Module[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", ", StyleBox["Block[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", and ", StyleBox["With[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". ", StyleBox["With[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " has the same syntax as the others, but does things a yet different way \ (roughly steps 2-4 of ", StyleBox["Module[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", without step 1)." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Problem 2", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Construct two new Mathematica functions to produce Chebyshev \ polynomials: \ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "1. ", StyleBox["Tma[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", based on the multiple-angle formula you found in problem 1." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "2. ", StyleBox["Trod[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", based on the Chebyshev Rodrigues formula" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(T\_n\) \((x)\) = \(\(\(\((\(-1\))\)\^n\) \(\@\[Pi]\) \@\((1 - x\^2)\)\)\/\(\(2\^n\) \(\((n - 1/2)\)!\)\)\) \(d\^n\/dx\^n\) \((1 - x\^2)\)\^\(n - 1/2\)\)], "InlineFormula", FontSize->17], Cell["[where in both case n-1/2 means n-0.5, not (n-1)/2].", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Both functions should of course agree with ", StyleBox["ChebyshevT[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for integer n (n=0, 1, 2,...). For full credit they should be very \ robust. They should not use or alter any global variables, and should work \ for, and only for, appropriate values of n and x. x might be an expression. \ If they can't give an answer they should just return an unevaluated result. " }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "For ", StyleBox["Tma[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", depending on your approach, you may find ", StyleBox["TrigExpand[...]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " helpful (see section 3.3.7 of the book)." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Legendre Differential Equation", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Checking the ODE", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ The Legendre Polynomials arise in physics and engineering mainly \ (but not only) as solutions to the Legendre differential equation:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["lde[n_] := (1-x^2) y''[x] -2x y'[x] + n(n+1)y[x] == 0", "Input", AspectRatioFixed->True], Cell[TextData[{ "I wrote this in the same form as used by ", StyleBox["DSolve[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", using ", StyleBox["y'[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " etc and the ", StyleBox["==", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " operator. I also gave it a name for given n with ", StyleBox["lde[n_] :=", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[".", FontSize->12], " So for example:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["lde[2]", "Input", AspectRatioFixed->True], Cell[TextData[{ "We could try solving this equation using ", StyleBox["DSolve[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", but here our main aim is the reverse; to show that it is satisfied by \ the Legendre polynomials we've been playing with. So let's try that for \ n=2:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["y[x_] := LegendreP[2,x]", "Input", AspectRatioFixed->True], Cell["lde[2]", "Input", AspectRatioFixed->True], Cell["Simplify[%]", "Input", AspectRatioFixed->True], Cell["Nice, huh? Try it yourself for another n (e.g. 10).", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Choosing function arguments", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "You may well think that the way I set this up isn't very pretty, because \ we keep on having to redefine ", StyleBox["y[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for each new test. You're right. But the following (after clearing ", StyleBox["y[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ") does ", StyleBox["not", FontSlant->"Italic"], " work:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Clear[y]", "Input", AspectRatioFixed->True], Cell["lde[5] /. y[x] -> LegendreP[5, x]", "Input", AspectRatioFixed->True], Cell[TextData[{ "It substitutes for ", StyleBox["y[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", but not for ", StyleBox["y'[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " and ", StyleBox["y''[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " because in fact they're represented internally as ", StyleBox["Derivative[1][y][x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " and ", StyleBox["Derivative[2][y][x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", which don't mention ", StyleBox["y[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " explicitly. If you want to get around this, you have to define ", StyleBox["y", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " itself, as a pure function, instead of ", StyleBox["y[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ":" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["lde[4] /. y -> (LegendreP[4, #1] &)", "Input", AspectRatioFixed->True], Cell["Simplify[%]", "Input", AspectRatioFixed->True], Cell["\<\ Once you've understood this, good Mathematica taste should suggest \ that you define something like\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ lde[y_, n_] := Module[{x}, \t\tSimplify[(1-x^2) y''[x] - 2x y'[x] + n(n+1)y[x] == 0] \t]\ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ "which takes a pure function for the first argument, makes ", StyleBox["x", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " a local variable, and includes the ", StyleBox["Simplify[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". Then we can just do:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["lde[LegendreP[5,#]&, 5]", "Input", AspectRatioFixed->True], Cell[TextData[{ "But now if we don't just get ", StyleBox["True", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " we get the ODE with an independent variable that has a temporary name, \ not just ", StyleBox["x", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ":" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["lde[y,4]", "Input", AspectRatioFixed->True], Cell["So we couldn't use", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["DSolve[lde[y,4], y, x]", "Input", AspectRatioFixed->True], Cell[TextData[{ "for example, because the ", StyleBox["x", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " variables don't match up." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["So what should I have done? Here are some options:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ 1. lde[n_] := ... (y and x global) 2. lde[n_] := Module[{x}, ...] (y global) 3. lde[y_, n_] := ... (x global) 4. lde[y_, n_] := Module[{x}, ...] 5. lde[y_, x_, n_] := ... 6. lde[y_[x_], n_] := ...\ \>", "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We tried 1 and 4 above. 2 & 4 suffer from the x$n problem. Probably 5 is \ the best. Option 6 should strike you as clever; it lets you use an ordinary \ function like ", StyleBox["y[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " or ", StyleBox["f[z]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for the first argument, and picks out both variables from that. However, \ it wouldn't work for ", StyleBox["LegendreP[3,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " because of the extra argument. So for flexibility the pure function form \ is probably best." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ The general lesson is that choosing the right function arguments is \ something of an art, with several factors involved. \ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "If you feel an urge to redefine ", StyleBox["lde[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " and then try ", StyleBox["DSolve[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " again, just go ahead. But you'll find that it comes up with a horrible \ result, which could in fact be reduced to a linear combination of P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) and Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Legendre Functions of the Second Kind Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)" }], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "If we want the ", StyleBox["general", FontSlant->"Italic"], " solution of the Legendre Differential Equation, we need another solution \ that's linearly independent of P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x). The conventional form for this (for integer n) is called a \ \"Legendre Function of the Second Kind\", written as Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Of course Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) is ", StyleBox["not", FontSlant->"Italic"], " regular at |x| = 1; the only regular solution is P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x). So the Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)'s are not very important in physics, where usually we want things \ (e.g. electrostatic potentials, wave functions) to remain finite when ", StyleBox["\[Theta]", FontFamily->"Symbol"], " goes to 0 and ", StyleBox["\[Pi]", FontFamily->"Symbol"], " (the z axis). They ", StyleBox["do", FontSlant->"Italic"], " come up in cases where we have a boundary that excludes both the north \ and the south pole, so ", StyleBox["\[Theta]", FontFamily->"Symbol"], " runs from ", StyleBox["\[Theta]", FontFamily->"Symbol"], StyleBox["1", FontVariations->{"CompatibilityType"->"Subscript"}], " to ", StyleBox["\[Theta]", FontFamily->"Symbol"], StyleBox["2", FontVariations->{"CompatibilityType"->"Subscript"}], ", with ", StyleBox["\[Theta]", FontFamily->"Symbol"], StyleBox["1", FontVariations->{"CompatibilityType"->"Subscript"}], " > 0 and ", StyleBox["\[Theta]", FontFamily->"Symbol"], StyleBox["2", FontVariations->{"CompatibilityType"->"Subscript"}], " < ", StyleBox["\[Pi]", FontFamily->"Symbol"], ", but that's not a very common geometry. They also come up in some \ advanced field theory, but are not much needed in non-relativistic \"ordinary\ \" quantum theory." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Mathematica uses ", StyleBox["LegendreQ[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x). Let's look at the first few:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["LegendreQ[0,x]", "Input", AspectRatioFixed->True], Cell["LegendreQ[1,x]", "Input", AspectRatioFixed->True], Cell["LegendreQ[2,x]", "Input", AspectRatioFixed->True], Cell["Do you see the pattern? It's", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ Cell[BoxData[ \(TraditionalForm\`Q\_n\)]], "(x) = (polynomial of order n-1) + ", Cell[BoxData[ \(TraditionalForm\`\(P\_n\)(x)\)]], Cell[BoxData[ \(TraditionalForm\`1\/2\)]], "Log[", Cell[BoxData[ \(TraditionalForm\`\(1 + x\)\/\(1 - x\)\)]], "]" }], "InlineFormula", FontSize->17], Cell["\<\ 1 1 + x Q (x) = (polynomial of order n-1) + P (x).- Log[-----] n n 2 1 - x\ \>", "Print", Evaluatable->False, AspectRatioFixed->True], Cell["or, since arctanh x = (1/2) log[(1+x)/(1-x)],", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ Cell[BoxData[ \(TraditionalForm\`Q\_n\)]], "(x) = (polynomial of order n-1) + ", Cell[BoxData[ \(TraditionalForm\`\(P\_n\)(x)\)]], ".ArcTanh[x]" }], "InlineFormula", FontSize->17], Cell["\<\ Just to check, let's try subtracting off the last term from a \ high-order case :\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Expand[LegendreQ[30,x] - LegendreP[30,x] Log[(1+x)/(1-x)]/2]", "Input", AspectRatioFixed->True], Cell["\<\ -- a 29th order polynomial, as expected. Quite some coefficients, \ huh? Just try n = 50 or 60!\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Note that:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "1. Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) diverges at +1 and -1." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "2. Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) is regular (non-divergent) for -1 < x < 1. In particular it's \ perfectly well-behaved at the origin x = 0, and we could expand the log term \ to make a normal series expansion around 0. But it's an ", StyleBox["infinite", FontSlant->"Italic"], " power series (with radius of convergence 1), as opposed to P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) which is a finite power series. You get both series as possibilities \ if you construct a series solution of the Legendre differential equation \ (Frobenius method), but you normally select the finite series P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) for physics applications. Two solutions from the Frobenius method are \ expected because x = 0 is a regular point of the differential equation \ (Fuchs's theorem)." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "3. Any linear combination of P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) and Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) is also a solution of the Legendre differential equation. The \ standard definition of Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x), which we haven't bothered to state explicitly, is just a convention. \ If, for example, you use the Wronskian method to construct a second solution \ from P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x), you get a different linear combination." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "They're not terribly enlightening, but let's make some plots of the Q(n, \ x)'s. Since they blow up at x = ", StyleBox["\[PlusMinus]", FontFamily->"Symbol"], "1, we'll plot from -0.999 to +0.999. (Actually you can try plotting from \ -1 to +1 if you're curious; you'll get a load of error messages, but then \ essentially the same plot.)" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Plot[Evaluate[Table[LegendreQ[n,x],{n,0,4}]], {x,-0.999,0.999}]\ \>", "Input", AspectRatioFixed->True], Cell["From the plots you can observe:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "1. The Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)'s are either even or odd. If you check, you'll find that they're odd \ if n is even, and vice-versa." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "2. They all go to +", StyleBox["\[Infinity]", FontFamily->"Symbol"], " at x = +1, and to ", StyleBox["\[PlusMinus]\[Infinity]", FontFamily->"Symbol"], " at x = -1." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Legendre Functions for non-integer n", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We've always been assuming that n is an integer, both for P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) and for Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x). You can also define P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) for n ", StyleBox["not", FontSlant->"Italic"], " an integer, as solutions of the Legendre differential equation, in which \ case they're called Legendre ", StyleBox["functions", FontSlant->"Italic"], " as opposed to Legendre ", StyleBox["polynomials", FontSlant->"Italic"], ". You don't need a separate Q", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) for non-integer n, because P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) and P", StyleBox["-n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) turn out to be two linearly independent solutions." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Usually people use ", StyleBox["\[Nu]", FontFamily->"Symbol"], " (nu) instead of n for the non-integer case. I'll do that from here on." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "These Legendre functions blow up at x = -1, but not at x = 1. In fact \ they're defined so that P", StyleBox["\[Nu]", FontFamily->"Symbol", FontVariations->{"CompatibilityType"->"Subscript"}], "(1) = 1, just as for the polynomials. So ", "P", StyleBox["\[Nu]", FontFamily->"Symbol", FontVariations->{"CompatibilityType"->"Subscript"}], "(cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], ")", " can be used for solutions of Laplace's equation when the north pole but \ not the south pole is\nin the problem. ", "P", StyleBox["\[Nu]", FontFamily->"Symbol", FontVariations->{"CompatibilityType"->"Subscript"}], "(-cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], ") ", "can be used for the opposite case (south but not north)." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "These Legendre functions can't be expressed as finite polynomials, or \ indeed in ", StyleBox["any", FontSlant->"Italic"], " closed form (except an infinite series). So Mathematica can't help you \ much except numerically or for an expansion:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" LegendreP[1/2, x]", "Input", AspectRatioFixed->True], Cell[" LegendreP[1/2, 0.5]", "Input", AspectRatioFixed->True], Cell["Series[LegendreP[1/2, x], {x,0,4}]", "Input", AspectRatioFixed->True], Cell["% //N", "Input", AspectRatioFixed->True], Cell[TextData[{ "Here's a plot for ", StyleBox["\[Nu]", FontFamily->"Symbol"], " = 0, 0.25, 0.5, ..., 3:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Plot[Evaluate[Table[LegendreP[n,x],{n,0,3,0.25}]], \t{x,-0.999,1}]\ \>", "Input", AspectRatioFixed->True], Cell["Note:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "1. P", StyleBox["\[Nu]", FontFamily->"Symbol", FontVariations->{"CompatibilityType"->"Subscript"}], "(1) = 1." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "2. The divergence at x=-1 is sometimes positive, sometimes negative. It \ changes whenever ", StyleBox["\[Nu]", FontFamily->"Symbol"], " goes through an integer (at which point itself there's no divergence)." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["3. There's no even or odd parity.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "4. Coming down in x from 1, the first zero moves steadily to the right as \ ", StyleBox["\[Nu]", FontFamily->"Symbol"], " increases." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "5. For a given x, say ", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], ", there are a discrete series of ", StyleBox["\[Nu]", FontFamily->"Symbol"], " values such that there's a zero at ", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], ", i.e., P", StyleBox["\[Nu]", FontFamily->"Symbol", FontVariations->{"CompatibilityType"->"Subscript"}], "(", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], ") = 0." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The last point is the most important for applications to electrostatics. \ If we want our solutions to vanish on a cone with half-angle ", Cell[BoxData[ \(TraditionalForm\`\[Theta]\_0\)]], ", we get the condition ", Cell[BoxData[ \(TraditionalForm\`\(P\_\[Nu]\)(cos\[Theta]\_0)\)]], " = 0. For example let's find the appropriate functions for ", Cell[BoxData[ \(TraditionalForm\`\[Theta]\_0\)]], StyleBox[" ", FontVariations->{"CompatibilityType"->"Subscript"}], "= 60 degrees, or ", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], " = 0.5. First we need to find the appropriate set of ", StyleBox["\[Nu]", FontFamily->"Symbol"], "'s with ", StyleBox["FindRoot", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". I figured out some empirical starting points for this, and will spare \ you the details:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Clear[nu];\nnu[k_] := nu[k] = n /. FindRoot[LegendreP[n, 0.5] == 0,\n\t\t\ {n, 3*k + 1.7, 3*k + 1.8}][[1]]; (* empirical *)\nTable[nu[k],{k,0,5}] \ (* list of the ", StyleBox["\[Nu]", FontFamily->"Symbol", FontWeight->"Plain"], "'s *)" }], "Input", AspectRatioFixed->True], Cell["Now for the plot (be patient):", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Plot[Evaluate[Table[LegendreP[nu[k],x],{k,0,5}]],{x,0.5,1}]", "Input", AspectRatioFixed->True], Cell["We'll return to this set of functions later in the notebook.", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Generating Function and Recurrence Relations", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Introduction", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We'll now return to the Legendre ", StyleBox["Polynomials", FontSlant->"Italic"], " for the rest of this Notebook." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Another way of defining the Legendre polynomials is through the expansion \ of the ", StyleBox["generating function", FontSlant->"Italic"], " ", StyleBox["g[t,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " in powers of t:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " 1 ", StyleBox["\[Infinity]", FontFamily->"Symbol"], "\ng(t,x) = -------------------- = ", StyleBox["\[Sum]", FontFamily->"Symbol", FontSize->16], " P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) t", StyleBox["n", FontVariations->{"CompatibilityType"->"Superscript"}], "\n Sqrt[1 - 2 x t + t", StyleBox["2", FontVariations->{"CompatibilityType"->"Superscript"}], "] n=0" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The generating function has an immediate physical interpretation in terms \ of the electrostatic potential of a point charge. If the charge is at \ position ", StyleBox["a", FontWeight->"Bold"], " (a vector), then the potential at ", StyleBox["r", FontWeight->"Bold"], " (another vector) is given by" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " e\nV(", StyleBox["r", FontWeight->"Bold"], ") = -------\n |", StyleBox["r", FontWeight->"Bold"], " - ", StyleBox["a", FontWeight->"Bold"], "|" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "(in Gaussian units). If we set up a z-axis along the ", StyleBox["a", FontWeight->"Bold"], " direction and use spherical coordinates, we get using the cosine rule \ (with \"r\" and \"a\" now scalars)" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " e\nV(r, ", StyleBox["\[Theta]", FontFamily->"Symbol"], ") = -----------------------------\n Sqrt[r^2 - 2 a r cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], " + a^2]\n \n e/r\n = \ --------------------------------\n Sqrt[1 - 2 (a/r)cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], " + (a/r)^2]\n\n ", StyleBox["\[Infinity]", FontFamily->"Symbol"], "\n = (e/r) ", StyleBox["\[Sum]", FontFamily->"Symbol", FontSize->16], " P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(cos ", StyleBox["\[Theta]", FontFamily->"Symbol"], ")(a/r)", StyleBox["n", FontVariations->{"CompatibilityType"->"Superscript"}], "\n n=0" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "This is a ", StyleBox["multipole expansion", FontSlant->"Italic"], " for the original charge \"distribution\" (a single point charge). We'll \ discuss multipole expansions more in class. " }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Example", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["Let's try it out. Here's the generating function:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" g[t_,x_] := 1/Sqrt[1 - 2 x t + t^2]", "Input", AspectRatioFixed->True], Cell[" Expanding as far as n=3:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" Series[g[t,x], {t, 0, 3}]", "Input", AspectRatioFixed->True], Cell[TextData[{ "The coefficient of t", StyleBox["n", FontVariations->{"CompatibilityType"->"Superscript"}], " should be just P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x). You should recognize the first three such coefficients, but the last \ one needs a bit of massaging. First separate it out" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" Normal[%][[4]]", "Input", AspectRatioFixed->True], Cell[TextData[{ "and now remove the t", StyleBox["3", FontVariations->{"CompatibilityType"->"Superscript"}], " and clean it up." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Expand[%/t^3]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Reminder about Normal[]", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "You should remember ", StyleBox["Normal[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " from the ", StyleBox["Series.nb", FontWeight->"Bold"], " Notebook. But here's a quick reminder if you've forgotten. Skip it if \ you're happy about what I did above." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "When you construct a series expansion with ", StyleBox["Series[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", it is stored in a special kind of Mathematica object (called a ", StyleBox["SeriesData", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " object) that is ", StyleBox["not", FontSlant->"Italic"], " simply equivalent to the polynomial it contains. For example, consider \ expanding ", StyleBox["Sin[z]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " around ", StyleBox["z=0", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " up to the ", StyleBox["z^8", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " term:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" Series[Sin[z], {z,0,8}]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Note that Mathematica gives the order of the next term; O[z]", StyleBox["n", FontVariations->{"CompatibilityType"->"Superscript"}], " means of order z", StyleBox["n", FontVariations->{"CompatibilityType"->"Superscript"}], ". Look at the ", StyleBox["InputForm", FontWeight->"Bold"], " of this result:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["% // InputForm", "Input", AspectRatioFixed->True], Cell["\<\ It doesn't look anything like a polynomial! The details don't \ normally matter.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Now try squaring the series:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["%^2", "Input", AspectRatioFixed->True], Cell[TextData[{ "If we had just squared the equivalent polynomial we would have got terms \ up to z", StyleBox["14", FontVariations->{"CompatibilityType"->"Superscript"}], ", but Mathematica knows that they're valueless beyond z", StyleBox["8", FontVariations->{"CompatibilityType"->"Superscript"}], "." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We can convert a power series to an ordinary polynomial using ", StyleBox["Normal[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". For example:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" Normal[%]", "Input", AspectRatioFixed->True], Cell[TextData[{ "All that ", StyleBox["appeared", FontSlant->"Italic"], " to happen was that the O[x]", StyleBox["10", FontVariations->{"CompatibilityType"->"Superscript"}], " disappeared, but internally the representation changed entirely:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["% // InputForm", "Input", AspectRatioFixed->True], Cell[TextData[{ " Now squaring it ", StyleBox["will", FontSlant->"Italic"], " give terms up to z", StyleBox["16", FontVariations->{"CompatibilityType"->"Superscript"}], ", after you expand it out:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" %^2", "Input", AspectRatioFixed->True], Cell[" Expand[%]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Of course the terms beyond z", StyleBox["10", FontVariations->{"CompatibilityType"->"Superscript"}], " are worthless as an expansion of", StyleBox[" ", FontWeight->"Bold"], StyleBox["Sin[z]^4", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", as we can see by finding that directly:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" Series[Sin[z]^4, {z,0,16}]", "Input", AspectRatioFixed->True], Cell["Compare the two series.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "If you want to extract a particular term from a series expansion, you need \ to use ", StyleBox["Normal[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " and then take the n", StyleBox["th", FontVariations->{"CompatibilityType"->"Superscript"}], " part using ", StyleBox["[[n]]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". For example, to get the 5", StyleBox["th", FontVariations->{"CompatibilityType"->"Superscript"}], " term (the z", StyleBox["12", FontVariations->{"CompatibilityType"->"Superscript"}], " term) from the above series, we can use" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Normal[%][[5]]", "Input", AspectRatioFixed->True], Cell["------------- end of reminder -----------------", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Recurrence Relations", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ From the generating function it's easy to derive the recurrence \ relations, but we'll just pull them (or at least some of them) out of a hat. \ For example:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " n P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) = (2n-1) x P", StyleBox["n-1", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) - (n-1) P", StyleBox["n-2", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) (1)" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell["and", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " P'", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) = n P", StyleBox["n-1", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) + x P'", StyleBox["n-1", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) (2)" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell["These sorts of relations are useful in two main ways:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["a. In formal derivations and proofs, and", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "b. On a computer, to calculate P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) or its derivatives." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Let's use recurrence relation (1) above to explore (b). I'll define a new \ function ", StyleBox["lp[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " (for Legendre polynomial) just using the recurrence relation and P", StyleBox["0", FontSize->12, FontVariations->{"CompatibilityType"->"Subscript"}], "(x) and P", StyleBox["1", FontSize->12, FontVariations->{"CompatibilityType"->"Subscript"}], "(x): " }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ lp[0,x_] = 1; lp[1,x_] = x; lp[n_,x_] := ((2n-1) x lp[n-1,x] - (n-1) lp[n-2,x])/n\ \>", "Input", AspectRatioFixed->True], Cell["Now try it", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["lp[5,x]", "Input", AspectRatioFixed->True], Cell["Expand[%]", "Input", AspectRatioFixed->True], Cell["Compare with the right answer:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["LegendreP[5,x]", "Input", AspectRatioFixed->True], Cell[TextData[{ "How about that? Actually this is probably how Mathematica finds ", StyleBox["LegendreP[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], StyleBox[" ", FontFamily->"Courier", FontSize->12], "internally, though Wolfram (the principal author of Mathematica) is pretty \ secretive about the inner workings, so it's hard to know for sure." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We could use the same idea numerically, and indeed that's usually how \ computers evaluate Legendre polynomials. An important question is whether or \ not such a recursive procedure is ", StyleBox["stable", FontSlant->"Italic"], " numerically; if a little error creeps in (e.g. from rounding), will it \ get multiplied up in later iterations and invalidate the result? It turns \ out that the recursion we're using here is stable (errors ", StyleBox["don't", FontSlant->"Italic"], " multiply), but that's neither obvious nor universally true of recurrence \ relations." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "After doing problem 2, you probably see some problems with the way I set \ up the definition of ", StyleBox["lp[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". Good; me too. But do I care? Well, yes and no. Yes about some new \ issues, not so much about the old ones. Let's leave robustness behind and \ consider ", StyleBox["efficiency", FontSlant->"Italic"], "." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The recursion we're using is actually very ", StyleBox["in", FontSlant->"Italic"], "efficient, because we calculate the lower polynomials many times each. We \ can see this in action by modifying the recursion relation to print out the n \ it's working on:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ lp[0,x_] = 1; lp[1,x_] = x; lp[n_,x_] := \t( \t\tPrint[\"finding lp[\",n,\",\",x,\"]\"]; \t\tExpand[((2n-1) x lp[n-1,x] - (n-1) lp[n-2,x])/n] \t) \ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ "I also put in the ", StyleBox["Expand[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " to clean up the result. Let's evaluate it for n = 6:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" lp[6,x]", "Input", AspectRatioFixed->True], Cell[TextData[{ "See what happened? It evaluated ", StyleBox["lp[2,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " five times, ", StyleBox["lp[3,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " three times, and ", StyleBox["lp[4,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " twice. You would ", StyleBox["not", FontSlant->"Italic"], " want to try this approach for n = 50. (I did; that's why I'm telling you \ this!)" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Do you remember the standard Mathematica idiom that solves this problem? \ We save each ", StyleBox["lp[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " as we calculate it:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Clear[lp]; lp[0,x_] = 1; lp[1,x_] = x; lp[n_,x_] := lp[n,x] = \t( \t\tPrint[\"finding lp[\",n,\",\",x,\"]\"]; \t\tExpand[((2n-1) x lp[n-1,x] - (n-1) lp[n-2,x])/n] \t)\ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ "The essential new part is the \"", StyleBox["lp[n,x] =", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "\". I also included the ", StyleBox["Clear[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " for safety, as discussed below. Now try again:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["lp[6,x]", "Input", AspectRatioFixed->True], Cell["lp[8,x]", "Input", AspectRatioFixed->True], Cell[TextData[{ "It now has internally all the ", StyleBox["lp[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "'s up to n=8. You can see everything it knows about ", StyleBox["lp", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " with:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["?lp", "Input", AspectRatioFixed->True], Cell[TextData[{ "The general idiom here, without the ", StyleBox["Print[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " operation, is:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["f[n_] := f[n] = some function", "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Each time you evaluate a particular ", StyleBox["f[n]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " it stores it away. This is a very useful trick, discussed in section \ 2.4.9 of the Mathematica book. But be careful:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ 1. It's easy to construct an infinite recursion if you get the \ punctuation wrong.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "2. The stored values remain until you explicitly delete them, e.g. with ", StyleBox["Clear[lp]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". If you make a mistake and try to redo it, the old stored values may \ mess you up. For that reason it's a good idea to include a ", StyleBox["Clear[...]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " at the start of any evaluation that uses this trick, as I did above." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Problem 3", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Use the same technique and the other recursion relation above to construct \ a function ", StyleBox["dlp[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " that computes the derivative P'", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x). It can use the ", StyleBox["lp[n,x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " function too. Calculate P'", StyleBox["10", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) this way, and compare with the right answer. You don't need to \ include a ", StyleBox["Print[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " function." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Orthogonality and Eigenfunction Expansions", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Sturm-Liouville form", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ The Legendre differential equation can readily be put into the \ generic Sturm-Liouville form:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " d dy\n --(p(x)--) + q(x) y(x) = ", StyleBox["\[Lambda]", FontFamily->"Symbol"], " w(x) y(x)\n dx dx" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "with p(x) = 1 - x", StyleBox["2", FontVariations->{"CompatibilityType"->"Superscript"}], ", q(x) = 0, w(x) = 1, and ", StyleBox["\[Lambda]", FontFamily->"Symbol"], " = -n(n+1):" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["sturm[y_, x_, n_] := D[(1-x^2) y'[x], x] == -n(n+1) y[x]", "Input", AspectRatioFixed->True], Cell["Just to check:", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["sturm[LegendreP[5,#]&, x, 5]", "Input", AspectRatioFixed->True], Cell["Simplify[%]", "Input", AspectRatioFixed->True], Cell[TextData[{ "The boundary conditions that define the Legendre polynomials ", StyleBox["are", FontSlant->"Italic"], " of suitable form, since p(x) = 1 - x", StyleBox["2", FontVariations->{"CompatibilityType"->"Superscript"}], " vanishes at both ends, so we have a Hermitian operator and can expect" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "a. Real eigenvalues. Yes: ", StyleBox["\[Lambda]", FontFamily->"Symbol"], " = -n(n+1) with n = 0, 1, 2, ..." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["b. Orthogonal eigenfunctions.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["c. Completeness and closure.", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Orthogonality", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["The orthogonality relation is simply (since w(x) = 1) that", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ int[m_,n_] := \tIntegrate[LegendreP[m,x] LegendreP[n,x], {x,-1,1}]\ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ "should be zero if m ", StyleBox["\[NotEqual]", FontFamily->"Symbol"], " n. Let's try it:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" int[2,3]", "Input", AspectRatioFixed->True], Cell[" int[4,10]", "Input", AspectRatioFixed->True], Cell["Nice, huh? What about n = m?", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" int[4,4]", "Input", AspectRatioFixed->True], Cell[TextData[{ "It's ", StyleBox["not", FontSlant->"Italic"], " 1; the Legendre polynomials ", StyleBox["are", FontSlant->"Italic"], " orthogonal, but are ", StyleBox["not", FontSlant->"Italic"], " orthonormal. The general result is" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" int[n,n] = 2/(2n+1)", "Print", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ as can be shown by integrating the square of the generating \ function. Altogether, we have the relation\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " int[n,n] = 2 ", StyleBox["\[Delta]", FontFamily->"Symbol"], StyleBox["mn", FontVariations->{"CompatibilityType"->"Subscript"}], "/(2n+1)" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "where ", StyleBox[" ", FontFamily->"Courier", FontSize->12], StyleBox["\[Delta]", FontFamily->"Symbol", FontSize->12], StyleBox["mn", FontFamily->"Courier", FontSize->12, FontVariations->{"CompatibilityType"->"Subscript"}], StyleBox[" ", FontFamily->"Courier", FontSize->12], "is the Kronecker delta symbol (1 if m=n, otherwise 0)." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Orthogonality of Legendre ", StyleBox["Functions", FontSlant->"Italic"] }], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The set of Legendre functions P", StyleBox["\[Nu]", FontFamily->"Symbol", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) that we found earlier satisfying the boundary condition ", Cell[BoxData[ \(TraditionalForm\`\(\(P\_\[Nu]\)(x\_0\)\)]], ") = 0 are also orthogonal. They satisfy the same Sturm-Liouville \ equation, and the boundary conditions at x = ", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], " (vanish) and x=1 (don't blow up) are suitable homogeneous BCs. " }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Here again is my empirical way to calculate the ", StyleBox["\[Nu]", FontFamily->"Symbol"], "'s for ", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], " = 0.5, in case you restarted the notebook since then:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Clear[nu]; nu[k_] := nu[k] = n /. FindRoot[LegendreP[n, 0.5] == 0, \t\t{n, 3*k + 1.7, 3*k + 1.8}][[1]]; (* empirical *)\ \>", "Input", AspectRatioFixed->True], Cell[TextData[{ "Check the orthogonality for the 2nd and 3rd ", StyleBox["\[Nu]", FontFamily->"Symbol"], " (k starts at 0):" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ NIntegrate[LegendreP[nu[1],x]*LegendreP[nu[2],x], \t{x,0.5,1}]\ \>", "Input", AspectRatioFixed->True], Cell["Small enough for you?", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We could also compute the normalization, but it's nothing simple like \ 2/(2", StyleBox["\[Nu]", FontFamily->"Symbol"], "+1) and depends on the value of ", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], "." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Completeness and Legendre series", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Completeness means that we can expand any reasonable function f(x) (with \ -1 ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " x ", StyleBox["\[LessEqual]", FontFamily->"Symbol"], " 1) in a series of Legendre polynomials, and can expect convergence (at \ least \"in the mean\") as we take more and more terms. This is just like a \ Fourier series, but with P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) as the basis functions instead of cos(nx) and sin(nx). Thus we write \ (formally)" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " ", StyleBox["\[Infinity]", FontFamily->"Symbol"], "\nf(x) = ", StyleBox["\[Sum]", FontFamily->"Symbol", FontSize->16], " a", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], " P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)\n n=0" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "and determine the coefficients a", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], " from" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " 2n+1 1\na", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], " = ---- ", StyleBox["\[Integral]", FontFamily->"Symbol"], " f(x) P", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x) dx\n 2 -1" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Let's try it for ", StyleBox["Exp[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", numerically evaluating the coefficients up to n=6. We'll use the \ save-the-results trick again." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ a[n_] := a[n] = (2n+1)/2 * NIntegrate[Exp[x] LegendreP[n,x], {x,-1,1}]\ \>", "Input", AspectRatioFixed->True], Cell[" Table[a[n], {n,0,6}]", "Input", AspectRatioFixed->True], Cell["\<\ The coefficients are decreasing nicely, giving us some confidence \ in the result. Here is the resulting Legendre series:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["expfit[x_] = Expand[Sum[a[n] LegendreP[n,x], {n,0,6}]]", "Input", AspectRatioFixed->True], Cell[TextData[{ "I purposely used \"", StyleBox["=", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "\" rather than \"", StyleBox[":=", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], "\" here, to expand out the sum and do the ", StyleBox["Expand[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " to reduce it to a simple polynomial that, not surprisingly, looks rather \ like the exponential series. Let's plot it and the real ", StyleBox["Exp[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " together:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" Plot[{expfit[x],Exp[x]}, {x,-1,1}]", "Input", AspectRatioFixed->True], Cell["\<\ See the difference? No? They're on top of each other! Here's the \ actual difference:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" Plot[expfit[x]-Exp[x], {x,-1,1}]", "Input", AspectRatioFixed->True], Cell["\<\ Pretty small, eh? The biggest error is obviously at one of the \ endpoints, giving\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["error = Max[expfit[-1]-Exp[-1], Exp[1]-expfit[1]] //N", "Input", AspectRatioFixed->True], Cell["for the absolute maximum error.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Note: you'll need the above graph and absolute error for the last \ problem, so don't throw it away!\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Notice that the above graph looks rather like a (negative) multiple of the \ first term we omitted, P", StyleBox["7", FontVariations->{"CompatibilityType"->"Subscript"}], "(x):" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" Plot[LegendreP[7,x], {x,-1,1}]", "Input", AspectRatioFixed->True], Cell[TextData[{ "So adding one more term would do even better, and would magically leave a \ residue looking rather like P", StyleBox["8", FontVariations->{"CompatibilityType"->"Subscript"}], "(x). Aren't orthogonal functions wonderful!!" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ This technique can readily be transformed by a change of variable \ to perform function fitting on any finite range [a, b]. It's very useful if \ you compute a function numerically to create such a series to fit it, and \ then manipulate the series instead of the original function.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Legendre Series are much more suitable for fitting than plain power series \ (polynomial fits). The functions used in fitting with a polynomial are 1, \ x, x^2, x^3, ..., which are ", StyleBox["not", FontSlant->"Italic"], " orthogonal. This means, for example, that ", StyleBox[ "adding one more term changes the coefficients of all the earlier ones", FontSlant->"Italic"], ". On the other hand, with Legendre Series---or any other series based on \ orthogonal functions---the earlier coefficients are never affected by later \ ones." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Actually however, Legendre series aren't the best choice for this \ application, as we'll discuss shortly.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Chebyshev series", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ We just saw that you can use a Legendre series to fit an arbitrary \ function in the range [-1, 1]. And by a simple linear transformation z = c x \ +d you can obviously do the same in any finite interval [a,b].\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "But if you want to do this in practice for numerical reasons, you should \ consider using ", StyleBox["Chebyshev series", FontSlant->"Italic"], " rather than Legendre series. Chebyshev series are based on the \ orthogonal Chebyshev Polynomials; everything is very similar to the Legendre \ case, but different in detail. In particular the weight function is w(x) = \ 1/Sqrt(1-x^2) instead of just w(x) = 1. The reasons to prefer Chebyshev \ Series are:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "a. They minimize the maximum error incurred in fitting. They spread the \ error uniformly over the fitting domain (if the function is smooth), whereas \ with Legendre Series it tends to pile up at the ends of the range, as we saw \ in our ", StyleBox["Exp[]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], " example. Of course in both cases errors also get larger near \ singularities, such as near x=0 for fitting |x|." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ b. They are very easy to generate, without in the end having to do \ an integral for each coefficient.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "c. There are canned subroutines available to do the work. See, for \ example, ", StyleBox["Numerical Recipes", FontSlant->"Italic"], " by Press et al." }], "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Problem 4", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Construct a Chebyshev series for ", StyleBox["Exp[x]", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ", and compare it to the Legendre series we already generated. Plot the \ error, and find (approximately) the maximum error. You should find a much \ better distribution of error across the [-1, 1] range than for the Legendre \ case, and a maximum error that's over two times smaller." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Although there are ways (mentioned in b above) of avoiding an \ integration, you should just do it the straightforward way. The integrals \ may take a minute or two. Don't forget the weight function! The \ normalization integral is\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " 1 1 ( ", StyleBox["\[Pi]", FontFamily->"Symbol"], "/2 if n ", StyleBox["\[GreaterEqual]", FontFamily->"Symbol"], " 1\n", StyleBox[" \[Integral]", FontFamily->"Symbol"], " T", StyleBox["n", FontVariations->{"CompatibilityType"->"Subscript"}], "(x)", StyleBox["2", FontVariations->{"CompatibilityType"->"Superscript"}], " ----------- dx = (\n-1 Sqrt(1-x^2) ( ", StyleBox["\[Pi]", FontFamily->"Symbol"], " if n = 0" }], "Print", Evaluatable->False, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Closure", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Finally, let's look at closure. First we'll construct some truly \ orthonormal functions (we'd absorb the weight function w(x) too if there were \ one):\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" phi[n_,x_] := LegendreP[n,x] Sqrt[(2n+1)/2]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Now ", StyleBox["in principal", FontSlant->"Italic"], " we construct the sum" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ " ", StyleBox["\[Infinity]", FontFamily->"Symbol"], "\n ", StyleBox["\[Sum]", FontFamily->"Symbol"], " phi[n,x] phi[n,y]\n n=0" }], "Print", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "and show that it gives the Dirac delta function ", StyleBox["\[Delta]", FontFamily->"Symbol"], "(x-y)." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "But the infinite sum will take an infinite time in Mathematica, and the \ Dirac delta function is not easily representable anyhow. So let's compute a \ sum up to some ", StyleBox["nmax", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ". Also let's set y = 0 and focus on x:" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["closure[nmax_,x_] := Sum[phi[n,x] phi[n,0],{n,0,nmax}]", "Input", AspectRatioFixed->True], Cell[TextData[{ "Now let's plot this versus x for several values of ", StyleBox["nmax", FontFamily->"Courier", FontSize->12, FontWeight->"Bold"], ": (this may take a little while)" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Plot[Evaluate[Expand[ \t\t{closure[5,x], \t\t closure[10,x], \t\t closure[20,x], \t\t closure[40,x]} \t ]], {x,-1,1}, PlotRange->All]\ \>", "Input", AspectRatioFixed->True], Cell["\<\ So it's converging to a delta function at 0, as expected, though \ rather slowly.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True] }, Closed]] }, Closed]] }, FrontEndVersion->"4.2 for X", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{520, 600}, WindowMargins->{{Automatic, 164}, {Automatic, 158}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, 128}}, 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, CellLabelMargins->{{12, Inherited}, {Inherited, Inherited}}, ScriptMinSize->9], Cell[StyleData[All, "Presentation"], PageWidth->WindowWidth, CellLabelMargins->{{24, Inherited}, {Inherited, Inherited}}, ScriptMinSize->12], Cell[StyleData[All, "Condensed"], PageWidth->WindowWidth, CellLabelMargins->{{8, Inherited}, {Inherited, Inherited}}, ScriptMinSize->8], Cell[StyleData[All, "Printout"], PageWidth->PaperWidth, CellLabelMargins->{{2, Inherited}, {Inherited, Inherited}}, ScriptMinSize->5, 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, DefaultNewInlineCellStyle->"None", InputAutoReplacements->{"TeX"->StyleBox[ RowBox[ {"T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "LaTeX"->StyleBox[ RowBox[ {"L", StyleBox[ AdjustmentBox[ "A", BoxMargins -> {{-0.36, -0.1}, {0, -0}}, BoxBaselineShift -> -0.2], FontSize -> Smaller], "T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "mma"->"Mathematica", "Mma"->"Mathematica", "MMA"->"Mathematica"}, LanguageCategory->"NaturalLanguage", 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, DefaultNewInlineCellStyle->"None", InputAutoReplacements->{"TeX"->StyleBox[ RowBox[ {"T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "LaTeX"->StyleBox[ RowBox[ {"L", StyleBox[ AdjustmentBox[ "A", BoxMargins -> {{-0.36, -0.1}, {0, -0}}, BoxBaselineShift -> -0.2], FontSize -> Smaller], "T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "mma"->"Mathematica", "Mma"->"Mathematica", "MMA"->"Mathematica"}, LanguageCategory->"NaturalLanguage", 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, DefaultNewInlineCellStyle->"None", InputAutoReplacements->{"TeX"->StyleBox[ RowBox[ {"T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "LaTeX"->StyleBox[ RowBox[ {"L", StyleBox[ AdjustmentBox[ "A", BoxMargins -> {{-0.36, -0.1}, {0, -0}}, BoxBaselineShift -> -0.2], FontSize -> Smaller], "T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "mma"->"Mathematica", "Mma"->"Mathematica", "MMA"->"Mathematica"}, LanguageCategory->"NaturalLanguage", 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, DefaultNewInlineCellStyle->"None", InputAutoReplacements->{"TeX"->StyleBox[ RowBox[ {"T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "LaTeX"->StyleBox[ RowBox[ {"L", StyleBox[ AdjustmentBox[ "A", BoxMargins -> {{-0.36, -0.1}, {0, -0}}, BoxBaselineShift -> -0.2], FontSize -> Smaller], "T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "mma"->"Mathematica", "Mma"->"Mathematica", "MMA"->"Mathematica"}, LanguageCategory->"NaturalLanguage", 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, DefaultNewInlineCellStyle->"None", InputAutoReplacements->{"TeX"->StyleBox[ RowBox[ {"T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "LaTeX"->StyleBox[ RowBox[ {"L", StyleBox[ AdjustmentBox[ "A", BoxMargins -> {{-0.36, -0.1}, {0, -0}}, BoxBaselineShift -> -0.2], FontSize -> Smaller], "T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "mma"->"Mathematica", "Mma"->"Mathematica", "MMA"->"Mathematica"}, LanguageCategory->"NaturalLanguage", CounterIncrements->"Subsection", CounterAssignments->{{"Subsubsection", 0}}, FontFamily->"Times", 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, DefaultNewInlineCellStyle->"None", InputAutoReplacements->{"TeX"->StyleBox[ RowBox[ {"T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "LaTeX"->StyleBox[ RowBox[ {"L", StyleBox[ AdjustmentBox[ "A", BoxMargins -> {{-0.36, -0.1}, {0, -0}}, BoxBaselineShift -> -0.2], FontSize -> Smaller], "T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "mma"->"Mathematica", "Mma"->"Mathematica", "MMA"->"Mathematica"}, LanguageCategory->"NaturalLanguage", CounterIncrements->"Subsubsection", FontFamily->"Times", 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}}, InputAutoReplacements->{"TeX"->StyleBox[ RowBox[ {"T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "LaTeX"->StyleBox[ RowBox[ {"L", StyleBox[ AdjustmentBox[ "A", BoxMargins -> {{-0.36, -0.1}, {0, -0}}, BoxBaselineShift -> -0.2], FontSize -> Smaller], "T", AdjustmentBox[ "E", BoxMargins -> {{-0.075, -0.085}, {0, 0}}, BoxBaselineShift -> 0.5], "X"}]], "mma"->"Mathematica", "Mma"->"Mathematica", "MMA"->"Mathematica"}, Hyphenation->True, LineSpacing->{1, 3}, CounterIncrements->"Text"], Cell[StyleData["Text", "Presentation"], CellMargins->{{24, 10}, {10, 10}}, LineSpacing->{1, 5}, FontSize->16], Cell[StyleData["Text", "Condensed"], CellMargins->{{8, 10}, {6, 6}}, LineSpacing->{1, 1}, FontSize->11], Cell[StyleData["Text", "Printout"], CellMargins->{{2, 2}, {6, 6}}, TextJustification->0.5, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["SmallText"], CellMargins->{{12, 10}, {6, 6}}, DefaultNewInlineCellStyle->"None", Hyphenation->True, LineSpacing->{1, 3}, LanguageCategory->"NaturalLanguage", 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}}, TextJustification->0.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", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, DefaultFormatType->DefaultInputFormatType, HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, AutoItalicWords->{}, LanguageCategory->"Formula", FormatType->InputForm, ShowStringCharacters->True, NumberMarks->True, LinebreakAdjustments->{0.85, 2, 10, 0, 1}, CounterIncrements->"Input", FontWeight->"Bold"], Cell[StyleData["Input", "Presentation"], CellMargins->{{72, Inherited}, {8, 10}}, LineSpacing->{1, 0}, FontSize->16], Cell[StyleData["Input", "Condensed"], CellMargins->{{40, 10}, {2, 3}}, FontSize->11], Cell[StyleData["Input", "Printout"], CellMargins->{{39, 0}, {4, 6}}, LinebreakAdjustments->{0.85, 2, 10, 1, 1}, FontSize->9] }, Closed]], Cell[StyleData["InputOnly"], Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, DefaultFormatType->DefaultInputFormatType, HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, AutoItalicWords->{}, LanguageCategory->"Formula", FormatType->InputForm, ShowStringCharacters->True, NumberMarks->True, LinebreakAdjustments->{0.85, 2, 10, 0, 1}, 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, DefaultFormatType->DefaultOutputFormatType, HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, AutoItalicWords->{}, LanguageCategory->"Formula", FormatType->InputForm, CounterIncrements->"Output"], Cell[StyleData["Output", "Presentation"], CellMargins->{{72, Inherited}, {10, 8}}, LineSpacing->{1, 0}, FontSize->16], Cell[StyleData["Output", "Condensed"], CellMargins->{{41, Inherited}, {3, 2}}, FontSize->11], 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, DefaultFormatType->DefaultOutputFormatType, HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Message", StyleMenuListing->None, FontSize->11, FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Message", "Presentation"], CellMargins->{{72, Inherited}, {Inherited, Inherited}}, LineSpacing->{1, 0}, FontSize->16], Cell[StyleData["Message", "Condensed"], CellMargins->{{41, Inherited}, {Inherited, Inherited}}, FontSize->11], Cell[StyleData["Message", "Printout"], CellMargins->{{39, Inherited}, {Inherited, Inherited}}, FontSize->7, FontColor->GrayLevel[0]] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Print"], CellMargins->{{45, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, DefaultFormatType->DefaultOutputFormatType, HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, AutoItalicWords->{}, FormatType->InputForm, CounterIncrements->"Print", StyleMenuListing->None], Cell[StyleData["Print", "Presentation"], CellMargins->{{72, Inherited}, {Inherited, Inherited}}, LineSpacing->{1, 0}, FontSize->16], Cell[StyleData["Print", "Condensed"], CellMargins->{{41, Inherited}, {Inherited, Inherited}}, FontSize->11], 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, LanguageCategory->None, FormatType->InputForm, CounterIncrements->"Graphics", ImageMargins->{{43, Inherited}, {Inherited, 0}}, StyleMenuListing->None, FontFamily->"Courier", FontSize->10], 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}}, 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["Inline Formatting", "Section"], Cell["\<\ These styles are for modifying individual words or letters in a \ cell exclusive of the cell tag.\ \>", "Text"], Cell[StyleData["RM"], StyleMenuListing->None, FontWeight->"Plain", FontSlant->"Plain"], Cell[StyleData["BF"], StyleMenuListing->None, FontWeight->"Bold"], Cell[StyleData["IT"], StyleMenuListing->None, FontSlant->"Italic"], Cell[StyleData["TR"], StyleMenuListing->None, FontFamily->"Times", FontWeight->"Plain", FontSlant->"Plain"], Cell[StyleData["TI"], StyleMenuListing->None, FontFamily->"Times", FontWeight->"Plain", FontSlant->"Italic"], Cell[StyleData["TB"], StyleMenuListing->None, FontFamily->"Times", FontWeight->"Bold", FontSlant->"Plain"], Cell[StyleData["TBI"], StyleMenuListing->None, FontFamily->"Times", FontWeight->"Bold", FontSlant->"Italic"], Cell[StyleData["MR"], StyleMenuListing->None, FontFamily->"Courier", FontWeight->"Plain", FontSlant->"Plain"], Cell[StyleData["MO"], StyleMenuListing->None, FontFamily->"Courier", FontWeight->"Plain", FontSlant->"Italic"], Cell[StyleData["MB"], StyleMenuListing->None, FontFamily->"Courier", FontWeight->"Bold", FontSlant->"Plain"], Cell[StyleData["MBO"], StyleMenuListing->None, FontFamily->"Courier", FontWeight->"Bold", FontSlant->"Italic"], Cell[StyleData["SR"], StyleMenuListing->None, FontFamily->"Helvetica", FontWeight->"Plain", FontSlant->"Plain"], Cell[StyleData["SO"], StyleMenuListing->None, FontFamily->"Helvetica", FontWeight->"Plain", FontSlant->"Italic"], Cell[StyleData["SB"], StyleMenuListing->None, FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Plain"], Cell[StyleData["SBO"], StyleMenuListing->None, FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Italic"], Cell[CellGroupData[{ Cell[StyleData["SO10"], StyleMenuListing->None, FontFamily->"Helvetica", FontSize->10, FontWeight->"Plain", FontSlant->"Italic"], Cell[StyleData["SO10", "Printout"], StyleMenuListing->None, FontFamily->"Helvetica", FontSize->7, FontWeight->"Plain", FontSlant->"Italic"], Cell[StyleData["SO10", "EnhancedPrintout"], StyleMenuListing->None, FontFamily->"Futura", FontSize->7, FontWeight->"Plain", FontSlant->"Italic"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Formulas and Programming", "Section"], Cell[CellGroupData[{ Cell[StyleData["InlineFormula"], CellMargins->{{10, 4}, {0, 8}}, CellHorizontalScrolling->True, HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, LanguageCategory->"Formula", ScriptLevel->1, SingleLetterItalics->True], Cell[StyleData["InlineFormula", "Presentation"], CellMargins->{{24, 10}, {10, 10}}, LineSpacing->{1, 5}, FontSize->16], Cell[StyleData["InlineFormula", "Condensed"], CellMargins->{{8, 10}, {6, 6}}, LineSpacing->{1, 1}, FontSize->11], Cell[StyleData["InlineFormula", "Printout"], CellMargins->{{2, 0}, {6, 6}}, FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["DisplayFormula"], CellMargins->{{42, Inherited}, {Inherited, Inherited}}, CellHorizontalScrolling->True, DefaultFormatType->DefaultInputFormatType, HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"}, LanguageCategory->"Formula", ScriptLevel->0, SingleLetterItalics->True, UnderoverscriptBoxOptions->{LimitsPositioning->True}], Cell[StyleData["DisplayFormula", "Presentation"], LineSpacing->{1, 5}, FontSize->16], Cell[StyleData["DisplayFormula", "Condensed"], LineSpacing->{1, 1}, FontSize->11], Cell[StyleData["DisplayFormula", "Printout"], FontSize->10] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["Program"], CellFrame->{{0, 0}, {0.5, 0.5}}, CellMargins->{{10, 4}, {0, 8}}, CellHorizontalScrolling->True, Hyphenation->False, LanguageCategory->"Formula", ScriptLevel->1, FontFamily->"Courier"], Cell[StyleData["Program", "Presentation"], CellMargins->{{24, 10}, {10, 10}}, LineSpacing->{1, 5}, FontSize->16], Cell[StyleData["Program", "Condensed"], CellMargins->{{8, 10}, {6, 6}}, LineSpacing->{1, 1}, FontSize->11], Cell[StyleData["Program", "Printout"], CellMargins->{{2, 0}, {6, 6}}, FontSize->9] }, Closed]] }, 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"], FontSize->16], Cell[StyleData["Hyperlink", "Condensed"], FontSize->11], Cell[StyleData["Hyperlink", "Printout"], FontSize->10, 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"], FontSize->16], Cell[StyleData["MainBookLink", "Condensed"], FontSize->11], Cell[StyleData["MainBookLink", "Printout"], FontSize->10, 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"], FontSize->16], Cell[StyleData["AddOnsLink", "Condensed"], FontSize->11], Cell[StyleData["AddOnsLink", "Printout"], FontSize->10, 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[ "RefGuide", #]}]&), Active->True, ButtonFrame->"None"}], Cell[StyleData["RefGuideLink", "Presentation"], FontSize->16], Cell[StyleData["RefGuideLink", "Condensed"], FontSize->11], Cell[StyleData["RefGuideLink", "Printout"], FontSize->10, 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"], FontSize->16], Cell[StyleData["GettingStartedLink", "Condensed"], FontSize->11], Cell[StyleData["GettingStartedLink", "Printout"], FontSize->10, 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"], FontSize->16], Cell[StyleData["OtherInformationLink", "Condensed"], FontSize->11], Cell[StyleData["OtherInformationLink", "Printout"], FontSize->10, FontColor->GrayLevel[0], FontVariations->{"Underline"->False}] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Headers and Footers", "Section"], Cell[StyleData["Header"], CellMargins->{{0, 0}, {4, 1}}, DefaultNewInlineCellStyle->"None", LanguageCategory->"NaturalLanguage", StyleMenuListing->None, FontSize->10, FontSlant->"Italic"], Cell[StyleData["Footer"], CellMargins->{{0, 0}, {0, 4}}, DefaultNewInlineCellStyle->"None", LanguageCategory->"NaturalLanguage", 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["Placeholder Styles", "Section"], Cell["\<\ The cells below define styles useful for making placeholder \ objects in palette templates.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["Placeholder"], Placeholder->True, StyleMenuListing->None, FontSlant->"Italic", FontColor->RGBColor[0.890623, 0.864698, 0.384756], TagBoxOptions->{Editable->False, Selectable->False, StripWrapperBoxes->False}], Cell[StyleData["Placeholder", "Presentation"]], Cell[StyleData["Placeholder", "Condensed"]], Cell[StyleData["Placeholder", "Printout"]] }, Closed]], Cell[CellGroupData[{ Cell[StyleData["PrimaryPlaceholder"], StyleMenuListing->None, DrawHighlighted->True, FontSlant->"Italic", Background->RGBColor[0.912505, 0.891798, 0.507774], TagBoxOptions->{Editable->False, Selectable->False, StripWrapperBoxes->False}], Cell[StyleData["PrimaryPlaceholder", "Presentation"]], Cell[StyleData["PrimaryPlaceholder", "Condensed"]], Cell[StyleData["PrimaryPlaceholder", "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, Hyphenation->False, AutoItalicWords->{}, StyleMenuListing->None, FontFamily->"Courier", FontSize->12, Background->GrayLevel[1]], Cell[StyleData["InputForm"], InputAutoReplacements->{}, AllowInlineCells->False, Hyphenation->False, StyleMenuListing->None, FontFamily->"Courier"], Cell[StyleData["OutputForm"], PageWidth->Infinity, TextAlignment->Left, LineSpacing->{0.6, 1}, StyleMenuListing->None, FontFamily->"Courier"], Cell[StyleData["StandardForm"], InputAutoReplacements->{ "->"->"\[Rule]", ":>"->"\[RuleDelayed]", "<="->"\[LessEqual]", ">="->"\[GreaterEqual]", "!="->"\[NotEqual]", "=="->"\[Equal]", Inherited}, LineSpacing->{1.25, 0}, StyleMenuListing->None, FontFamily->"Courier"], Cell[StyleData["TraditionalForm"], InputAutoReplacements->{ "->"->"\[Rule]", ":>"->"\[RuleDelayed]", "<="->"\[LessEqual]", ">="->"\[GreaterEqual]", "!="->"\[NotEqual]", "=="->"\[Equal]", Inherited}, 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]], Cell[CellGroupData[{ Cell["Automatic Styles", "Section"], Cell["\<\ The cells below define styles that are used to affect the display \ of certain types of objects in typeset expressions. For example, \ \"UnmatchedBracket\" style defines how unmatched bracket, curly bracket, and \ parenthesis characters are displayed (typically by coloring them to make them \ stand out).\ \>", "Text"], Cell[StyleData["UnmatchedBracket"], StyleMenuListing->None, FontColor->RGBColor[0.760006, 0.330007, 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, 99, 2, 160, "Title", Evaluatable->False], Cell[1856, 55, 107, 3, 53, "Subsubtitle", Evaluatable->False], Cell[CellGroupData[{ Cell[1988, 62, 46, 0, 45, "Subsection"], Cell[2037, 64, 320, 8, 68, "Text"], Cell[2360, 74, 725, 15, 158, "Text"], Cell[3088, 91, 112, 4, 50, "Text"], Cell[3203, 97, 267, 10, 50, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[3507, 112, 77, 2, 29, "Subsection", Evaluatable->False], Cell[3587, 116, 554, 14, 102, "Text", Evaluatable->False], Cell[4144, 132, 549, 20, 68, "Text", Evaluatable->False], Cell[4696, 154, 613, 14, 112, "Text", Evaluatable->False], Cell[5312, 170, 157, 5, 32, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[5506, 180, 88, 2, 35, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[5619, 186, 83, 2, 45, "Subsection", Evaluatable->False], Cell[5705, 190, 464, 15, 58, "Text", Evaluatable->False], Cell[6172, 207, 58, 1, 27, "Input"], Cell[6233, 210, 59, 1, 27, "Input"], Cell[6295, 213, 225, 9, 32, "Text", Evaluatable->False], Cell[6523, 224, 76, 1, 27, "Input"], Cell[6602, 227, 255, 9, 32, "Text", Evaluatable->False], Cell[6860, 238, 56, 1, 27, "Input"], Cell[6919, 241, 541, 19, 68, "Text", Evaluatable->False], Cell[7463, 262, 378, 9, 76, "Text", Evaluatable->False], Cell[7844, 273, 156, 4, 25, "InlineFormula"], Cell[8003, 279, 202, 7, 40, "Text", Evaluatable->False], Cell[8208, 288, 424, 14, 50, "Text", Evaluatable->False], Cell[8635, 304, 79, 1, 27, "Input"], Cell[8717, 307, 479, 15, 68, "Text", Evaluatable->False], Cell[9199, 324, 56, 1, 27, "Input"], Cell[9258, 327, 283, 8, 50, "Text", Evaluatable->False], Cell[9544, 337, 126, 3, 42, "Input"], Cell[9673, 342, 515, 19, 58, "Text", Evaluatable->False], Cell[10191, 363, 370, 16, 31, "Print", Evaluatable->False], Cell[10564, 381, 328, 11, 50, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[10929, 397, 81, 2, 29, "Subsection", Evaluatable->False], Cell[11013, 401, 566, 17, 70, "Text", Evaluatable->False], Cell[11582, 420, 94, 1, 70, "Input"], Cell[11679, 423, 398, 13, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[12114, 441, 80, 2, 29, "Subsection", Evaluatable->False], Cell[12197, 445, 210, 9, 70, "Text", Evaluatable->False], Cell[12410, 456, 48, 1, 70, "Input"], Cell[12461, 459, 394, 13, 70, "Text", Evaluatable->False], Cell[12858, 474, 92, 1, 70, "Input"], Cell[12953, 477, 664, 24, 70, "Text", Evaluatable->False], Cell[13620, 503, 452, 18, 70, "Text", Evaluatable->False], Cell[14075, 523, 225, 7, 70, "Text", Evaluatable->False], Cell[14303, 532, 295, 9, 70, "Text", Evaluatable->False], Cell[14601, 543, 539, 20, 70, "Text", Evaluatable->False], Cell[15143, 565, 876, 29, 70, "Text", Evaluatable->False], Cell[16022, 596, 537, 20, 70, "Text", Evaluatable->False], Cell[16562, 618, 95, 2, 70, "Print", Evaluatable->False], Cell[16660, 622, 116, 2, 70, "Text", Evaluatable->False], Cell[16779, 626, 781, 27, 70, "Text", Evaluatable->False], Cell[17563, 655, 49, 1, 70, "Input"], Cell[17615, 658, 124, 2, 70, "Text", Evaluatable->False], Cell[17742, 662, 59, 1, 70, "Input"], Cell[17804, 665, 545, 24, 70, "Text", Evaluatable->False], Cell[18352, 691, 487, 20, 70, "Text", Evaluatable->False], Cell[18842, 713, 198, 7, 70, "Text", Evaluatable->False], Cell[19043, 722, 327, 11, 70, "Text", Evaluatable->False], Cell[19373, 735, 92, 1, 70, "Input"], Cell[19468, 738, 557, 19, 70, "Text", Evaluatable->False], Cell[20028, 759, 934, 25, 70, "Text", Evaluatable->False], Cell[20965, 786, 130, 6, 70, "Print", Evaluatable->False], Cell[21098, 794, 878, 34, 70, "Text", Evaluatable->False], Cell[21979, 830, 437, 15, 70, "Text", Evaluatable->False], Cell[22419, 847, 370, 14, 70, "Text", Evaluatable->False], Cell[22792, 863, 148, 5, 70, "Input"], Cell[22943, 870, 1476, 54, 70, "Text", Evaluatable->False], Cell[24422, 926, 462, 15, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[24921, 946, 75, 2, 29, "Subsection", Evaluatable->False], Cell[24999, 950, 143, 5, 70, "Text", Evaluatable->False], Cell[25145, 957, 115, 4, 70, "Input"], Cell[25263, 963, 83, 2, 70, "Text", Evaluatable->False], Cell[25349, 967, 485, 16, 70, "Text", Evaluatable->False], Cell[25837, 985, 223, 7, 70, "Text", Evaluatable->False], Cell[26063, 994, 451, 13, 70, "Text", Evaluatable->False], Cell[26517, 1009, 220, 6, 70, "Text", Evaluatable->False], Cell[26740, 1017, 478, 19, 70, "Text", Evaluatable->False], Cell[27221, 1038, 182, 6, 70, "Text", Evaluatable->False], Cell[27406, 1046, 115, 4, 70, "Input"], Cell[27524, 1052, 493, 14, 70, "Text", Evaluatable->False], Cell[28020, 1068, 66, 1, 70, "Input"], Cell[28089, 1071, 290, 8, 70, "Text", Evaluatable->False], Cell[28382, 1081, 986, 33, 70, "Text", Evaluatable->False], Cell[29371, 1116, 350, 13, 70, "Text", Evaluatable->False], Cell[29724, 1131, 158, 3, 70, "Input"], Cell[29885, 1136, 269, 6, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[30191, 1147, 79, 2, 29, "Subsection", Evaluatable->False], Cell[30273, 1151, 646, 15, 70, "Text", Evaluatable->False], Cell[30922, 1168, 362, 11, 70, "Text", Evaluatable->False], Cell[31287, 1181, 393, 9, 70, "Text", Evaluatable->False], Cell[31683, 1192, 422, 13, 70, "Text", Evaluatable->False], Cell[32108, 1207, 219, 7, 70, "Text", Evaluatable->False] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[32376, 1220, 90, 2, 35, "Section", Evaluatable->False], Cell[32469, 1224, 230, 6, 70, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[32724, 1234, 88, 2, 70, "Subsection", Evaluatable->False], Cell[32815, 1238, 391, 11, 70, "Text", Evaluatable->False], Cell[33209, 1251, 224, 7, 70, "Text", Evaluatable->False], Cell[33436, 1260, 161, 5, 70, "Text", Evaluatable->False], Cell[33600, 1267, 114, 2, 70, "Text", Evaluatable->False], Cell[33717, 1271, 91, 2, 70, "Text", Evaluatable->False], Cell[33811, 1275, 153, 5, 70, "Text", Evaluatable->False], Cell[33967, 1282, 96, 2, 70, "Text", Evaluatable->False], Cell[34066, 1286, 230, 10, 70, "Text", Evaluatable->False], Cell[34299, 1298, 93, 2, 70, "Text", Evaluatable->False], Cell[34395, 1302, 133, 5, 70, "Text", Evaluatable->False], Cell[34531, 1309, 276, 8, 70, "InlineFormula"], Cell[34810, 1319, 66, 2, 70, "Text", Evaluatable->False], Cell[34879, 1323, 84, 1, 70, "Input"], Cell[34966, 1326, 654, 23, 70, "Text", Evaluatable->False], Cell[35623, 1351, 50, 1, 70, "Input"], Cell[35676, 1354, 252, 9, 70, "Text", Evaluatable->False], Cell[35931, 1365, 42, 1, 70, "Input"], Cell[35976, 1368, 110, 2, 70, "Text", Evaluatable->False], Cell[36089, 1372, 58, 1, 70, "Input"], Cell[36150, 1375, 92, 2, 70, "Text", Evaluatable->False], Cell[36245, 1379, 59, 1, 70, "Input"], Cell[36307, 1382, 59, 1, 70, "Input"], Cell[36369, 1385, 199, 5, 70, "Text", Evaluatable->False], Cell[36571, 1392, 222, 9, 70, "Text", Evaluatable->False], Cell[36796, 1403, 265, 10, 70, "Text", Evaluatable->False], Cell[37064, 1415, 264, 9, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[37365, 1429, 184, 7, 70, "Subsection", Evaluatable->False], Cell[37552, 1438, 763, 22, 70, "Text", Evaluatable->False], Cell[38318, 1462, 423, 16, 70, "Info", Evaluatable->False], Cell[38744, 1480, 350, 11, 70, "Text", Evaluatable->False], Cell[39097, 1493, 91, 1, 70, "Input"], Cell[39191, 1496, 81, 2, 70, "Text", Evaluatable->False], Cell[39275, 1500, 74, 1, 70, "Input"], Cell[39352, 1503, 75, 2, 70, "Text", Evaluatable->False], Cell[39430, 1507, 297, 10, 70, "Text", Evaluatable->False], Cell[39730, 1519, 91, 1, 70, "Input"], Cell[39824, 1522, 81, 2, 70, "Text", Evaluatable->False], Cell[39908, 1526, 50, 1, 70, "Input"], Cell[39961, 1529, 50, 1, 70, "Input"], Cell[40014, 1532, 52, 1, 70, "Input"], Cell[40069, 1535, 1757, 69, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[41863, 1609, 80, 2, 70, "Subsection", Evaluatable->False], Cell[41946, 1613, 650, 22, 70, "Text", Evaluatable->False], Cell[42599, 1637, 144, 4, 70, "Input"], Cell[42746, 1643, 609, 19, 70, "Text", Evaluatable->False], Cell[43358, 1664, 79, 2, 70, "Text", Evaluatable->False], Cell[43440, 1668, 86, 1, 70, "Input"], Cell[43529, 1671, 255, 6, 70, "Text", Evaluatable->False], Cell[43787, 1679, 144, 4, 70, "Input"], Cell[43934, 1685, 86, 1, 70, "Input"], Cell[44023, 1688, 266, 6, 70, "Text", Evaluatable->False], Cell[44292, 1696, 141, 5, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[44470, 1706, 91, 2, 70, "Subsection", Evaluatable->False], Cell[44564, 1710, 275, 10, 70, "Text", Evaluatable->False], Cell[44842, 1722, 51, 1, 70, "Input"], Cell[44896, 1725, 205, 5, 70, "Text", Evaluatable->False], Cell[45104, 1732, 61, 1, 70, "Input"], Cell[45168, 1735, 531, 20, 70, "Text", Evaluatable->False], Cell[45702, 1757, 102, 1, 70, "Input"], Cell[45807, 1760, 50, 1, 70, "Input"], Cell[45860, 1763, 51, 1, 70, "Input"], Cell[45914, 1766, 282, 10, 70, "Text", Evaluatable->False], Cell[46199, 1778, 51, 1, 70, "Input"], Cell[46253, 1781, 50, 1, 70, "Input"], Cell[46306, 1784, 472, 15, 70, "Text", Evaluatable->False], Cell[46781, 1801, 120, 4, 70, "Input"], Cell[46904, 1807, 79, 2, 70, "Text", Evaluatable->False], Cell[46986, 1811, 50, 1, 70, "Input"], Cell[47039, 1814, 51, 1, 70, "Input"], Cell[47093, 1817, 50, 1, 70, "Input"], Cell[47146, 1820, 365, 14, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[47548, 1839, 100, 2, 70, "Subsection", Evaluatable->False], Cell[47651, 1843, 436, 12, 70, "Text", Evaluatable->False], Cell[48090, 1857, 64, 1, 70, "Input"], Cell[48157, 1860, 314, 10, 70, "Text", Evaluatable->False], Cell[48474, 1872, 258, 9, 70, "Text", Evaluatable->False], Cell[48735, 1883, 63, 1, 70, "Input"], Cell[48801, 1886, 447, 19, 70, "Text", Evaluatable->False], Cell[49251, 1907, 448, 17, 70, "Text", Evaluatable->False], Cell[49702, 1926, 111, 2, 70, "Text", Evaluatable->False], Cell[49816, 1930, 678, 28, 70, "Text", Evaluatable->False], Cell[50497, 1960, 101, 2, 70, "Text", Evaluatable->False], Cell[50601, 1964, 434, 11, 70, "Text", Evaluatable->False], Cell[51038, 1977, 53, 1, 70, "Input"], Cell[51094, 1980, 57, 1, 70, "Input"], Cell[51154, 1983, 63, 1, 70, "Input"], Cell[51220, 1986, 63, 1, 70, "Input"], Cell[51286, 1989, 73, 1, 70, "Input"], Cell[51362, 1992, 63, 1, 70, "Input"], Cell[51428, 1995, 59, 1, 70, "Input"], Cell[51490, 1998, 63, 1, 70, "Input"], Cell[51556, 2001, 70, 1, 70, "Input"], Cell[51629, 2004, 80, 1, 70, "Input"], Cell[51712, 2007, 323, 11, 70, "Text", Evaluatable->False], Cell[52038, 2020, 733, 22, 70, "Text", Evaluatable->False], Cell[52774, 2044, 563, 19, 70, "Text", Evaluatable->False], Cell[53340, 2065, 396, 14, 70, "Text", Evaluatable->False], Cell[53739, 2081, 410, 17, 70, "Text", Evaluatable->False], Cell[54152, 2100, 529, 18, 70, "Text", Evaluatable->False], Cell[54684, 2120, 53, 1, 70, "Input"], Cell[54740, 2123, 764, 30, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[55541, 2158, 79, 2, 70, "Subsection", Evaluatable->False], Cell[55623, 2162, 148, 5, 70, "Text", Evaluatable->False], Cell[55774, 2169, 243, 9, 70, "Text", Evaluatable->False], Cell[56020, 2180, 225, 9, 70, "Text", Evaluatable->False], Cell[56248, 2191, 240, 5, 70, "InlineFormula"], Cell[56491, 2198, 116, 2, 70, "Text", Evaluatable->False], Cell[56610, 2202, 533, 12, 70, "Text", Evaluatable->False], Cell[57146, 2216, 370, 14, 70, "Text", Evaluatable->False] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[57565, 2236, 97, 2, 35, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[57687, 2242, 86, 2, 70, "Subsection", Evaluatable->False], Cell[57776, 2246, 208, 6, 70, "Text", Evaluatable->False], Cell[57987, 2254, 96, 1, 70, "Input"], Cell[58086, 2257, 634, 26, 70, "Text", Evaluatable->False], Cell[58723, 2285, 49, 1, 70, "Input"], Cell[58775, 2288, 373, 11, 70, "Text", Evaluatable->False], Cell[59151, 2301, 66, 1, 70, "Input"], Cell[59220, 2304, 49, 1, 70, "Input"], Cell[59272, 2307, 54, 1, 70, "Input"], Cell[59329, 2310, 116, 2, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[59482, 2317, 97, 2, 70, "Subsection", Evaluatable->False], Cell[59582, 2321, 508, 18, 70, "Text", Evaluatable->False], Cell[60093, 2341, 51, 1, 70, "Input"], Cell[60147, 2344, 76, 1, 70, "Input"], Cell[60226, 2347, 1092, 44, 70, "Text", Evaluatable->False], Cell[61321, 2393, 78, 1, 70, "Input"], Cell[61402, 2396, 54, 1, 70, "Input"], Cell[61459, 2399, 171, 5, 70, "Text", Evaluatable->False], Cell[61633, 2406, 139, 5, 70, "Input"], Cell[61775, 2413, 390, 14, 70, "Text", Evaluatable->False], Cell[62168, 2429, 66, 1, 70, "Input"], Cell[62237, 2432, 380, 15, 70, "Text", Evaluatable->False], Cell[62620, 2449, 51, 1, 70, "Input"], Cell[62674, 2452, 82, 2, 70, "Text", Evaluatable->False], Cell[62759, 2456, 65, 1, 70, "Input"], Cell[62827, 2459, 223, 9, 70, "Text", Evaluatable->False], Cell[63053, 2470, 115, 2, 70, "Text", Evaluatable->False], Cell[63171, 2474, 322, 9, 70, "Print", Evaluatable->False], Cell[63496, 2485, 741, 23, 70, "Text", Evaluatable->False], Cell[64240, 2510, 195, 5, 70, "Text", Evaluatable->False], Cell[64438, 2517, 634, 21, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[65109, 2543, 207, 7, 70, "Subsection", Evaluatable->False], Cell[65319, 2552, 540, 15, 70, "Text", Evaluatable->False], Cell[65862, 2569, 1710, 55, 70, "Text", Evaluatable->False], Cell[67575, 2626, 322, 12, 70, "Text", Evaluatable->False], Cell[67900, 2640, 57, 1, 70, "Input"], Cell[67960, 2643, 57, 1, 70, "Input"], Cell[68020, 2646, 57, 1, 70, "Input"], Cell[68080, 2649, 93, 2, 70, "Text", Evaluatable->False], Cell[68176, 2653, 335, 13, 70, "InlineFormula"], Cell[68514, 2668, 247, 6, 70, "Print", Evaluatable->False], Cell[68764, 2676, 109, 2, 70, "Text", Evaluatable->False], Cell[68876, 2680, 217, 8, 70, "InlineFormula"], Cell[69096, 2690, 153, 5, 70, "Text", Evaluatable->False], Cell[69252, 2697, 103, 1, 70, "Input"], Cell[69358, 2700, 169, 5, 70, "Text", Evaluatable->False], Cell[69530, 2707, 74, 2, 70, "Text", Evaluatable->False], Cell[69607, 2711, 189, 7, 70, "Text", Evaluatable->False], Cell[69799, 2720, 1024, 22, 70, "Text", Evaluatable->False], Cell[70826, 2744, 734, 19, 70, "Text", Evaluatable->False], Cell[71563, 2765, 427, 10, 70, "Text", Evaluatable->False], Cell[71993, 2777, 119, 4, 70, "Input"], Cell[72115, 2783, 95, 2, 70, "Text", Evaluatable->False], Cell[72213, 2787, 272, 8, 70, "Text", Evaluatable->False], Cell[72488, 2797, 260, 10, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[72785, 2812, 106, 2, 70, "Subsection", Evaluatable->False], Cell[72894, 2816, 1082, 32, 70, "Text", Evaluatable->False], Cell[73979, 2850, 224, 7, 70, "Text", Evaluatable->False], Cell[74206, 2859, 870, 28, 70, "Text", Evaluatable->False], Cell[75079, 2889, 331, 9, 70, "Text", Evaluatable->False], Cell[75413, 2900, 62, 1, 70, "Input"], Cell[75478, 2903, 64, 1, 70, "Input"], Cell[75545, 2906, 77, 1, 70, "Input"], Cell[75625, 2909, 48, 1, 70, "Input"], Cell[75676, 2912, 175, 7, 70, "Text", Evaluatable->False], Cell[75854, 2921, 117, 4, 70, "Input"], Cell[75974, 2927, 69, 2, 70, "Text", Evaluatable->False], Cell[76046, 2931, 201, 8, 70, "Text", Evaluatable->False], Cell[76250, 2941, 296, 8, 70, "Text", Evaluatable->False], Cell[76549, 2951, 97, 2, 70, "Text", Evaluatable->False], Cell[76649, 2955, 220, 8, 70, "Text", Evaluatable->False], Cell[76872, 2965, 521, 20, 70, "Text", Evaluatable->False], Cell[77396, 2987, 961, 28, 70, "Text", Evaluatable->False], Cell[78360, 3017, 322, 9, 70, "Input"], Cell[78685, 3028, 94, 2, 70, "Text", Evaluatable->False], Cell[78782, 3032, 102, 1, 70, "Input"], Cell[78887, 3035, 124, 2, 70, "Text", Evaluatable->False] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[79060, 3043, 111, 2, 35, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[79196, 3049, 82, 2, 70, "Subsection", Evaluatable->False], Cell[79281, 3053, 202, 7, 70, "Text", Evaluatable->False], Cell[79486, 3062, 343, 13, 70, "Text", Evaluatable->False], Cell[79832, 3077, 571, 20, 70, "Print", Evaluatable->False], Cell[80406, 3099, 396, 12, 70, "Text", Evaluatable->False], Cell[80805, 3113, 271, 13, 70, "Print", Evaluatable->False], Cell[81079, 3128, 288, 8, 70, "Text", Evaluatable->False], Cell[81370, 3138, 919, 30, 70, "Print", Evaluatable->False], Cell[82292, 3170, 289, 8, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[82618, 3183, 77, 2, 70, "Subsection", Evaluatable->False], Cell[82698, 3187, 114, 2, 70, "Text", Evaluatable->False], Cell[82815, 3191, 80, 1, 70, "Input"], Cell[82898, 3194, 89, 2, 70, "Text", Evaluatable->False], Cell[82990, 3198, 70, 1, 70, "Input"], Cell[83063, 3201, 406, 11, 70, "Text", Evaluatable->False], Cell[83472, 3214, 59, 1, 70, "Input"], Cell[83534, 3217, 198, 7, 70, "Text", Evaluatable->False], Cell[83735, 3226, 46, 1, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[83818, 3232, 93, 2, 70, "Subsection", Evaluatable->False], Cell[83914, 3236, 375, 13, 70, "Text", Evaluatable->False], Cell[84292, 3251, 850, 33, 70, "Text", Evaluatable->False], Cell[85145, 3286, 68, 1, 70, "Input"], Cell[85216, 3289, 406, 13, 70, "Text", Evaluatable->False], Cell[85625, 3304, 57, 1, 70, "Input"], Cell[85685, 3307, 153, 5, 70, "Text", Evaluatable->False], Cell[85841, 3314, 92, 2, 70, "Text", Evaluatable->False], Cell[85936, 3318, 46, 1, 70, "Input"], Cell[85985, 3321, 381, 11, 70, "Text", Evaluatable->False], Cell[86369, 3334, 256, 9, 70, "Text", Evaluatable->False], Cell[86628, 3345, 54, 1, 70, "Input"], Cell[86685, 3348, 319, 10, 70, "Text", Evaluatable->False], Cell[87007, 3360, 57, 1, 70, "Input"], Cell[87067, 3363, 275, 10, 70, "Text", Evaluatable->False], Cell[87345, 3375, 48, 1, 70, "Input"], Cell[87396, 3378, 54, 1, 70, "Input"], Cell[87453, 3381, 404, 14, 70, "Text", Evaluatable->False], Cell[87860, 3397, 71, 1, 70, "Input"], Cell[87934, 3400, 87, 2, 70, "Text", Evaluatable->False], Cell[88024, 3404, 717, 24, 70, "Text", Evaluatable->False], Cell[88744, 3430, 57, 1, 70, "Input"], Cell[88804, 3433, 111, 2, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[88952, 3440, 90, 2, 70, "Subsection", Evaluatable->False], Cell[89045, 3444, 230, 6, 70, "Text", Evaluatable->False], Cell[89278, 3452, 370, 13, 70, "Print", Evaluatable->False], Cell[89651, 3467, 67, 2, 70, "Text", Evaluatable->False], Cell[89721, 3471, 370, 13, 70, "Print", Evaluatable->False], Cell[90094, 3486, 117, 2, 70, "Text", Evaluatable->False], Cell[90214, 3490, 104, 2, 70, "Text", Evaluatable->False], Cell[90321, 3494, 214, 7, 70, "Text", Evaluatable->False], Cell[90538, 3503, 539, 18, 70, "Text", Evaluatable->False], Cell[91080, 3523, 132, 5, 70, "Input"], Cell[91215, 3530, 74, 2, 70, "Text", Evaluatable->False], Cell[91292, 3534, 50, 1, 70, "Input"], Cell[91345, 3537, 52, 1, 70, "Input"], Cell[91400, 3540, 94, 2, 70, "Text", Evaluatable->False], Cell[91497, 3544, 57, 1, 70, "Input"], Cell[91557, 3547, 456, 13, 70, "Text", Evaluatable->False], Cell[92016, 3562, 666, 15, 70, "Text", Evaluatable->False], Cell[92685, 3579, 489, 15, 70, "Text", Evaluatable->False], Cell[93177, 3596, 345, 9, 70, "Text", Evaluatable->False], Cell[93525, 3607, 197, 9, 70, "Input"], Cell[93725, 3618, 251, 9, 70, "Text", Evaluatable->False], Cell[93979, 3629, 52, 1, 70, "Input"], Cell[94034, 3632, 590, 23, 70, "Text", Evaluatable->False], Cell[94627, 3657, 287, 10, 70, "Text", Evaluatable->False], Cell[94917, 3669, 218, 10, 70, "Input"], Cell[95138, 3681, 383, 14, 70, "Text", Evaluatable->False], Cell[95524, 3697, 50, 1, 70, "Input"], Cell[95577, 3700, 50, 1, 70, "Input"], Cell[95630, 3703, 360, 14, 70, "Text", Evaluatable->False], Cell[95993, 3719, 46, 1, 70, "Input"], Cell[96042, 3722, 229, 9, 70, "Text", Evaluatable->False], Cell[96274, 3733, 94, 2, 70, "Print", Evaluatable->False], Cell[96371, 3737, 331, 10, 70, "Text", Evaluatable->False], Cell[96705, 3749, 155, 5, 70, "Text", Evaluatable->False], Cell[96863, 3756, 555, 15, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[97455, 3776, 79, 2, 70, "Subsection", Evaluatable->False], Cell[97537, 3780, 793, 27, 70, "Text", Evaluatable->False] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[98379, 3813, 109, 2, 35, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[98513, 3819, 90, 2, 45, "Subsection", Evaluatable->False], Cell[98606, 3823, 166, 5, 70, "Text", Evaluatable->False], Cell[98775, 3830, 207, 7, 70, "Print", Evaluatable->False], Cell[98985, 3839, 274, 10, 70, "Text", Evaluatable->False], Cell[99262, 3851, 99, 1, 70, "Input"], Cell[99364, 3854, 78, 2, 70, "Text", Evaluatable->False], Cell[99445, 3858, 71, 1, 70, "Input"], Cell[99519, 3861, 54, 1, 70, "Input"], Cell[99576, 3864, 379, 10, 70, "Text", Evaluatable->False], Cell[99958, 3876, 198, 7, 70, "Text", Evaluatable->False], Cell[100159, 3885, 93, 2, 70, "Text", Evaluatable->False], Cell[100255, 3889, 92, 2, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[100384, 3896, 83, 2, 29, "Subsection", Evaluatable->False], Cell[100470, 3900, 122, 2, 70, "Text", Evaluatable->False], Cell[100595, 3904, 117, 4, 70, "Input"], Cell[100715, 3910, 177, 7, 70, "Text", Evaluatable->False], Cell[100895, 3919, 53, 1, 70, "Input"], Cell[100951, 3922, 54, 1, 70, "Input"], Cell[101008, 3925, 93, 2, 70, "Text", Evaluatable->False], Cell[101104, 3929, 53, 1, 70, "Input"], Cell[101160, 3932, 321, 13, 70, "Text", Evaluatable->False], Cell[101484, 3947, 86, 2, 70, "Print", Evaluatable->False], Cell[101573, 3951, 177, 7, 70, "Text", Evaluatable->False], Cell[101753, 3960, 233, 9, 70, "Print", Evaluatable->False], Cell[101989, 3971, 457, 18, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[102483, 3994, 162, 6, 29, "Subsection", Evaluatable->False], Cell[102648, 4002, 588, 15, 70, "Text", Evaluatable->False], Cell[103239, 4019, 299, 10, 70, "Text", Evaluatable->False], Cell[103541, 4031, 171, 5, 70, "Input"], Cell[103715, 4038, 194, 7, 70, "Text", Evaluatable->False], Cell[103912, 4047, 113, 4, 70, "Input"], Cell[104028, 4053, 85, 2, 70, "Text", Evaluatable->False], Cell[104116, 4057, 299, 11, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[104452, 4073, 102, 2, 29, "Subsection", Evaluatable->False], Cell[104557, 4077, 624, 17, 70, "Text", Evaluatable->False], Cell[105184, 4096, 407, 17, 70, "Print", Evaluatable->False], Cell[105594, 4115, 196, 7, 70, "Text", Evaluatable->False], Cell[105793, 4124, 353, 13, 70, "Print", Evaluatable->False], Cell[106149, 4139, 293, 10, 70, "Text", Evaluatable->False], Cell[106445, 4151, 131, 4, 70, "Input"], Cell[106579, 4157, 65, 1, 70, "Input"], Cell[106647, 4160, 194, 5, 70, "Text", Evaluatable->False], Cell[106844, 4167, 97, 1, 70, "Input"], Cell[106944, 4170, 682, 25, 70, "Text", Evaluatable->False], Cell[107629, 4197, 79, 1, 70, "Input"], Cell[107711, 4200, 160, 5, 70, "Text", Evaluatable->False], Cell[107874, 4207, 77, 1, 70, "Input"], Cell[107954, 4210, 155, 5, 70, "Text", Evaluatable->False], Cell[108112, 4217, 96, 1, 70, "Input"], Cell[108211, 4220, 95, 2, 70, "Text", Evaluatable->False], Cell[108309, 4224, 172, 5, 70, "Text", Evaluatable->False], Cell[108484, 4231, 264, 8, 70, "Text", Evaluatable->False], Cell[108751, 4241, 75, 1, 70, "Input"], Cell[108829, 4244, 309, 8, 70, "Text", Evaluatable->False], Cell[109141, 4254, 355, 7, 70, "Text", Evaluatable->False], Cell[109499, 4263, 638, 15, 70, "Text", Evaluatable->False], Cell[110140, 4280, 178, 5, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[110355, 4290, 86, 2, 29, "Subsection", Evaluatable->False], Cell[110444, 4294, 283, 6, 70, "Text", Evaluatable->False], Cell[110730, 4302, 543, 12, 70, "Text", Evaluatable->False], Cell[111276, 4316, 529, 13, 70, "Text", Evaluatable->False], Cell[111808, 4331, 174, 5, 70, "Text", Evaluatable->False], Cell[111985, 4338, 239, 8, 70, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[112261, 4351, 79, 2, 29, "Subsection", Evaluatable->False], Cell[112343, 4355, 495, 12, 70, "Text", Evaluatable->False], Cell[112841, 4369, 306, 7, 70, "Text", Evaluatable->False], Cell[113150, 4378, 585, 22, 70, "Print", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[113772, 4405, 77, 2, 29, "Subsection", Evaluatable->False], Cell[113852, 4409, 225, 6, 70, "Text", Evaluatable->False], Cell[114080, 4417, 88, 1, 70, "Input"], Cell[114171, 4420, 164, 7, 70, "Text", Evaluatable->False], Cell[114338, 4429, 228, 10, 70, "Print", Evaluatable->False], Cell[114569, 4441, 190, 7, 70, "Text", Evaluatable->False], Cell[114762, 4450, 382, 11, 70, "Text", Evaluatable->False], Cell[115147, 4463, 97, 1, 70, "Input"], Cell[115247, 4466, 259, 9, 70, "Text", Evaluatable->False], Cell[115509, 4477, 189, 9, 70, "Input"], Cell[115701, 4488, 153, 5, 70, "Text", Evaluatable->False] }, Closed]] }, Closed]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)