Use the Gaussian method to evaluate integrals

gaussint(f, x, w)

gauss.legendre(f, m = 5)

gauss.laguerre(f, m = 5)

gauss.hermite(f, m = 5)

Arguments

f

function to integrate

x

list of evaluation points

w

list of weights

m

number of evaluation points

Value

the value of the integral

Details

The gaussint function uses the Gaussian integration to evaluate an integral. The function itself is a driver and expects the integration points and associated weights as options.

See also

Other integration: adaptint(), giniquintile(), mcint(), midpt(), revolution-solid, romberg(), simp38(), simp(), trap()

Examples

w = c(1, 1)
x = c(-1 / sqrt(3), 1 / sqrt(3))
f <- function(x) { x^3 + x + 1 }
gaussint(f, x, w)
#> [1] 2