Last modified: December 22, 2024

This article is written in: 🇺🇸

Midpoint Rule

Mathematical Formulation

For a function $f(x)$ defined over an interval $[a, b]$, the Midpoint Rule provides the following approximation for the integral:

$$ (b - a) f\left(\frac{a+b}{2}\right) $$

The integral boundaries are divided into $n$ subintervals. Within each subinterval, defined by $x_{i}$ and $x_{i+1}$, the function $f(x)$ is evaluated at the midpoint. This gives rise to the coordinates of the rectangle:

The areas of these rectangles are then computed, and the integral approximation is obtained by summing these areas:

$$I = \sum_{i=0}^{n-1} f(\frac{x_{i} + x_{i+1}}{2}) h$$

This computation is visually represented as follows:

Midpoint Rule Visualization

Algorithm Steps

  1. Partition the interval $[a, b]$ into several subintervals.
  2. Evaluate the function value at the midpoint of each subinterval.
  3. Apply the Midpoint Rule formula for every subinterval.
  4. Aggregate the results from all subintervals to yield the total integral approximation.

Example

Consider the function $f(x) = x^2$.

Advantages

Limitations

Table of Contents

  1. Midpoint Rule
  2. Mathematical Formulation
  3. Algorithm Steps
  4. Example
  5. Advantages
  6. Limitations