       Re: Question: how to get Sin[n*Pi]=0 (n integer)

• To: mathgroup at christensen.cybernetics.net
• Subject: [mg1962] Re: Question: how to get Sin[n*Pi]=0 (n integer)
• From: Scott.A.Hill at williams.edu (Lancelot)
• Date: Sun, 27 Aug 1995 23:23:59 -0400
• Organization: Williams College, Williamstown MA

```In article <DDuM67.IuF at wri.com>, Ilija I Zovko <izovko at dominis.phy.hr> wrote:

>Hi,

>How can one tell Mathematica to simplify Sin[n Pi]=0 or
>Cos[n Pi]=(-1)^n and similar kind of stuff.

In such cases I tend just to substitute them by hand.  E.g.:

In:=RandomFunction

Out= 3 + 5 Cos [n Pi] + Sin[n Pi]

In:=%4/.{Sin[n Pi]->0,Cos[n Pi]->(-1)^n}

n
Out= 3 + 5 (-1)

Of course, you should make sure n is really an integer first.

>Also, how does one tell it "A" & "B" are matrices so it doesn't
>commute them (AB.not equal.BA).

Mathematica has a non-commutative multiplication command,
represented by **.  Thus:

In:= B*A

Out= A B

In:= B**A

Out= B ** A

/
:@-) Scott
\

```

• Prev by Date: Re: question about nest
• Next by Date: Re: question about nest
• Previous by thread: Question: how to get Sin[n*Pi]=0 (n integer)
• Next by thread: Re: Question: how to get Sin[n*Pi]=0 (n integer)