#1692 romberg(sin(x)^3,x,0,2*%pi) does't work


Good day!
I have problem with my Maxima:
Maxima version: 5.16.2
Maxima build date: 7:44 8/18/2008
host type: i686-pc-mingw32
lisp-implementation-type: GNU Common Lisp (GCL)
lisp-implementation-version: GCL 2.6.8

When I integrate romberg(sin(x)^3,x,0,2*%pi) I get error:

`romberg' failed to converge
-- an error. To debug this try debugmode(true);

And if power is 5,7 and so on.

What's wrong?


  • Dieter Kaiser

    Dieter Kaiser - 2009-06-12
    • status: open --> pending
  • Dieter Kaiser

    Dieter Kaiser - 2009-06-12

    There have been related reports in the past. romberg tries to find a numerical solution, but is not always succesful. There are better routines like the quadpack functions to do a numerical integration. There is nothing wrong with the implementation. It is a weakness of the romberg algorithm.

    Maxima can calculate an exact definite integral for the function of this bug report and the more general function sin(x)^n, with n a positive integer. The results are:

    (%i1) declare(n,odd)$
    (%i2) assume(n>0)$
    (%i3) integrate(sin(x)^n,x,0,2*%pi);
    (%o3) 0

    (%i4) declare(k,even)$
    (%i5) assume(k>0)$
    (%i6) integrate(sin(x)^k,x,0,2*%pi);
    (%o6) 2*beta(1/2,(k+1)/2)

    Setting this bug report to "won't fix" and the status to pending.

    Dieter Kaiser

  • Robert Dodier

    Robert Dodier - 2009-06-12

    Well, the problem with this integral is that it is exactly zero, which makes it difficult for any numerical method. (quad_qags returns approx 1e-17 and prints a warning message.)

    Agreed that we won't try to fix it, but it's not just a weakness in romberg.

  • SourceForge Robot

    • status: pending --> closed
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).


Log in to post a comment.

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

Sign up for the SourceForge newsletter:

No, thanks