[Maxima] Integration has problems with sums
robert.dodier at gmail.com
Mon Jun 25 01:15:41 CDT 2007
On 6/22/07, Detlef Schmicker <d.schmicker at physik.de> wrote:
> (%i3) x^2*%e^(-x^2)*sin(x)^2+%e^(-x^2);
> 2 2
> 2 - x 2 - x
> (%o3) x %e sin (x) + %e
> (%i4) integrate(%,x,-inf,inf);
> / 2 2
> [ 2 - x 2 - x
> (%o4) I (x %e sin (x) + %e ) dx
> - inf
By default, Maxima does not treat integrate as linear,
probably because there are infinite series which cannot
be integrated term by term. However, for any finite sum,
the integral of the sum is the sum of the integrals, right?
So this is at least a pretty significant missed opportunity
on Maxima's part. Maxima developers: Yes/no?
With a linearity declaration I get the following.
(%i1) display2d : false;
(%i2) declare (integrate, linear);
(%i3) x^2*%e^(-x^2)*sin(x)^2 + %e^(-x^2);
(%i4) integrate (%, x, -inf, inf);
(%i5) ''%, nouns;
Note that the linearity was applied too late in %o4.
Reevaluation (with nouns=true, sigh) yields the hoped-for result.
More information about the Maxima