quad_qags SciMax Toolbox quad_qawf

SciMax Toolbox >> quad_qawc

quad_qawc

Maxima Function

Calling Sequence

quad_qawc (f(x), x, c, a, b, epsrel, limit)
quad_qawc(f,x,c,a,b,epsrel,limit)

Description

Computes the Cauchy principal value of f(x)/(x - c) over a finite interval. The strategy is globally adaptive, and modified Clenshaw-Curtis integration is used on the subranges which contain the point x = c.

quad_qawc computes the Cauchy principal value of

integrate (f(x)/(x - c), x, a, b)

using the Quadpack QAWC routine. The function to be integrated is f(x)/(x - c), with dependent variable x, and the function is to be integrated over the interval a to 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_qawc 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;

6

if the input is invalid.

Examples:

(%i1) quad_qawc (2^(-5)*((x-1)^2+4^(-5))^(-1), x, 2, 0, 5);
(%o1)    [- 3.130120337415925, 1.306830140249558E-8, 495, 0]
(%i2) integrate (2^(-alpha)*(((x-1)^2 + 4^(-alpha))*(x-2))^(-1),
      x, 0, 5);
Principal Value
                       alpha
        alpha       9 4                 9
       4      log(------------- + -------------)
                      alpha           alpha
                  64 4      + 4   64 4      + 4
(%o2) (-----------------------------------------
                        alpha
                     2 4      + 2
       3 alpha                       3 alpha
       -------                       -------
          2            alpha/2          2          alpha/2
    2 4        atan(4 4       )   2 4        atan(4       )   alpha
  - --------------------------- - -------------------------)/2
              alpha                        alpha
           2 4      + 2                 2 4      + 2
(%i3) ev (%, alpha=5, numer);
(%o3)                    - 3.130120337415917
quad_qags SciMax Toolbox quad_qawf