Maple says integral is zero for all integers, but it isn't for 1.

94 Views Asked by At
> assume(n::'integer'):
> int(exp(n * x * I) * cos(x), x = 0 .. 2 * Pi);
                               0

But if we substitute n=1 by hand:

> int(exp(x * I) * cos(x), x = 0 .. 2 * Pi);
                               Pi

How do I get Maple to tell me which integral values of $n$ make the integral non-zero?

3

There are 3 best solutions below

0
On BEST ANSWER

The allsolutions option to the int command can sometimes handle this kind of special case.

But the integrand may have to be rewritten to a form in which int recognizes the issue.

assume(n::'integer'):

igrand := simplify(evalc(exp(n*x*I)*cos(x)));

    igrand := cos(x) (sin(n~ x) I + cos(n~ x))

int(igrand, x = 0 .. 2 * Pi, allsolutions);

        { Pi        Or(n~ = -1, n~ = 1)
        {
        { 0              otherwise

The last result above is a piecewise construct.

3
On

For this particular one, we can try this:

seq(int(exp(n * x * I) * cos(x), x = 0 .. 2 * Pi) ,n=1..10);
Pi, 0, 0, 0, 0, 0, 0, 0, 0, 0

0
On

If you remove this hypotesis:

assume(n::'integer'):

Maple will answer $$\dfrac{In(1-e^{2In\pi})}{n^2-1}$$ which shows that $n=\pm 1$ are special values.