Search code examples
symbolic-mathmaple

Integrating in maple with integer parameter


I'm attempting to integrate

> ans1 := ([int(e^inx/(2*pi), x = -Pi .. Pi, AllSolutions)], assuming [n::integer]);

I was able to get several other similar integrals to evaluate properly. However, for some reason when I evaluate this integral I simply get back e^{inx}. Moreover, if I add '*' between i,n and x I get a different answer.

Is there any reason for this? Am I missing something?


Solution

  • As stated, 'inx' is a single variable in your expression and thus, the answer that you're getting is expected since you do not have an 'x' term in your function. In order to have three separate terms, i, n, and x, you will need to add in the * between each term, 'inx'. If you are entering this in Maple's 2-D math notation, then spaces are interpreted as implicit multiplications and you can leave out the *s.

    In addition, you might need to consider changing a few other parts of your syntax to conform to the Maple language (unless of course these are intentional):

    The exponential function 'e' is entered as 'exp'

    'pi' is the symbolic lowercase Greek letter; 'Pi' is the mathematical constant.

    By default, Maple uses 'I' for imaginary numbers. You can change your default to use 'i', but otherwise this is just a symbol 'i'.

    Applying these changes to your code, try something like:

    int( exp(I*n*x)/(2*Pi), x = -Pi .. Pi, ...)