Edwin Woollett wrote:
> On Sept. 11, 2008, Raymond Toy wrote:
>
>> FWIW, here is what is happening. integrate eventually decides that the
>> antiderivative should be computed and the limits substituted. Maxima
>> tries to be careful with the limits by calling sin-cos-intsubs1. This
>> splits the integrand into numerator and denominator. The limits are
>> substituted into the numerator and evaluates to zero because we have
>> expressions like sin(2*%pi*n), which is zero from the declaration on n.
>>
>> Since the numerator is 0, we check the denominator. Maxima can't tell
>> if the denominator is 0 or not, so it asks. You respond with zero, so
>> we know that we have the form 0/0. Hence it returns undefined.
>>
>> Now suppose we respond with pos instead of zero. Well, the denominator
>> is no longer 0, so the answer is then 0.
>>
>> Anyway, that's why maxima returns undefined or 0 for this integrand. I
>> can't think of any way to fix this.
>>
>
> In my original example, I did not assume n > m, and hence Maxima
> asked if (n - m) was pos, neg, or zero. A possible response to that
> answer "zero" would be NOT calling sin-cos-intsubs1 to separately look at
> the limit of the numerator and the denominator, but to rather use
I guess I didn't phrase it correctly. sin-cos-intsubs1 is the routine
that is causing maxima to ask for the sign of n-m.
> Maxima's powerful limit(...) function to look at the limit of the
> whole expression as m --> n, as we did in our "rerun" above.
Yeah, you would like that, but at this point, maxima doesn't really know
why the denominator is zero. It just knows it is.
Even if it did, how would you phrase the limit operation? Without any
assumptions, maxima asks for the sign of (n-m)*(n+m). How would you
tell maxima to phrase that as a limit operation? What if the expression
was much, much more complicated? Then what?
> It is not clear that integrate(..) is actually being careful in this case.
It is trying to be careful. Just not for the case you're interested in. :-)
Ray