# Quick Question on Maple Usage

1. May 19, 2006

### Lyuokdea

Is there anyway to use a variable in Maple but assign the variable to be an integer, or a multiple of 2Pi, or to be a real number, or anything like that?

For instance, I want to do a quantum calculation, involving fourier analysis, but I want the computer to know that the n's and m's i'm inputting need to be integers, otherwise I get cos(n*x) factors flying around, how do I make this look nicer?

~Lyuokdea

2. May 19, 2006

### pervect

Staff Emeritus
I don't quite understand the problem. This should be basically automatic in maple.

If for instance you write

n := 2;
cos(n*x);

you should see nice-looking formulas. For multiples of pi, use

n := 2 * Pi;

There are some subtle differences between Pi and pi in maple, if you don't like the results you get with one, try the other.

3. May 19, 2006

### Lyuokdea

right, but I don't want n to be 2, I want to see the results in terms of n, so that I know which factors are coming up, but I want it to assume n is an integer so that it integrates with out a bunch of messy cos factors that will either be 1 or 0.

~Lyuokdea

4. May 19, 2006

### Hash

You can do this with the assume command :
>assume(n, integer);
>cos(n*Pi);
result : (-1)^n

5. May 19, 2006

### Lyuokdea

sweet, thanks man

~Lyuokdea