Previous Up Next

23.2.2  Approximating definite integrals

The romberg or nInt command finds approximate values of integrals using the Romberg method.

The gaussquad command finds an approximate value of an integral, calculated by an adaptive method by Ernst Hairer which uses a 15-point Gaussian quadrature.

Example

romberg(exp(x^2),x,0,1)
     
1.46265174591           
gaussquad(exp(x^2),x,0,1)
     
1.46265174591           
gaussquad(exp(-x^2),x,-1,1)
     
1.49364826562           

Previous Up Next