(***********************************************************************

                    Mathematica-Compatible Notebook

This notebook can be used on any computer system with Mathematica 4.0,
MathReader 4.0, or any compatible application. 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[      9522,        350]*)
(*NotebookOutlinePosition[     14250,        498]*)
(*  CellTagsIndexPosition[     13851,        478]*)
(*WindowFrame->Normal*)



Notebook[{
Cell[TextData[{
  "Algebra",
  StyleBox["`", "MB"],
  "ReIm",
  StyleBox["`", "MB"]
}], "Subsection",
  CellTags->{"S5.8.1", "1.1"}],

Cell[TextData[{
  "This package extends the class of algebraic identities used by the built\
\[Hyphen]in functions ",
  StyleBox["Re", "MR"],
  ", ",
  StyleBox["Im", "MR"],
  ", ",
  StyleBox["Abs", "MR"],
  ", ",
  StyleBox["Conjugate", "MR"],
  ", and ",
  StyleBox["Arg", "MR"],
  ", and enables these functions to make more complete use of known \
properties of symbols and functions. For example, the input ",
  StyleBox["Im[z]", "MR"],
  " ",
  StyleBox["^=", "MR"],
  " ",
  StyleBox["0", "MR"],
  " can be used to declare that ",
  StyleBox["z", "MR"],
  " is real, after which ",
  StyleBox["Re[z]", "MR"],
  " will evaluate to ",
  StyleBox["z", "MR"],
  ". The function ",
  StyleBox["RealValued", "MR"],
  " is also included for declaring functions to be real\[Hyphen]valued for \
real arguments. \nSome of the functionality provided by this package has been \
incorporated into the ",
  StyleBox["Mathematica", "TI"],
  " kernel and may be available without loading the package. In addition, the \
option ",
  StyleBox["GaussianIntegers", "MR"],
  " has been added to several built\[Hyphen]in polynomial functions, such as \
",
  StyleBox["Factor", "MR"],
  ", and is helpful when working with rational expressions containing complex \
numbers. The function ",
  StyleBox["ComplexExpand", "MR"],
  " can also be used for manipulating complex\[Hyphen]valued expressions. "
}], "Text",
  CellTags->{"S5.8.1", "1.2"}],

Cell["This loads the package. ", "MathCaption",
  CellTags->{"S5.8.1", "1.3"}],

Cell["<<Algebra`ReIm`", "Input",
  CellLabel->"In[1]:= ",
  CellTags->"S5.8.1"],

Cell["\<\
Symbols with no special properties are expanded into real and \
imaginary parts. \
\>", "MathCaption",
  CellTags->{"S5.8.1", "1.4"}],

Cell[CellGroupData[{

Cell["Re[1/a]", "Input",
  CellLabel->"In[2]:= ",
  CellTags->"S5.8.1"],

Cell[BoxData[
    \(Re[a]\/\(Im[a]\^2 + Re[a]\^2\)\)], "Output",
  CellLabel->"Out[2]= ",
  CellTags->"S5.8.1"]
}, Open  ]],

Cell[TextData[{
  "This declares the symbol ",
  StyleBox["z", "MR"],
  " to have an imaginary part of zero, and attaches the rule to ",
  StyleBox["z", "MR"],
  ". "
}], "MathCaption",
  CellTags->{"S5.8.1", "1.5"}],

Cell[CellGroupData[{

Cell["z /: Im[z] = 0", "Input",
  CellLabel->"In[3]:= ",
  CellTags->"S5.8.1"],

Cell[BoxData[
    \(0\)], "Output",
  CellLabel->"Out[3]= ",
  CellTags->"S5.8.1"]
}, Open  ]],

Cell[TextData[{
  "The symbol ",
  StyleBox["z", "MR"],
  " is now treated as a real number. "
}], "MathCaption",
  CellTags->{"S5.8.1", "1.6"}],

Cell[CellGroupData[{

Cell["Re[(z + I)^2 + Exp[I z]]", "Input",
  CellLabel->"In[4]:= ",
  CellTags->"S5.8.1"],

Cell[BoxData[
    \(\(-1\) + z\^2 + Cos[z]\)], "Output",
  CellLabel->"Out[4]= ",
  CellTags->"S5.8.1"]
}, Open  ]],

Cell["\<\
Combinations of real symbols and other expressions can also be \
handled. \
\>", "MathCaption",
  CellTags->{"S5.8.1", "1.7"}],

Cell[CellGroupData[{

Cell["Re[(a + z)^2]", "Input",
  CellLabel->"In[5]:= ",
  CellTags->"S5.8.1"],

Cell[BoxData[
    \(\(-Im[a]\^2\) + \((z + Re[a])\)\^2\)], "Output",
  CellLabel->"Out[5]= ",
  CellTags->"S5.8.1"]
}, Open  ]],

Cell[BoxData[
    FormBox[
      StyleBox[
        FrameBox[
          StyleBox[GridBox[{
                {"\<\"\\!\\(\\*StyleBox[\\\"\\\\\\\"RealValued[\\\\\\\"\\\", \
\\\"MR\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\"f\\\\\\\"\\\", \
\\\"TI\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\",\\\\\\\"\\\", \\\"MR\\\"]\\) \\!\
\\(\\*StyleBox[\\\"\\\\\\\"g\\\\\\\"\\\", \
\\\"TI\\\"]\\)\\!\\(\\*StyleBox[\\\"\\\\\\\",\\\\\\\"\\\", \\\"MR\\\"]\\) \
\[Ellipsis] \\!\\(\\*StyleBox[\\\"\\\\\\\"]\\\\\\\"\\\", \\\"MR\\\"]\\) \
\"\>", "\<\"declare functions to be real for real arguments\"\>"}
                },
              ColumnAlignments->{Right, Left}],
            GridBoxOptions->{RowLines->False}]],
        "2ColumnBox"], TraditionalForm]], "Text",
  CellTags->{"S5.8.1", "1.8"}],

Cell[TextData[{
  "The function ",
  StyleBox["RealValued", "MR"],
  ". "
}], "Caption",
  CellTags->"S5.8.1"],

Cell[TextData[{
  "This declares the symbol ",
  StyleBox["x", "MR"],
  " to be real and the functions ",
  StyleBox["f", "MR"],
  " and ",
  StyleBox["g", "MR"],
  " to be real\[Hyphen]valued for real arguments. "
}], "MathCaption",
  CellTags->{"S5.8.1", "1.9"}],

Cell[CellGroupData[{

Cell["Im[x] ^= 0; RealValued[f, g]", "Input",
  CellLabel->"In[6]:= ",
  CellTags->"S5.8.1"],

Cell[BoxData[
    \({f, g}\)], "Output",
  CellLabel->"Out[6]= ",
  CellTags->"S5.8.1"]
}, Open  ]],

Cell[TextData[{
  "The imaginary part of this expression is determined using previously \
declared properties of ",
  StyleBox["f", "MR"],
  ", ",
  StyleBox["g", "MR"],
  ", and ",
  StyleBox["x", "MR"],
  ". "
}], "MathCaption",
  CellTags->{"S5.8.1", "1.10"}],

Cell[CellGroupData[{

Cell["Im[1/(1 - I f[x] g[x])]", "Input",
  CellLabel->"In[7]:= ",
  CellTags->"S5.8.1"],

Cell[BoxData[
    \(\(f[x]\ g[x]\)\/\(1 + f[x]\^2\ g[x]\^2\)\)], "Output",
  CellLabel->"Out[7]= ",
  CellTags->"S5.8.1"]
}, Open  ]],

Cell["\<\
The rules in this package are based on simple identities that are \
easy to understand and apply, and you are encouraged to read and modify the \
package as necessary for your application. If you modify the package, \
however, or if you use rules involving multiple\[Hyphen]valued functions, \
there are a few issues you should keep in mind. 
Many useful identities involving logarithms, roots and other \
multiple\[Hyphen]valued functions are not correct for arbitrary complex \
arguments. The rules that implement these identities can lead to results that \
represent unintended branches of the function. If you encounter problems \
related to branches of multiple\[Hyphen]valued functions, the corresponding \
rules can be modified or removed from the package. \
\>", "Text",
  CellTags->{"S5.8.1", "1.11"}],

Cell[TextData[{
  "This declares the symbols ",
  StyleBox["a", "MR"],
  " and ",
  StyleBox["b", "MR"],
  " to be negative. "
}], "MathCaption",
  CellTags->{"S5.8.1", "1.12"}],

Cell[CellGroupData[{

Cell["Negative[a] ^= True; Negative[b] ^= True", "Input",
  CellLabel->"In[8]:= ",
  CellTags->"S5.8.1"],

Cell[BoxData[
    \(True\)], "Output",
  CellLabel->"Out[8]= ",
  CellTags->"S5.8.1"]
}, Open  ]],

Cell[TextData[{
  "This result corresponds to an analytic continuation of the principal \
branch of the logarithm function, and was obtained using the rule ",
  StyleBox["Im[Log[a_", "MR"],
  " ",
  StyleBox["b_]]", "MR"],
  " ",
  StyleBox[":=", "MR"],
  " ",
  StyleBox["Im[Log[a]", "MR"],
  " ",
  StyleBox["+", "MR"],
  " ",
  StyleBox["Log[b]]", "MR"],
  ". This rule can be modified or removed if the principal branch must be \
preserved. "
}], "MathCaption",
  CellTags->{"S5.8.1", "1.13"}],

Cell[CellGroupData[{

Cell["Im[Log[a b]]", "Input",
  CellLabel->"In[9]:= ",
  CellTags->"S5.8.1"],

Cell[BoxData[
    \(2\ \[Pi]\)], "Output",
  CellLabel->"Out[9]= ",
  CellTags->"S5.8.1"]
}, Open  ]],

Cell[TextData[{
  "You should also be careful to avoid infinite recursion when adding rules \
to this package. For example, the pair of rules ",
  StyleBox["Im[x_]:=x", "MR"],
  " ",
  StyleBox["/;", "MR"],
  " ",
  StyleBox["Re[x]==0", "MR"],
  " and ",
  StyleBox["Re[x_]:=x", "MR"],
  " ",
  StyleBox["/;", "MR"],
  " ",
  StyleBox["Im[x]==0", "MR"],
  " can lead to infinite recursion, since evaluation of the condition in the \
rule for ",
  StyleBox["Re[x]", "MR"],
  " requires evaluation of ",
  StyleBox["Im[x]", "MR"],
  ", and evaluation of the condition in the rule for ",
  StyleBox["Im[x]", "MR"],
  " requires evaluation of ",
  StyleBox["Re[x]", "MR"],
  ". "
}], "Text",
  CellTags->{"S5.8.1", "1.14"}]
},
FrontEndVersion->"4.0 for X",
ScreenRectangle->{{0, 800}, {0, 600}},
WindowSize->{520, 455},
WindowMargins->{{140, Automatic}, {Automatic, 72}},
StyleDefinitions -> "HelpBrowser.nb"
]


