Menu

#3544 diff of result of integral not the original function

None
open
nobody
5
2022-04-27
2019-03-22
arpi
No

One of Moses's examples is:

(%i1) f:sqrt(a^2+b^2*sin(x)^2)/sin(x);
                                   2    2       2
                             sqrt(b  sin (x) + a )
(%o1)                        ---------------------
                                    sin(x)
(%i2) g:integrate(f,x);
Is a zero or nonzero?

nonzero;
    4    2  2
Is b  + a  b  positive or zero?

positive;
Is b zero or nonzero?

nonzero;
                                   2    2        2    2           2
                 2 abs(a) sqrt((- b  cos (x)) + b  + a )       2 a         2
      abs(a) log(--------------------------------------- + ------------ - b )
                              2 cos(x) + 2                 2 cos(x) + 2
(%o2) -----------------------------------------------------------------------
                                         2
                                2    2        2    2           2
              2 abs(a) sqrt((- b  cos (x)) + b  + a )       2 a         2
   abs(a) log(--------------------------------------- + ------------ + b )
                           2 - 2 cos(x)                 2 - 2 cos(x)
 - -----------------------------------------------------------------------
                                      2
                   2
                  b  cos(x)
 - abs(b) asin(----------------)
                     4    2  2
               sqrt(b  + a  b )
(%i3) diff(g,x)-f;
               2    2       2
         sqrt(b  sin (x) + a )
(%o3) (- ---------------------) + (abs(a)
                sin(x)
                    2    2        2    2
  4 abs(a) sqrt((- b  cos (x)) + b  + a ) sin(x)
 (----------------------------------------------
                               2
                 (2 cos(x) + 2)
                       2                                2
             2 abs(a) b  cos(x) sin(x)               4 a  sin(x)
 + --------------------------------------------- + ---------------))
                           2    2        2    2                  2
   (2 cos(x) + 2) sqrt((- b  cos (x)) + b  + a )   (2 cos(x) + 2)
                       2    2        2    2           2
     2 abs(a) sqrt((- b  cos (x)) + b  + a )       2 a         2
/(2 (--------------------------------------- + ------------ - b ))
                  2 cos(x) + 2                 2 cos(x) + 2
                                 2    2        2    2
               4 abs(a) sqrt((- b  cos (x)) + b  + a ) sin(x)
 - (abs(a) ((- ----------------------------------------------)
                                            2
                              (2 - 2 cos(x))
                       2                                2
             2 abs(a) b  cos(x) sin(x)               4 a  sin(x)
 + --------------------------------------------- - ---------------))
                           2    2        2    2                  2
   (2 - 2 cos(x)) sqrt((- b  cos (x)) + b  + a )   (2 - 2 cos(x))
                       2    2        2    2           2
     2 abs(a) sqrt((- b  cos (x)) + b  + a )       2 a         2
/(2 (--------------------------------------- + ------------ + b ))
                  2 - 2 cos(x)                 2 - 2 cos(x)
              2
             b  abs(b) sin(x)
 + -------------------------------------
                              4    2
         4    2  2           b  cos (x)
   sqrt(b  + a  b ) sqrt(1 - ----------)
                              4    2  2
                             b  + a  b
(%i4) %,a=1.3,b=0.4,x=2.3;
(%o4)                         0.04485309515590674

Maxima 5.41.0 using Lisp GNU Common Lisp (GCL) GCL 2.6.12 on Ubuntu 18.04.

Discussion

  • Richard Gobeli

    Richard Gobeli - 2019-03-25

    I get this for the integral when using Macsyma 2.4. This does give zero when diff(g,x)-f is executed and simplified.

     
  • arpi

    arpi - 2019-03-25

    If I am not mistaken, the difference is the sign of the b^2 term in the first log(). If I change that, and evaluate the derivative minus the original function at some random points numerically, I get indeed zero.

    Also, it evaluates to zero now, if I use factor, then exponentialize, and then radcan.

     

    Last edit: arpi 2019-03-25
  • Robert Dodier

    Robert Dodier - 2019-03-27
    • labels: --> integrate, diff
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,5 @@
     One of Moses's examples is:
    +~~~~
     (%i1) f:sqrt(a^2+b^2*sin(x)^2)/sin(x);
                                        2    2       2
                                  sqrt(b  sin (x) + a )
    @@ -75,6 +76,6 @@
                                  b  + a  b
     (%i4) %,a=1.3,b=0.4,x=2.3;
     (%o4)                         0.04485309515590674
    -
    +~~~~
    
     Maxima 5.41.0 using Lisp GNU Common Lisp (GCL) GCL 2.6.12 on Ubuntu 18.04.
    
     
  • arpi

    arpi - 2022-04-27

    I have checked, and the bug is still present in 5.43.2.

     

Log in to post a comment.