MathGroup Archive 1994

[Date Index] [Thread Index] [Author Index]

Search the Archive

Trig Functions with arguments = Integer * Pi

  • To: mathgroup at
  • Subject: Trig Functions with arguments = Integer * Pi
  • From: olness at (Fredrick Olness (214) 768-2500 or -2495, Fax -4095)
  • Date: Wed, 26 Oct 1994 12:36:57 -0500

> Fedor G. Pikus WRITES:

> I need to declare some variables as integer, so that the trig functions
> would be simplified. I have Declare package from MathSource,
> but it does not help: I declare n to be integer, and Sin[n Pi] stays
> as it is. 

I have attached a solution below. I have also included the case of 
the Cos[n Pi] which may be of interest. 

You may wish to practice on a sample function like sin[] or cos[]
(lowercase) before you start redefining system functions.

                                         Fred Olness
IntegerQ[n] ^= True;

  IntegerQ[n] ^= True

Sin[n_?IntegerQ Pi] := 0;

{Sin[ n Pi],Sin[ 2 n Pi],Sin[ 2 Pi],Sin[ j Pi]}

  {0, Sin[2 n Pi], 0, Sin[j Pi]}  (*Note, the 2nd did not simplify*)

Cos[n_?IntegerQ Pi] := (-1)^n;

{Cos[ n Pi],Cos[ 2 n Pi],Cos[ 2 Pi],Cos[ 3 Pi]}
  {(-1) , Cos[2 n Pi], 1, -1}

Fredrick I. Olness

SMU  Mail:  Department of Physics 
            Fondren Science Bldg.
            Southern Methodist University
            Dallas, TX 75275

Phone:      (214) 768-2500 (SMU Office)
            (214) 768-2495 (SMU Secretary)
            (214) 768-4095 (SMU FAX)

Internet:   Olness at (
            Olness at

  • Prev by Date: Axes Positioning in Plots
  • Next by Date: Administration
  • Previous by thread: Axes Positioning in Plots
  • Next by thread: Administration