> 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?
The
allsolutionsoption to theintcommand can sometimes handle this kind of special case.But the integrand may have to be rewritten to a form in which
intrecognizes the issue.The last result above is a piecewise construct.