[ccj id="topblock"]
While the Fundamental Theorem of Calculus provides a powerful way to evaluate definite integrals using antiderivatives, there are many situations where finding an analytical antiderivative is difficult or impossible. This occurs for:
Numerical integration (also known as numerical quadrature) provides methods to approximate the value of a definite integral $\int_a^b f(x) \, dx$. These methods typically involve dividing the interval $[a,b]$ into smaller subintervals and approximating the area under the curve on each subinterval using simple geometric shapes (like rectangles, trapezoids, or parabolas).
The accuracy of the approximation generally improves as the number of subintervals increases (i.e., as the width of each subinterval decreases).
The Trapezoidal Rule approximates the area under the curve $y=f(x)$ from $x=a$ to $x=b$ by dividing the interval into $n$ subintervals of equal width $h = \frac{b-a}{n}$, and then approximating the area over each subinterval with a trapezoid.
The area of a single trapezoid formed by the points $(x_i, 0)$, $(x_{i+1}, 0)$, $(x_i, y_i)$, and $(x_{i+1}, y_{i+1})$ is $\frac{1}{2}(y_i + y_{i+1})h$.
Summing the areas of all $n$ trapezoids gives the formula for the Trapezoidal Rule:
$$ \int_a^b f(x) \, dx \approx \frac{h}{2} [y_0 + 2y_1 + 2y_2 + \dots + 2y_{n-1} + y_n] $$
Or, more compactly:
$$ \int_a^b f(x) \, dx \approx \frac{h}{2} \left[ f(x_0) + 2 \sum_{i=1}^{n-1} f(x_i) + f(x_n) \right] $$
Where $x_i = a + ih$ and $y_i = f(x_i)$. The rule essentially averages the function values at the endpoints of each subinterval and multiplies by the width.
The Mid-ordinate Rule (also known as the Midpoint Rule) approximates the definite integral by summing the areas of rectangles. For each subinterval, the height of the rectangle is taken as the value of the function at the midpoint of that subinterval.
Again, divide the interval $[a,b]$ into $n$ subintervals of equal width $h = \frac{b-a}{n}$.
The midpoint of the $i$-th subinterval $[x_i, x_{i+1}]$ is $m_i = \frac{x_i + x_{i+1}}{2} = a + (i + \frac{1}{2})h$.
The area of the rectangle for this subinterval is $h \cdot f(m_i)$.
The formula for the Mid-ordinate Rule is:
$$ \int_a^b f(x) \, dx \approx h [f(m_0) + f(m_1) + \dots + f(m_{n-1})] $$
Or, more compactly:
$$ \int_a^b f(x) \, dx \approx h \sum_{i=0}^{n-1} f\left(a + \left(i + \frac{1}{2}\right)h\right) $$
The Mid-ordinate Rule is often more accurate than the Trapezoidal Rule for the same number of subintervals, as the errors from approximating the curve above and below the rectangle tend to cancel out more effectively.
Simpson's Rule provides a more accurate approximation by fitting parabolic arcs to pairs of subintervals, instead of straight lines (Trapezoidal Rule) or constant values (Mid-ordinate Rule).
A key requirement for Simpson's 1/3 Rule is that the number of subintervals, $n$, must be even. This means there will be an odd number of ordinates ($y_0, y_1, \dots, y_n$).
The interval $[a,b]$ is divided into $n$ (even) subintervals of width $h = \frac{b-a}{n}$.
The formula for Simpson's 1/3 Rule is:
$$ \int_a^b f(x) \, dx \approx \frac{h}{3} [y_0 + 4y_1 + 2y_2 + 4y_3 + \dots + 2y_{n-2} + 4y_{n-1} + y_n] $$
More compactly:
$$ \int_a^b f(x) \, dx \approx \frac{h}{3} \left[ f(x_0) + 4\sum_{i=1, i \text{ odd}}^{n-1} f(x_i) + 2\sum_{i=2, i \text{ even}}^{n-2} f(x_i) + f(x_n) \right] $$
Simpson's Rule is generally much more accurate than the Trapezoidal and Mid-ordinate rules for smooth functions, as it uses a quadratic approximation (parabola) which can better fit the curvature of $f(x)$. It is exact for polynomials of degree 3 or less.
Numerical integration finds wide application across various fields of science, engineering, and finance:
The choice of method (Trapezoidal, Simpson's, etc.) often depends on the desired accuracy, the nature of the function (smoothness), and computational cost.