(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 8957, 251] NotebookOptionsPosition[ 7925, 214] NotebookOutlinePosition[ 8310, 231] CellTagsIndexPosition[ 8267, 228] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Special function names", "Title", CellChangeTimes->{{3.3918893128898463`*^9, 3.3918893187482705`*^9}, { 3.3920485538593245`*^9, 3.392048560368685*^9}, 3.3920512234480047`*^9, { 3.3921418854640846`*^9, 3.392141912302677*^9}, {3.392142048037854*^9, 3.3921420518433266`*^9}}], Cell["\<\ Consider a StandardForm expression such as:\ \>", "Text", CellChangeTimes->{3.392051340316053*^9}], Cell[BoxData[ RowBox[{ RowBox[{"BesselJ", "[", RowBox[{"0", ",", "z"}], "]"}], "+", RowBox[{"Gamma", "[", "z", "]"}]}]], "Input", CellChangeTimes->{{3.392051358271872*^9, 3.392051367615307*^9}}], Cell["\<\ It is very easy to translate this cell into TraditionalForm to obtain:\ \>", "Text", CellChangeTimes->{ 3.392051340316053*^9, {3.392051386943099*^9, 3.3920514034768734`*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox["J", "0"], "(", "z", ")"}], "+", RowBox[{"\[CapitalGamma]", "(", "z", ")"}]}], TraditionalForm]], "Input"], Cell["\<\ Traditional form is much more pleasing to the eye, but it can be hard to \ input or edit expressions in Traditional form because these cells contain \ additional information to remove the ambiguity inherent in ordinary \ mathematics. Consider the following example:\ \>", "Text", CellChangeTimes->{ 3.392051340316053*^9, {3.392051386943099*^9, 3.3920514430537825`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", RowBox[{"a", "+", "b"}], "]"}], "+", RowBox[{"g", " ", RowBox[{"(", RowBox[{"a", "+", "b"}], ")"}]}]}]], "Input", CellChangeTimes->{{3.3920514478206367`*^9, 3.392051473938192*^9}}], Cell["\<\ if we ask Mathematica to translate this into TraditionalForm, we get:\ \>", "Text", CellChangeTimes->{ 3.392051340316053*^9, {3.392051386943099*^9, 3.3920514430537825`*^9}, { 3.3920514803173647`*^9, 3.3920514865062637`*^9}}], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"a", "+", "b"}], ")"}], " ", "g"}], "+", RowBox[{"f", "(", RowBox[{"a", "+", "b"}], ")"}]}], TraditionalForm]], "Input"], Cell["\<\ Because TraditionalForm follows conventional mathematical notation and uses \ round parentheses for grouping expressions and for function application, \ there is an inherent ambiguity in such expressions. This is amplified by the \ fact that Mathematica is used in such a wide range of applications - the \ conventional notation of one discipline can overlap with the entirely \ different notation of another. To avoid this, it is probably best to forget TraditionalForm, except as a way \ to polish results for transfer to a final report. However, it is possible to \ use a great deal of traditional mathematical notation in StandardForm - it is \ simply necessary to define what it means. For example:\ \>", "Text", CellChangeTimes->{ 3.392051340316053*^9, {3.392051386943099*^9, 3.3920514430537825`*^9}, { 3.3920514803173647`*^9, 3.3920515130544386`*^9}, 3.392051549727171*^9}], Cell[BoxData[ RowBox[{ RowBox[{"\[CapitalGamma]", "[", "z_", "]"}], ":=", RowBox[{"Gamma", "[", "z", "]"}]}]], "Input", CellChangeTimes->{{3.3920515603724785`*^9, 3.392051566851795*^9}}], Cell["\<\ This definition will allow you to input gamma functions using the traditional \ notation. They will be converted as soon as the expression reaches the \ kernel. Of course, this will not help if you are expecting results from \ Mathematica involving Gamma functions. There are several ways of dealing with \ this situation. One way is to program the frontend to display gamma functions \ in your notation (normal textbook notation!). An alternative, simpler idea, is not to use the above definition, so that an \ expression such as:\ \>", "Text", CellChangeTimes->{ 3.392051340316053*^9, {3.392051386943099*^9, 3.3920514430537825`*^9}, { 3.3920514803173647`*^9, 3.3920515130544386`*^9}, {3.392051549727171*^9, 3.392051607179784*^9}}], Cell[BoxData[ RowBox[{"\[CapitalGamma]", "[", "5", "]"}]], "Input", CellChangeTimes->{ 3.392051340316053*^9, {3.392051386943099*^9, 3.3920514430537825`*^9}, { 3.3920514803173647`*^9, 3.3920515130544386`*^9}, {3.392051549727171*^9, 3.392051618996776*^9}}], Cell["\<\ is not interpreted by Mathematica at all. This is another example of working \ with an undefined function. Notice that without a definition, Mathematica \ will not 'know' that this can be evaluated to 24, and this can be useful in \ its own right - Mathematica's relentless evaluation can get in the way \ sometimes!. We now equip our 'toolbox' (see above) with the following sets of \ transformation rules:\ \>", "Text", CellChangeTimes->{ 3.392051340316053*^9, {3.392051386943099*^9, 3.3920514430537825`*^9}, { 3.3920514803173647`*^9, 3.3920515130544386`*^9}, {3.392051549727171*^9, 3.3920516384146976`*^9}, {3.392051681787064*^9, 3.3920516853021183`*^9}, 3.3920517229863057`*^9}], Cell[BoxData[{ RowBox[{ RowBox[{"tr1", "=", RowBox[{"{", RowBox[{ RowBox[{"\[CapitalGamma]", "[", "z_", "]"}], "\[Rule]", RowBox[{"Gamma", "[", "z", "]"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"tr2", "=", RowBox[{"{", RowBox[{ RowBox[{"Gamma", "[", "z_", "]"}], "\[Rule]", RowBox[{"\[CapitalGamma]", "[", "z", "]"}]}], "}"}]}], ";"}]}], "Input", CellChangeTimes->{{3.3920517262309713`*^9, 3.3920517741298466`*^9}}], Cell[TextData[{ "Notice that both lists of transformations will typically contain several \ items to cover all the bits of mathematical notation that you want to \ translate. Now we can use our private notation ", StyleBox["and", FontVariations->{"Underline"->True}], " use Mathematica to simplify it:" }], "Text", CellChangeTimes->{ 3.392051340316053*^9, {3.392051386943099*^9, 3.3920514430537825`*^9}, { 3.3920514803173647`*^9, 3.3920515130544386`*^9}, {3.392051549727171*^9, 3.3920516384146976`*^9}, {3.392051681787064*^9, 3.3920516853021183`*^9}, 3.3920517229863057`*^9, {3.392051781430344*^9, 3.392051822529442*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{ RowBox[{"\[CapitalGamma]", "[", "4", "]"}], RowBox[{"\[CapitalGamma]", "[", RowBox[{"x", "+", "3"}], "]"}]}], "/.", "tr1"}], "/.", "tr2"}]], "Input",\ CellChangeTimes->{{3.392051826975835*^9, 3.3920518491877747`*^9}}], Cell[BoxData[ RowBox[{"6", " ", RowBox[{"\[CapitalGamma]", "[", RowBox[{"3", "+", "x"}], "]"}]}]], "Output", CellChangeTimes->{{3.392051850820122*^9, 3.3920518679747887`*^9}}] }, Open ]], Cell["\<\ The important idea to learn here is that the clumsy spelled-out names of \ Mathematica are not an impediment to working in neater ways - they simply \ avoid gobbling notation, such as the Greek letters, for one concept, thereby \ making it hard to use a symbol for some other notation. All those traditional \ math symbols, Greek and Gothic script, etc. are there for a reason - use \ them! \ \>", "Text", CellChangeTimes->{ 3.392051340316053*^9, {3.392051386943099*^9, 3.3920514430537825`*^9}, { 3.3920514803173647`*^9, 3.3920515130544386`*^9}, {3.392051549727171*^9, 3.3920516384146976`*^9}, {3.392051681787064*^9, 3.3920516853021183`*^9}, 3.3920517229863057`*^9, {3.392051781430344*^9, 3.392051822529442*^9}, { 3.3920518862210255`*^9, 3.3920518870722494`*^9}}] }, Open ]] }, WindowSize->{977, 750}, WindowMargins->{{Automatic, 95}, {40, Automatic}}, ShowSelection->True, ShowCellLabel->False, FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (March 26, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 289, 4, 83, "Title"], Cell[882, 29, 109, 3, 29, "Text"], Cell[994, 34, 205, 5, 28, "Input"], Cell[1202, 41, 187, 4, 29, "Text"], Cell[1392, 47, 174, 5, 27, "Input"], Cell[1569, 54, 382, 7, 47, "Text"], Cell[1954, 63, 241, 7, 28, "Input"], Cell[2198, 72, 241, 6, 47, "Text"], Cell[2442, 80, 207, 7, 27, "Input"], Cell[2652, 89, 897, 15, 119, "Text"], Cell[3552, 106, 193, 4, 28, "Input"], Cell[3748, 112, 753, 14, 101, "Text"], Cell[4504, 128, 265, 5, 28, "Input"], Cell[4772, 135, 706, 12, 65, "Text"], Cell[5481, 149, 486, 14, 48, "Input"], Cell[5970, 165, 641, 12, 47, "Text"], Cell[CellGroupData[{ Cell[6636, 181, 281, 8, 28, "Input"], Cell[6920, 191, 184, 4, 27, "Output"] }, Open ]], Cell[7119, 198, 790, 13, 65, "Text"] }, Open ]] } ] *) (* End of internal cache information *)