(***********************************************************************
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->{
  "S5.8.1"->{
    Cell[1717, 49, 132, 6, 70, "Subsection",
      CellTags->{"S5.8.1", "1.1"}],
    Cell[1852, 57, 1428, 42, 70, "Text",
      CellTags->{"S5.8.1", "1.2"}],
    Cell[3283, 101, 78, 1, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.3"}],
    Cell[3364, 104, 79, 2, 70, "Input",
      CellTags->"S5.8.1"],
    Cell[3446, 108, 143, 4, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.4"}],
    Cell[3614, 116, 71, 2, 70, "Input",
      CellTags->"S5.8.1"],
    Cell[3688, 120, 111, 3, 70, "Output",
      CellTags->"S5.8.1"],
    Cell[3814, 126, 216, 7, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.5"}],
    Cell[4055, 137, 78, 2, 70, "Input",
      CellTags->"S5.8.1"],
    Cell[4136, 141, 82, 3, 70, "Output",
      CellTags->"S5.8.1"],
    Cell[4233, 147, 144, 5, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.6"}],
    Cell[4402, 156, 88, 2, 70, "Input",
      CellTags->"S5.8.1"],
    Cell[4493, 160, 103, 3, 70, "Output",
      CellTags->"S5.8.1"],
    Cell[4611, 166, 136, 4, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.7"}],
    Cell[4772, 174, 77, 2, 70, "Input",
      CellTags->"S5.8.1"],
    Cell[4852, 178, 115, 3, 70, "Output",
      CellTags->"S5.8.1"],
    Cell[4982, 184, 765, 16, 70, "Text",
      CellTags->{"S5.8.1", "1.8"}],
    Cell[5750, 202, 110, 5, 70, "Caption",
      CellTags->"S5.8.1"],
    Cell[5863, 209, 264, 9, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.9"}],
    Cell[6152, 222, 92, 2, 70, "Input",
      CellTags->"S5.8.1"],
    Cell[6247, 226, 87, 3, 70, "Output",
      CellTags->"S5.8.1"],
    Cell[6349, 232, 262, 10, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.10"}],
    Cell[6636, 246, 87, 2, 70, "Input",
      CellTags->"S5.8.1"],
    Cell[6726, 250, 121, 3, 70, "Output",
      CellTags->"S5.8.1"],
    Cell[6862, 256, 820, 13, 70, "Text",
      CellTags->{"S5.8.1", "1.11"}],
    Cell[7685, 271, 177, 7, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.12"}],
    Cell[7887, 282, 104, 2, 70, "Input",
      CellTags->"S5.8.1"],
    Cell[7994, 286, 85, 3, 70, "Output",
      CellTags->"S5.8.1"],
    Cell[8094, 292, 497, 17, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.13"}],
    Cell[8616, 313, 76, 2, 70, "Input",
      CellTags->"S5.8.1"],
    Cell[8695, 317, 89, 3, 70, "Output",
      CellTags->"S5.8.1"],
    Cell[8799, 323, 719, 25, 70, "Text",
      CellTags->{"S5.8.1", "1.14"}]},
  "1.1"->{
    Cell[1717, 49, 132, 6, 70, "Subsection",
      CellTags->{"S5.8.1", "1.1"}]},
  "1.2"->{
    Cell[1852, 57, 1428, 42, 70, "Text",
      CellTags->{"S5.8.1", "1.2"}]},
  "1.3"->{
    Cell[3283, 101, 78, 1, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.3"}]},
  "1.4"->{
    Cell[3446, 108, 143, 4, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.4"}]},
  "1.5"->{
    Cell[3814, 126, 216, 7, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.5"}]},
  "1.6"->{
    Cell[4233, 147, 144, 5, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.6"}]},
  "1.7"->{
    Cell[4611, 166, 136, 4, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.7"}]},
  "1.8"->{
    Cell[4982, 184, 765, 16, 70, "Text",
      CellTags->{"S5.8.1", "1.8"}]},
  "1.9"->{
    Cell[5863, 209, 264, 9, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.9"}]},
  "1.10"->{
    Cell[6349, 232, 262, 10, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.10"}]},
  "1.11"->{
    Cell[6862, 256, 820, 13, 70, "Text",
      CellTags->{"S5.8.1", "1.11"}]},
  "1.12"->{
    Cell[7685, 271, 177, 7, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.12"}]},
  "1.13"->{
    Cell[8094, 292, 497, 17, 70, "MathCaption",
      CellTags->{"S5.8.1", "1.13"}]},
  "1.14"->{
    Cell[8799, 323, 719, 25, 70, "Text",
      CellTags->{"S5.8.1", "1.14"}]}
  }
*)

(*CellTagsIndex
CellTagsIndex->{
  {"S5.8.1", 10146, 367},
  {"1.1", 12522, 432},
  {"1.2", 12615, 435},
  {"1.3", 12704, 438},
  {"1.4", 12798, 441},
  {"1.5", 12893, 444},
  {"1.6", 12988, 447},
  {"1.7", 13083, 450},
  {"1.8", 13178, 453},
  {"1.9", 13267, 456},
  {"1.10", 13363, 459},
  {"1.11", 13461, 462},
  {"1.12", 13552, 465},
  {"1.13", 13649, 468},
  {"1.14", 13747, 471}
  }
*)

(*NotebookFileOutline
Notebook[{
Cell[1717, 49, 132, 6, 70, "Subsection",
  CellTags->{"S5.8.1", "1.1"}],
Cell[1852, 57, 1428, 42, 70, "Text",
  CellTags->{"S5.8.1", "1.2"}],
Cell[3283, 101, 78, 1, 70, "MathCaption",
  CellTags->{"S5.8.1", "1.3"}],
Cell[3364, 104, 79, 2, 70, "Input",
  CellTags->"S5.8.1"],
Cell[3446, 108, 143, 4, 70, "MathCaption",
  CellTags->{"S5.8.1", "1.4"}],

Cell[CellGroupData[{
Cell[3614, 116, 71, 2, 70, "Input",
  CellTags->"S5.8.1"],
Cell[3688, 120, 111, 3, 70, "Output",
  CellTags->"S5.8.1"]
}, Open  ]],
Cell[3814, 126, 216, 7, 70, "MathCaption",
  CellTags->{"S5.8.1", "1.5"}],

Cell[CellGroupData[{
Cell[4055, 137, 78, 2, 70, "Input",
  CellTags->"S5.8.1"],
Cell[4136, 141, 82, 3, 70, "Output",
  CellTags->"S5.8.1"]
}, Open  ]],
Cell[4233, 147, 144, 5, 70, "MathCaption",
  CellTags->{"S5.8.1", "1.6"}],

Cell[CellGroupData[{
Cell[4402, 156, 88, 2, 70, "Input",
  CellTags->"S5.8.1"],
Cell[4493, 160, 103, 3, 70, "Output",
  CellTags->"S5.8.1"]
}, Open  ]],
Cell[4611, 166, 136, 4, 70, "MathCaption",
  CellTags->{"S5.8.1", "1.7"}],

Cell[CellGroupData[{
Cell[4772, 174, 77, 2, 70, "Input",
  CellTags->"S5.8.1"],
Cell[4852, 178, 115, 3, 70, "Output",
  CellTags->"S5.8.1"]
}, Open  ]],
Cell[4982, 184, 765, 16, 70, "Text",
  CellTags->{"S5.8.1", "1.8"}],
Cell[5750, 202, 110, 5, 70, "Caption",
  CellTags->"S5.8.1"],
Cell[5863, 209, 264, 9, 70, "MathCaption",
  CellTags->{"S5.8.1", "1.9"}],

Cell[CellGroupData[{
Cell[6152, 222, 92, 2, 70, "Input",
  CellTags->"S5.8.1"],
Cell[6247, 226, 87, 3, 70, "Output",
  CellTags->"S5.8.1"]
}, Open  ]],
Cell[6349, 232, 262, 10, 70, "MathCaption",
  CellTags->{"S5.8.1", "1.10"}],

Cell[CellGroupData[{
Cell[6636, 246, 87, 2, 70, "Input",
  CellTags->"S5.8.1"],
Cell[6726, 250, 121, 3, 70, "Output",
  CellTags->"S5.8.1"]
}, Open  ]],
Cell[6862, 256, 820, 13, 70, "Text",
  CellTags->{"S5.8.1", "1.11"}],
Cell[7685, 271, 177, 7, 70, "MathCaption",
  CellTags->{"S5.8.1", "1.12"}],

Cell[CellGroupData[{
Cell[7887, 282, 104, 2, 70, "Input",
  CellTags->"S5.8.1"],
Cell[7994, 286, 85, 3, 70, "Output",
  CellTags->"S5.8.1"]
}, Open  ]],
Cell[8094, 292, 497, 17, 70, "MathCaption",
  CellTags->{"S5.8.1", "1.13"}],

Cell[CellGroupData[{
Cell[8616, 313, 76, 2, 70, "Input",
  CellTags->"S5.8.1"],
Cell[8695, 317, 89, 3, 70, "Output",
  CellTags->"S5.8.1"]
}, Open  ]],
Cell[8799, 323, 719, 25, 70, "Text",
  CellTags->{"S5.8.1", "1.14"}]
}
]
*)




(***********************************************************************
End of Mathematica Notebook file.
***********************************************************************)

