Maxima Function
quad_qags (f(x), x, a, b, epsrel, limit)
quad_qags(f,x,a,b,epsrel,limit)
Integration of a general function over a finite interval.
quad_qags
implements globally adaptive interval subdivision with extrapolation
(de Doncker, 1978) by the Epsilon algorithm (Wynn, 1956).
quad_qags
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.
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 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_qags
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
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_qags (x^(1/2)*log(1/x), x, 0 ,1); (%o1) [.4444444444444448, 1.11022302462516E-15, 315, 0]
Note that quad_qags
is more accurate and efficient than quad_qag
for this integrand.