quad_qag SciMax Toolbox quad_qags

SciMax Toolbox >> quad_qagi

quad_qagi

Maxima Function

Calling Sequence

quad_qagi (f(x), x, a, inftype, epsrel, limit)
quad_qagi(f,x,a,inftype,epsrel,limit)

Description

Integration of a general function over an infinite or semi-infinite interval. The interval is mapped onto a finite interval and then the same strategy as in quad_qags is applied.

quad_qagi evaluates one of the following integrals

integrate (f(x), x, a, inf)

integrate (f(x), x, minf, a)

integrate (f(x), x, minf, inf)

using the Quadpack QAGI routine. The function to be integrated is f(x), with dependent variable x, and the function is to be integrated over an infinite range.

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 parameter inftype determines the integration interval as follows:

inf

The interval is from a to positive infinity.

minf

The interval is from negative infinity to a.

both

The interval is the entire real line.

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_qagi returns a list of four elements:

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

0

no problems were encountered;

1

too many sub-intervals were done;

2

excessive roundoff error is detected;

3

extremely bad integrand behavior occurs;

4

failed to converge

5

integral is probably divergent or slowly convergent

6

if the input is invalid.

Examples:

(%i1) quad_qagi (x^2*exp(-4*x), x, 0, inf);
(%o1)        [0.03125, 2.95916102995002E-11, 105, 0]
(%i2) integrate (x^2*exp(-4*x), x, 0, inf);
                               1
(%o2)                          --
                               32
quad_qag SciMax Toolbox quad_qags