1 | initial version |
You can reproduce this with the following Maxima code:
declare(n, integer);
integrate(cos(2 * %pi * n * t), t, 0, 1);
which will return 0
. As one of the Maxima devs points out in his comment at the SO question about the same topic:
Although there are places in the code where Maxima will ask if a variable is zero or nonzero, these are triggered only if a corresponding special case is detected; Maxima doesn't try to analyze results to see if there are cases which aren't covered, such as n = 0 in your example.
In this case, a little further investigation reveals that the antiderivative found is wrong for $n=0$:
integrate(cos(2 * %pi * n * t),t);
sin(2*%pi*n*t)/(2*%pi*n)
which obviously doesn't work in that case. In fact, we get this result even if n
is not an integer!
I've opened Maxima bug report 4125 for this. Thanks for reporting!