Sponsored links: Algebra eBooks ### The Maxima on-line user's manual

Algebra Calculator

#### Search: Function: quad_qags (<f(x)>, <x>, <a>, <b>, [<epsrel>, <epsabs>, <limit>]) Function: quad_qags (<f>, <x>, <a>, <b>, [<epsrel>, <epsabs>, <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 keyword arguments are optional and may be specified in any order. They all take the form `key=val`. The keyword arguments are:

<epsrel> Desired relative error of approximation. Default is 1d-8.

<epsabs> Desired absolute error of approximation. Default is 0.

<limit> Size of internal work array. <limit> is the maximum number of subintervals to use. Default 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, epsrel=1d-10);
(%o1)   [.4444444444444448, 1.11022302462516E-15, 315, 0]```

Note that `quad_qags` is more accurate and efficient than `quad_qag` for this integrand.

```(%o1)                                true
(%i2) ```

### Related Examples

Calculate

quad_qags (x**5 / sqr...

Calculate

quad_qags(x, x, 0, 1);

Calculate

f(t,n):= ((p-t/n)^2*p...

Calculate

Calculate

f(x) := sin(x^2+1);

g(x) := sqrt(f(x)^2 +...

Calculate

Calculate

Calculate 