Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Q: ArcTan[ Tan[ x ] ] = x

309 views
Skip to first unread message

Ron Elsner

unread,
Aug 25, 1995, 3:00:00 AM8/25/95
to
Suppose I really want Mma to set ArcTan[ Tan[ x ] ] = x, or
ArcSin[ Sin[ x ] ] = x. How do I do this?

Ron Elsner
ES84
NASA MSFC
Huntsville, AL 35812
els...@avalon.msfc.nasa.gov

peho...@taz.dra.hmg.gb

unread,
Aug 26, 1995, 3:00:00 AM8/26/95
to

In article <DDuMD...@wri.com>, els...@avalon.msfc.nasa.gov (Ron Elsner) writes:

|>Suppose I really want Mma to set ArcTan[ Tan[ x ] ] = x, or
|>ArcSin[ Sin[ x ] ] = x. How do I do this?

Hmm. Mathematica appears particularly stubborn over this one. I guess
the mathematicians amongst us would argue that, strictly speaking,
ArcSin[Sin[x]] =!= x, but rather ArcSin[Sin[x]] === x + (2 n Pi), due
to the periodicity of the trig functions. However, it does seem that
in certain circumstances it would be nice to be able to ignore this
mathematical niceity.

Anyway, the two obvious approaches are
Simplify[expr, Trig->True]
and
<<Algebra`Trigonometry`
TrigReduce[expr]

but neither of these work, so I guess the only approach is to teach
Mathematica some not-strictly-correct mathematics:

In[1] := BadTrigRules = {ArcSin[Sin[a_]]->a, ArcTan[Tan[a_]]->a};
In[2] := ArcSin[Sin[x]] /. BadTrigRules
Out[2] := x

which forces the answer for you. You could write your own Simplify function
that did this sort of thing first, and then applied Mathematica's built
in Simplify fuction.

It might be nice, however, for Mathematica's trig functions to have an
option like "IgnorePeriodicity->True", or something, to force the above
behaviour.

Paul Howland
Defence Research Agency
UK


mike johnson

unread,
Aug 26, 1995, 3:00:00 AM8/26/95
to
els...@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

Lancelot

unread,
Aug 27, 1995, 3:00:00 AM8/27/95
to
In article <DDuMD...@wri.com>,

Ron Elsner <els...@avalon.msfc.nasa.gov> wrote:
>Suppose I really want Mma to set ArcTan[ Tan[ x ] ] = x, or
>ArcSin[ Sin[ x ] ] = x. How do I do this?

Unprotect[Tan,ArcTan];
ArcTan[Tan[x_]]:=x;
Protect[Tan,ArcTan];

will do it for the first example. Beware however, as changing
predefined definitions like that can sometimes unpredictable
consequences....

/
:@-) Scott
\

0 new messages