Riemann sum

A Riemann sum is a method used in calculus to approximate the integral (or area under a curve) of a function. It is named after the German mathematician Bernhard Riemann. The basic idea behind a Riemann sum is to break up the region under a curve into small rectangles, compute the area of each rectangle, and then sum those areas to approximate the total area under the curve.

Steps to compute a Riemann sum:

  1. Divide the interval:
    Suppose you want to approximate the integral of a function f(x) over the interval [a, b]. You divide this interval into n subintervals (small segments) of equal width, \Delta x = \frac{b - a}{n} .
  2. Choose sample points:
    For each subinterval, you select a sample point x_i^* (usually in the middle, left, or right of the subinterval) to evaluate the function f(x) at that point.
  3. Compute the area of rectangles:
    For each subinterval, the height of the rectangle is f(x_i^*) and the width is \Delta x . The area of the rectangle is then f(x_i^*) \cdot \Delta x .
  4. Sum the areas:
    Add up the areas of all the rectangles to get an approximation of the total area under the curve:
    R_n = \sum_{i=1}^{n} f(x_i^*) \cdot \Delta x
    Where:
  • n is the number of rectangles (subintervals).
  • f(x_i^*) is the function evaluated at the sample point x_i^* .
  • \Delta x is the width of each subinterval.

Types of Riemann sums:

  • Left Riemann sum: The sample points x_i^* are taken to be the left endpoints of each subinterval.
  • Right Riemann sum: The sample points x_i^* are taken to be the right endpoints of each subinterval.
  • Midpoint Riemann sum: The sample points x_i^* are taken to be the midpoints of each subinterval.

As the number of rectangles (n) increases:

  • The approximation becomes more accurate because the rectangles fit the curve more closely.
  • In the limit, as n \to \infty , the Riemann sum approaches the exact value of the definite integral of f(x) over the interval [a, b]:
    \lim_{n \to \infty} R_n = \int_a^b f(x) \, dx

Example:

Let’s approximate the integral \int_0^1 x^2 \, dx using a Riemann sum with 4 subintervals (n = 4):

  1. Divide the interval [0, 1] into 4 equal parts, so \Delta x = \frac{1-0}{4} = 0.25 .
  2. For a left Riemann sum, the sample points are x_0 = 0 , x_1 = 0.25 , x_2 = 0.5 , x_3 = 0.75 .
  3. Evaluate f(x) = x^2 at those points:
  • f(0) = 0^2 = 0
  • f(0.25) = 0.25^2 = 0.0625
  • f(0.5) = 0.5^2 = 0.25
  • f(0.75) = 0.75^2 = 0.5625
  1. Multiply each value by \Delta x = 0.25 and sum them:
    R_4 = 0 \cdot 0.25 + 0.0625 \cdot 0.25 + 0.25 \cdot 0.25 + 0.5625 \cdot 0.25 = 0 + 0.015625 + 0.0625 + 0.140625 = 0.21875

Thus, the Riemann sum approximation of the integral is 0.21875 .


Discover more from Science Comics

Subscribe to get the latest posts sent to your email.

Leave a Reply

error: Content is protected !!