Simple Gaussian-Kronrod quadrature formula.
function to be integrated.
end points of the interval.
variables to be passed to the function.
Gaussian quadrature of degree 7 with Gauss-Kronrod of degree 15 for error
quadQK15 procedure in the QUADPACK library.
List of value and relative error.
The function needs to be vectorized (though this could easily be changed), but the function does not need to be defined at the end points.
Fausett, L. V. (2007). Applied Numerical Analysis Using Matlab. Second edition, Prentice Hall.
1 2 3
$value  2 $rel.error  1.139977e-12 $value  1.718282 $rel.error  0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.