Gauss integration.
The file contains the gauss function, which integrates a function very effectively with 10 evalutions per interval. For less accuracy gauss5 can be used. There is an interval version of the Gauß integration, which needs an expression, estimatin or function for the 20-th derivative.
Gauß integration uses the zeros of Legendre polynomials, which can also be generated using lengendre().
function legendre (n:index) Compute the coefficients of the n-th Legendre polynomial. This is used to compute the Gauss coefficients. See:
gauss (Gauss Qudrature)
function gaussparam (n:index) Returns the knots and alphas of gauss integration at n points in [-1,1]. Returns {gaussz,gaussa}.
function gauss (f:string, a:real scalar, b:real scalar, n:index=1, .. maps:integer=0, xn=gaussz, al=gaussa) Gauss integration with 10 knots and n subintervals. This function is exact for polynomials up to degree 19, even for one sub-interval. For other functions, it may be necessary to specify n subintervals. f is an expression in x, or a function in x. Additional parameters after the semicolon are passed to f. maps : Map an expression to the arguments (1 or 0). Functions are always mapped. See:
gauss5 (Gauss Qudrature),
simpson (Numerical Algorithms),
integrate (Differential Equations),
integrate (Maxima Documentation),
romberg (Numerical Algorithms),
romberg (Maxima Documentation)
function igauss (expr:string, a:real, b:real, n:index=1, .. dexpr20:string=none, dexpr20est:real=none, xn=gaussz, al=gaussa) Compute an interval incluseion for an integral This works only for expressions, unless you provide an estimate for the 20-th derivative. The function will compute this derivative with Maxima otherwise. Optional: dexpr20: Expression or function for the 20-th derivative dexpr20est: Interval inclusion of the 20-th derivative See:
gauss5 (Gauss Qudrature)
function gauss5 (f:string, a:real scalar, b:real scalar, n:index=1, .. maps:integer=0, xn=gauss5z, al=gauss5a) Gauss integration with 4 knots and n subintervals This is exact for polynomials to degree 7 (even for n=1). The results are usually much better than the Simpson method with only twice as many function evaluations. See:
simpson (Numerical Algorithms),
integrate (Differential Equations),
integrate (Maxima Documentation),
romberg (Numerical Algorithms),
romberg (Maxima Documentation)
function gaussfxy (f:string, a:real scalar, b:real scalar, .. c:real scalar, d:real scalar, n:index=1) Computes the double integral of f on [a,b]x[c,d]. This function uses Gauss intergration for the inner and the outer integral. The function is exact for polynomials in x and y up to degree 19. f must be a functon f(x,y) or an expression of x and y.