Numerical Integration of a Function

Usage

int(f, a, b, eps=1.0e-6, k=5)

Arguments

f The function to integrate.
a Lower bound. (If non-numeric, taken to be -infty.)
b Upper bound. (If non-numeric, taken to be infty.)
eps Precision.
k Number of points for polynomial interpolation.

Description

int performs numerical integration of a given function using the Romberg method.

Examples

f <- function(x) sin(x)+cos(x)-x^2
int(f,0,2)
#
f <- function(x) exp(-(x-2)^2/2)
int(f,0,"infty")


[Package Contents]