#2675 maxima will not do the simplest of definite integrals and will not factor otherwise

None
closed
5
2014-07-22
2014-01-14
dan hayes
No

maxima will not do the simplest of definite integrals and will not factor otherwise

both types *.wxm nor *.wxmx will not do :

 integrate (assume(a[1]>0),integrate(exp(-(a[1]+%i)*x[1]),x[1],0,inf))
(intanalysis:false,assume(a[1]>0),assume(w>0),integrate(x^2*exp(-(%i*w+a[1])*x),x,0,inf));
(intanalysis:false,assume(a[1]>0),assume(w>0),integrate(x*exp(-(%i*w+a[1])*x),x,0,inf));
,integrate(x^5*exp(-(%i*w+a[1])*x),x,0,inf))

factor does not work for example

factor(lratsubst(x=0,integrate(x^5*exp(-(%i*w+a[1])*x),x))) 

the denominator easily factors into for example (w-%i*a[1])^6
but maxma will not factor it in any way - only prints out the fully expanded denominator

the commercial product Macsyma of many years ago does do all the above correct
and gives and as output automatically presents the denominator in the factored form.

Discussion

  • Robert Dodier

    Robert Dodier - 2014-01-18
    • labels: --> integration
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,13 +1,21 @@
     maxima will not do the simplest of definite integrals and will not factor otherwise
    
    -both types *.wxm nor *.wxmx will not do :
    +both types \*.wxm nor \*.wxmx will not do :
    
    +~~~~
      integrate (assume(a[1]>0),integrate(exp(-(a[1]+%i)*x[1]),x[1],0,inf))
     (intanalysis:false,assume(a[1]>0),assume(w>0),integrate(x^2*exp(-(%i*w+a[1])*x),x,0,inf));
     (intanalysis:false,assume(a[1]>0),assume(w>0),integrate(x*exp(-(%i*w+a[1])*x),x,0,inf));
     ,integrate(x^5*exp(-(%i*w+a[1])*x),x,0,inf))
    -factor does not work for example factor(lratsubst(x=0,integrate(x^5*exp(-(%i*w+a[1])*x),x))) 
    -the denominator easily factors into for example (w-%i*a[1])^6
    +~~~~
    +
    +factor does not work for example 
    +
    +~~~~
    +factor(lratsubst(x=0,integrate(x^5*exp(-(%i*w+a[1])*x),x))) 
    +~~~~
    +
    +the denominator easily factors into for example (w-%i\*a[1])^6
     but maxma will not factor it in any way - only prints out the fully expanded denominator
    
     the commercial product Macsyma of many years ago does do all the above correct 
    
     
  • Robert Dodier

    Robert Dodier - 2014-01-18

    I've confirmed the bug. Couple of comments.

    (1) you might try rectform on the integrand -- I can get a result that way; I didn't try to determine if it is correct.

    (2) even after adjusting the formatting, your examples are hard to follow. Maybe next time you can put display2d:false in a Maxima command line session, and then just copy the text (enclosing it within four tildes to prevent the bug tracker from trying to format it).

     
  • Rupert Swarbrick

    For the factorisation part, use gfactor, which factors over the Gaussian integers rather than the normal integers:

    (%i30) factor(lratsubst(x=0,integrate(x^5*exp(-(%i*w+a[1])*x),x)));
                                           120
    (%o30) --------------------------------------------------------------------
            6            5       2  4          3  3       4  2         5      6
           w  - 6 %i a  w  - 15 a  w  + 20 %i a  w  + 15 a  w  - 6 %i a  w - a
                      1          1             1          1            1      1
    (%i31) gfactor(%);
                                         120
    (%o31)                           ------------
                                                6
                                     (w - %i a )
                                              1
    
     
  • Rupert Swarbrick

    For people thinking about this bug, the first example that Dan gives is:

    assume(a[1]>0);
    integrate(exp(-(a[1]+%i)*x[1]),x[1],0,inf);
    

    which integrates to a noun form. The subscripting of a[1] seems not to make any difference, but using x instead of x[1] lets the integrator get an answer (as a principal value integral).

    I assume that the following three examples are unrelated behaviour / a different bug: getting rid of the subscripts doesn't seem to help.

     
  • Rupert Swarbrick

    Maybe Sourceforge ate the last comment I wrote or maybe I'm being even more incompetent than I realised. Anyway, what I wanted to say is that this first part of the bug was fixed by commit d58d37, which I just pushed to master. For more information, see bug #2675 or the commit message.

     
  • Rupert Swarbrick

    After a bit of tracing with the second example, I see that we're successfully computing an antiderivative, but then substituting in limits fails. In particular, something of the form limit(the_antiderivative, x, inf, minus) returns $und. I'm pretty certain this is incorrect.

    For an easier example that I think is the same bug, (after assuming that a>0)

    (%i18) limit(x^2*exp(-%i*x - a*x), x, inf, minus);
    (%o18)                               - und
    (%i19) limit(x^2*exp(- a*x), x, inf, minus);
    (%o19)                                 0
    (%i20) limit(exp(- a*x), x, inf, minus);
    (%o20)                                 0
    (%i21) limit(exp(-%i*x - a*x), x, inf, minus);
    (%o21)                                 0
    

    Hmm...

     
  • Dan Gildea

    Dan Gildea - 2014-03-02
    • status: open --> closed
    • assigned_to: Dan Gildea
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks