# [Maxima] I can't figure this out

Richard Hennessy rvh2007 at comcast.net
Wed Sep 10 19:14:13 CDT 2008

```I got it to work to this point.  It is a variable that is not set until after the first integrate.  I think.  I don't know which one yet.

(%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,not equal(n,m));
(%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
(%i5) integrate(sin(m*x)*sin(n*x),x,0,2*%pi);
(%o5) 0
(%i6) integrate(sin(m*x)*sin(n*x),x,0,2*%pi);
(%o6) 0
(%i7) integrate(cos(m*x)*cos(n*x),x,0,2*%pi);
(%o7) 0

----- Original Message -----
From: Richard Hennessy
To: maxima at math.utexas.edu
Sent: Wednesday, September 10, 2008 5:41 PM
Subject: [Maxima] I can't figure this out

I am trying to fix the noninteractive.mac to do the simplify better and it only sort of works.

(%o1) C:/Maxima-5.16.3/share/maxima/5.16.3/share/contrib/noninteractive/noninteractive.mac
(%i2) matchdeclare([aa,bb,cc],true);
(%o2) done
(%i3) tellsimp(if aa then bb elseif cc then bb, if aa or cc then bb);
(%o3) merror(Circular rule attempted - `tellsimp')
(%i4) declare([m,n],integer);
(%o4) done
(%i5) assume(n>0,m>0,not equal(n,m));
(%o5) [n>0,m>0,notequal(n,m)]
(%i6) integrate(sin(m*x)*sin(n*x),x,0,2*%pi);
(%o6) if n-m<0 then 0 elseif n-m>0 then 0
(%i7) matchdeclare([aa,bb,cc],true);
(%o7) done
(%i8) tellsimp(if aa then bb elseif cc then bb, if aa or cc then bb);
(%o8) merror(Circular rule attempted - `tellsimp')
(%i9) integrate(sin(m*x)*sin(n*x),x,0,2*%pi);
(%o9) 0

Why is %o6 different than %o9?  I can't figure it out.  It works the second time but not the first and the second time is not quite what I expected either.  I get an error too.  I also uncommented out the code in noninteractive that does a lot of collapsing of conditionals.

Rich

--------------------------------------------------------------------------------

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080910/9067a2fb/attachment.htm
```