Re: Q: ArcTan[ Tan[ x ] ] = x

*To*: mathgroup at christensen.cybernetics.net*Subject*: [mg1959] Re: Q: ArcTan[ Tan[ x ] ] = x*From*: mike johnson <johnson56 at popcorn.llnl.gov>*Date*: Sat, 26 Aug 1995 00:11:11 -0400*Organization*: Lawrence Livermore Nat'l Lab

elsner at avalon.msfc.nasa.gov (Ron Elsner) wrote: >Suppose I really want Mma to set ArcTan[ Tan[ x ] ] = x, or >ArcSin[ Sin[ x ] ] = x. How do I do this? Ron, the following is part of a long list of "simplifying" rules that I often use when I want to work with "simple" real variables. You might also want to check out the package ReIm by Roman Maeder and Martin Bucholz that forces variables of your choice to be considered real. (MathSource 0200-035). A similar package to allow declarations of integers, positives, etc. is Declare by Pekka Janhunen (MathSource 0202-149). These two packages go a long way to eliminate frustration with Mathematica's generality and also illustrate to novices the many ways to exploit the enormous power of Mathematica. For example, the syntax "/; realQ[x]" means only apply the definition when x is real. Unprotect[ArcTan,Tan,ArcCos,Cos,ArcSin,Sin]; ArcTan[Tan[x_]] := x /; realQ[x]; ArcSin[Sin[x_]] := x /; realQ[x]; ArcCos[Cos[x_]] := x /; realQ[x]; Protect[ArcTan,Tan,ArcCos,Cos,ArcSin,Sin]; Mike Johnson