integrate returns undefined



"But there are no values for m and n that are consistant with 
assume(n>0,m>0)
and that are also integers and that give anything other than %pi. "

I meant to say 0, not pi.
but actually there are like 3 = m = n

These are better examples.

(%i1) load(noninteractive);
(%o1) 
C:/Maxima-5.16.3/share/maxima/5.16.3/share/contrib/noninteractive/noninteractive.mac
(%i2) declare([m,n],integer);
(%o2) done
(%i3) assume(n>0,m>0,notequal(n-m,0));
(%o3) [n>0,m>0,notequal(n,m)]
(%i4) integrate(sin(m*x)*sin(n*x),x,0,2*%pi);
(%o4) if n-m<0 then 0 elseif n-m>0 then 0


.
(%i1) declare([m,n],integer);
(%o1) done
(%i2) assume(n>0,m>0,notequal(n-m,0));
(%o2) [n>0,m>0,notequal(n,m)]
(%i3) integrate(sin(m*x)*sin(n*x),x,0,2*%pi);
Is  n-m  positive or negative?
negative;
(%o3) 0

You should not get a question.

Rich

----- Original Message ----- 
From: "Richard Hennessy" <rvh2007 at comcast.net>
To: <fateman at cs.berkeley.edu>; "'John Pye'" <john.pye at anu.edu.au>; 
<maxima at math.utexas.edu>
Cc: "'Edwin Woollett'" <woollett at charter.net>
Sent: Wednesday, September 10, 2008 2:57 PM
Subject: Re: [Maxima] integrate returns undefined


> But there are no values for m and n that are consistant with 
> assume(n>0,m>0)
> and that are also integers and that give anything other than %pi.  What 
> does
> (n-m)/(n-m) have to do with it?
>
>
>
> ----- Original Message ----- 
> From: "Richard Fateman" <fateman at cs.berkeley.edu>
> To: "'John Pye'" <john.pye at anu.edu.au>; <maxima at math.utexas.edu>
> Cc: "'Edwin Woollett'" <woollett at charter.net>
> Sent: Tuesday, September 09, 2008 11:56 PM
> Subject: Re: [Maxima] integrate returns undefined
>
>
>> 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
>>
>>
>>> -----Original Message-----
>>> From: maxima-bounces at math.utexas.edu
>>> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of John Pye
>>> Sent: Tuesday, September 09, 2008 6:47 PM
>>> To: maxima at math.utexas.edu
>>> Cc: Edwin Woollett
>>> Subject: Re: [Maxima] integrate returns undefined
>>>
>>> I can confirm that behaviour; it looks like a clear bug to me.
>>>
>>> Cheers
>>> JP
>>>
>>> Edwin Woollett wrote:
>>> > integrate(..) returns undefined when it
>>> > should know the answer.
>>> >
>>> > (%i1) declare( [ m, n ], integer )$
>>> > (%i2) assume ( m > 0,  n > 0 )$
>>> > (%i3) integrate( cos(m*x)^2, x, 0, 2*%pi );
>>> > (%o3)                                 %pi
>>> > (%i4) integrate( cos(m*x)*cos(n*x), x, 0, 2*%pi  );
>>> > Is  n - m  positive, negative, or zero?
>>> >
>>> > zero;
>>> > (%o4)                              undefined
>>> >
>>> > Is this a known bug?
>>>
>>> _______________________________________________
>>> Maxima mailing list
>>> Maxima at math.utexas.edu
>>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>>
>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima