Maxima Function
quad_qag (f(x), x, a, b, key, epsrel, limit)
quad_qag(f,x,a,b,key,epsrel,limit)
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:
an approximation to the integral,
the estimated absolute error of the approximation,
the number integrand evaluations,
an error code.
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: