Numerical Integration (Single variable function)
------------------------------------------------

This is a program that calculates the definite integral of a single variable function f(x) using numerical methods: The Trapezoidal method, the Midpoint method and the Simpson's method. The program uses the MS Scriptcontrol (msscript.ocx) for evaluating the values of function f(x).

Written by Vagelis Plevris, Greece
mail to: vplevris@gmail.com

Details on the three numerical integration rules:
-------------------------------------------------

1. Midpoint rule
For the midpoint rule, in order to estimate the definite integral we divide the interval of integration [x0,xN] into N equal pieces, and then in each subinterval we approximate the integral by a constant value.

2. Trapezoidal rule
The trapezoidal rule is derived by approximating the integrand by a piecewise-linear function. We divide the interval of integration [x0,xN] into N equal pieces, and then in each subinterval we approximate the integrand by a line. In order to integrate this linear approximation exactly, we simply use the formula for the area of a trapezoid and sum over all the subintervals. This means that if the integrand is a linear function then the trapezoidal rule gives an exact result.

3. Simpson's rule
Simpson's rule is only slightly more complex than the trapezoidal rule. It requires that N be even and it is derived by approximating the integrand by a piecewise-quadratic function. This means that we expect it to give an exact result if the integrand is a quadratic function. But Simpson's rule does an even better job: It turns out that it gives an exact result for integrating even a cubic function.

