       Times Ordered Bug with trig functions??

• To: mathgroup at smc.vnet.net
• Subject: [mg29598] Times Ordered Bug with trig functions??
• From: "Alan Mason" <amason2 at austin.rr.com>
• Date: Wed, 27 Jun 2001 05:12:33 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```Hello.
I've succeeded in writing a differential operator calculus program using **
(NonCommutativeMultiply).
However, my first choice was to set Times to Ordered by
ClearAttributes[Times, {Orderless}].  This seemed preferable since no change
of notation is involved. In so doing I discovered an apparent bug -- with
trig functions (but not others) a wrong answer results; something in the
Trig module is causing the system to forget that Times is supposed to be
Ordered. Probably an unwholesome interaction with Power, since the error
occurs when powers would be available with the normal Times.

The following code exhibits the problem (all symbols are global atoms):
In:=
ClearAttributes[Times, {Orderless}]
In:=
a c D a b e
Out=
a c D a b e
In:=
a c Cos[q] D v Cos[q] (* WRONG *)
Out=
\!\(a\ c\ D\ v\ Cos[q]\^2\)
In:=
a c Cos[q] D V Cos[w]
Out=
a c Cos[q] D V Cos[w]
In:=
a c Exp[q] D v Exp[q]
Out=
\!\(a\ c\ E\^q\ D\ v\ E\^q\)
In:=
a c Tan[x] D v Tan[x] (* WRONG *)
Out=
\!\(a\ c\ D\ v\ Tan[x]\^2\)

I spoke to support at Wolfram Research, but they deny this is a bug.  Seems
to me it at the very least breaks the pattern matcher.  I'm running
Mathematica 3.0; perhaps Times Ordered will not be supported in the future.
Fortunately, there are other (more complicated) ways to get the desired
effect.

```

• Prev by Date: Re: overlay imported picture with Mathatmatica calc
• Next by Date: Frame on Bar Chart