qrange SciMax Toolbox quad_qagi

SciMax Toolbox >> quad_qag

quad_qag

Maxima Function

Calling Sequence

quad_qag (f(x), x, a, b, key, epsrel, limit)
quad_qag(f,x,a,b,key,epsrel,limit)

Description

Integration of a general function over a finite interval. quad_qag implements a simple globally adaptive integrator using the strategy of Aind (Piessens, 1973). The caller may choose among 6 pairs of Gauss-Kronrod quadrature formulae for the rule evaluation component. The high-degree rules are suitable for strongly oscillating integrands.

quad_qag computes the integral

integrate (f(x), x, a, b)

The function to be integrated is f(x), with dependent variable x, and the function is to be integrated between the limits a and b. key is the integrator to be used and should be an integer between 1 and 6, inclusive. The value of key selects the order of the Gauss-Kronrod integration rule. High-order rules are suitable for strongly oscillating integrands.

The integrand may be specified as the name of a Maxima or Lisp function or operator, a Maxima lambda expression, or a general Maxima expression.

The numerical integration is done adaptively by subdividing the integration region into sub-intervals until the desired accuracy is achieved.

The optional arguments epsrel and limit are the desired relative error and the maximum number of subintervals, respectively. epsrel defaults to 1e-8 and limit is 200.

quad_qag returns a list of four elements:

The error code (fourth element of the return value) can have the values:

0

if no problems were encountered;

1

if too many sub-intervals were done;

2

if excessive roundoff error is detected;

3

if extremely bad integrand behavior occurs;

6

if the input is invalid.

Examples:

(%i1) quad_qag (x^(1/2)*log(1/x), x, 0, 1, 3);
(%o1)    [.4444444444492108, 3.1700968502883E-9, 961, 0]
(%i2) integrate (x^(1/2)*log(1/x), x, 0, 1);
                                4
(%o2)                           -
                                9
qrange SciMax Toolbox quad_qagi