integrate returns undefined



Here is a work-around that works.

(%i1) declare(m,integer);
(%o1) done
(%i2) assume(n>0,m>0,equal(n,m));
(%o2) [n>0,m>0,equal(n,m)]
(%i3) integrate(sin(m*x)*sin(n*x),x,0,2*%pi);
(%o3) (m*sin(2*%pi*n))/(n^2-m^2)
(%i4) limit(%,n,m);
(%o4) %pi

If you just don't mention n as an integer it works.
If you say m and n are integers then it doesn't.
Rich

----- Original Message ----- 
From: "John Pye" <john.pye at anu.edu.au>
To: <fateman at cs.berkeley.edu>
Cc: "'Edwin Woollett'" <woollett at charter.net>; <maxima at math.utexas.edu>
Sent: Thursday, September 11, 2008 9:23 AM
Subject: Re: [Maxima] integrate returns undefined


> Richard Fateman wrote:
>> Not so clear a bug.
>> (n-m)/(n-m) simplifies to 1.
>> But if you know n=m, then you have 0/0.  So is it a bug if 
>> (n-m)/(n-m) -->
>> 1?
>>
>> Answer: maybe. But not clear :)
>>
>> RJF
>>
>
> I still say that this looks very much to me like a bug. The user has
> asked for the answer to
>
> integrate( cos(m*x)*cos(n*x), x, 0, 2*%pi  )
>
>
> and the user has then responded with further information that says that
> n==m. The only reasonable conclusion given than information is that
> Maxima should return the same result as the earlier simplification.
>
> It would appear that perhaps the integration algorithim is 'throwing up'
> the need for this answer about whether or not n-m==0, but that answer
> should be back-substituted into the initial problem and the whole result
> should be re-evaluated, eliminating the 'undefined' result that comes
> from the 0/0 thing that appears to be happening somewhere in there, right?
>
> It looks like the additional information received by maxima about n==m
> is nothing being used early enough in the solution process.
>
> Cheers
> JP
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima