[Maxima] unsimplified result from integrate

Barton Willis willisb at unk.edu
Wed Jan 21 05:12:37 CST 2009

I was looking into  bug 2465066 "unsimplified result from integrate." The
bug is

(%i1) matchdeclare(x, symbolp)$
(%i2) tellsimpafter('integrate(f(x),x), g(x))$

(%i3) integrate(5*f(x)+7,x);
(%o3) 5*integrate(f(x),x)+7*x

(%i4) expand(%,0,0);
(%o4) 5*g(x)+7*x

In sinint (sin.lisp), I see

   ((let ((ans (simplify
         (let ($opsubst varlist genvar stack)
    (integrator exp var)))))

      (if (sum-of-intsp ans)
   (list '(%integrate) exp var)

Changing simplify to ($expand  ... 0 0) fixes the bug. I'm not sure why
($expand ... 0 0) works and simplify doesn't. Maybe the code needs to be
fixed elsewhere. Advice? Is ($expand ... 0 0) an OK fix?


More information about the Maxima mailing list