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[4]:=RandomFunction[5] Out[4]= 3 + 5 Cos [n Pi] + Sin[n Pi] In[5]:=%4/.{Sin[n Pi]->0,Cos[n Pi]->(-1)^n} n Out[5]= 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[6]:= B*A Out[6]= A B In[7]:= B**A Out[7]= B ** A / :@-) Scott \