Trapezoidal Rule for Numerical Integration

1.3k Views Asked by At

If the trapezoidal rule approximates an integral with trapezoids, then I thought (and was tought in high school) that the formula is:

$ \frac{h}{2}(f(x) + f(x + h))$ Where $h$ is the distance between two points that are close together.

However, when I look up the Trapezoidal Rule online, I get a modified formual: (seethe links below)

http://mathworld.wolfram.com/TrapezoidalRule.html

http://mathworld.wolfram.com/Newton-CotesFormulas.html

Why is the additional term required? How does it change the approximation?

The application is that I am integrating an estimated probability density function. The PDF is estimated from empirical data with Kernel Density Estimation. I am using a Gaussian Kernel. Further, the data must be positive, so I used an approach that is described by Silverman 1998, "Density Estimation for Statistics and Data Analysis".

For each point x, in the dataset, I made another point -1*x. I then estimated the density on the that. I then discarded all of the negative points and multiplied the remaining points by two.