Subject: possible bug with integration of unit_step
From: Dieter Kaiser
Date: Thu, 18 Dec 2008 00:16:57 +0100
Am Mittwoch, den 17.12.2008, 22:41 +0100 schrieb Dieter Kaiser:
> Am Mittwoch, den 17.12.2008, 08:33 -0700 schrieb Robert Dodier:
> > Barton,
> >
> > I'm guessing something got broken recently (around Dec 6).
> > I have builds dated Dec 5 w/ cvs Maxima + GCL and SBCL,
> > and those do not show the bug. But builds dated Dec 7 w/
> > CMUCL and Clisp, and Dec 12 w/ ECL, do show it.
> > I 'm pretty sure 5.17.1 (branched Dec 1) does not.
>
> I have introduced the problem. The error is in the function
> facsum-exponent. Applied to any function the result is ((mtimes) $x).
>
> (%i16) :lisp (setq $form ($read))
> unit_step(x);
> (($UNIT_STEP SIMP) $X)
>
> (%i16) :lisp (facsum-exponent form)
> ((MTIMES) $X)
>
> The last result should be (($unit_step) $x) and not ((mtimes) $x). This
> wrong result matches the pattern m2-exp-type-2 and is integrated.
>
> I am looking at the problem.
I have got the error and the correction.
I have made a wrong assumption about the argument expr of the function
facsum-exponent. I assumed expr is a list of the form ((mtimes) factor1
factor2 ...). This is wrong.
If I add as the first line to the function facsum-exponent the following
code all works well:
(setq expr (if (mtimesp expr) expr (list '(mtimes) expr)))
With this extra line of code we get as expected:
(%i10) integrate(x*cos(x^2)+unit_step(x),x);
(%o10) 'integrate(x*cos(x^2)+unit_step(x),x)
(%i11) integrate(unit_step(x),x);
(%o11) 'integrate(unit_step(x),x)
I will commit this as soon as possible. (I have a problem with my
computer I use to commit. Now I am using a notebook, but the CVS is not
fully installed.)
Dieter Kaiser