Menu

#3906 integration error 0 to negative exponent

has_test_cases
open
nobody
5
2022-01-26
2021-12-22
kcrisman
No

See https://trac.sagemath.org/ticket/29059#comment:11

Maxima 5.45.0 https://maxima.sourceforge.io
using Lisp ECL 21.2.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) domain:complex;
(%o1)                               complex
(%i2) f:x^2*asin(1/3*sqrt(-x^2 + 1)/sqrt(-1/9*x^2 + 1/9));
                                               2
                             2       sqrt(1 - x )
(%o2)                       x  asin(--------------)
                                                2
                                           1   x
                                    3 sqrt(- - --)
                                           9   9
(%i3) integrate(f,x,0,1);

expt: undefined: 0 to a negative exponent.
 -- an error. To debug this try: debugmode(true);

Discussion

  • Robert Dodier

    Robert Dodier - 2021-12-24

    I see the error with domain = real, so I guess it doesn't hinge on that.

    I see the error in a few different ways. In addition to integrate(f, x, 0, 1) shown above, I see it in integrate(f, x) and in load(antid); antidiff(f, x, u);.

    However, I don't see it in risch(f, x). I guess that different paths lead to the place the error is happening, or happen to call something else.

     
  • Robert Dodier

    Robert Dodier - 2022-01-26

    A little bit more info. Tracing some of the usual suspects shows

    1 Enter dintegrate [x^2*asin(sqrt(1-x^2)/(3*sqrt(1/9-x^2/9))),x,0,1]
     1 Enter antideriv [x^2*asin(sqrt(1-x^2)/(3*sqrt(1/9-x^2/9)))]
      1 Enter sinint [x^2*asin(sqrt(1-x^2)/(3*sqrt(1/9-x^2/9))),x]
       1 Enter integrator [x^2*asin(sqrt(1-x^2)/(3*sqrt(1/9-x^2/9))),x]
        1 Enter intform [asin(sqrt(1-x^2)/(3*sqrt(1/9-x^2/9)))]
         2 Enter intform [sqrt(1-x^2)/(3*sqrt(1/9-x^2/9))]
          3 Enter intform [1/3]
          3 Exit  intform false
          3 Enter intform [sqrt(1-x^2)]
          3 Exit  intform false
          3 Enter intform [1/sqrt(1/9-x^2/9)]
          3 Exit  intform false
         2 Exit  intform false
        1 Exit  intform false
        2 Enter integrator [x^2,x]
        2 Exit  integrator x^3/3
        2 Enter integrator 
        [(x^3*((x*sqrt(1-x^2))/(27*(1/9-x^2/9)^(3/2))-x/(3*sqrt(1-x^2)*sqrt(1/9-x^2/9))))
          /(3*sqrt(1-(1-x^2)/(9*(1/9-x^2/9)))),x]
         1 Enter intform [1/sqrt(1-(1-x^2)/(9*(1/9-x^2/9)))]
          2 Enter intform [1/sqrt(x^2/(1-x^2)-1/(1-x^2)+1)]
    expt: undefined: 0 to a negative exponent.
    

    which looks like INTEGRATOR has made a change of variable and transformed the integrand into something (the argument of the last call to INTEGRATOR shown above) is identically zero; eventually some function downstream from INTFORM notices that.

    I guess INTEGRATOR should verify the transformation is valid before going ahead.

    For what it's worth, the argument to asin is just 1, so the antiderivative for f is just %x^3*%pi/6 (that agrees with risch).

     
  • Robert Dodier

    Robert Dodier - 2022-01-26

    Test cases for this problem. This is a bit of an experiment, to put in some cases which can be copied into the test suite, and making use of "milestone" values to track whether there are test cases, and whether they've been copied into the test suite. Anyway here it is.

    /* SF bug #3906: "integration error 0 to negative exponent" */
    
    (f:x^2*asin(1/3*sqrt(-x^2 + 1)/sqrt(-1/9*x^2 + 1/9)),
     0);
    0;
    
    risch (f, x);
    (%pi*x^3)/6;
    
    integrate (f, x);
    (%pi*x^3)/6;
    
    integrate (f, x, 0, 1);
    %pi/6;
    
     
  • Robert Dodier

    Robert Dodier - 2022-01-26
    • Group: None --> has_test_cases
     
  • Gunter Königsmann

    Having test cases in a bug report is great.

    Would it make s|nse to add these test cases to the test suite immediately? That way if the bug tracker ever gets lost the big still is kinda visible and if some unrelated change improves things we get an info that something has improved.

     

Log in to post a comment.