Navigation

Concept Review

Integral Calculus

Numerical Integration

🔹 Riemann Sum

Approximate area under f(x)f(x) using rectangles.

General form:

∫abf(x) dx≈f(x1∗)Δx+f(x2∗)Δx+⋯+f(xn∗)Δx\int_a^b f(x)\,dx \approx f(x_1^*)\Delta x + f(x_2^*)\Delta x + \cdots + f(x_n^*)\Delta x
  • Δx=b−an\Delta x = \frac{b-a}{n}
  • xi∗x_i^* can be:
    • Left: x1=ax_1 = a, x2=a+Δxx_2 = a+\Delta x, ..., xn=a+(n−1)Δxx_n = a+(n-1)\Delta x
    • Right: x1=a+Δxx_1 = a+\Delta x, x2=a+2Δxx_2 = a+2\Delta x, ..., xn=bx_n = b
    • Midpoint: x1=a+12Δxx_1 = a+\tfrac{1}{2}\Delta x, x2=a+32Δxx_2 = a+\tfrac{3}{2}\Delta x, ..., xn=b−12Δxx_n = b-\tfrac{1}{2}\Delta x

🔹 Trapezoidal Rule

Approximate area using trapezoids.

Formula:

∫abf(x) dx≈Δx2[f(x0)+2f(x1)+2f(x2)+⋯+2f(xn−1)+f(xn)]\int_a^b f(x)\,dx \approx \frac{\Delta x}{2} \big[ f(x_0) + 2f(x_1) + 2f(x_2) + \cdots + 2f(x_{n-1}) + f(x_n) \big]
  • Points: x0=ax_0 = a, x1=a+Δxx_1 = a+\Delta x, ..., xn=bx_n = b
  • More accurate than basic Riemann sums
  • Uses linear approximation

🔹 Simpson’s Rule

Uses parabolas (quadratics) for better accuracy.

Formula (n must be even):

∫abf(x) dx≈Δx3[f(x0)+4f(x1)+2f(x2)+4f(x3)+⋯+2f(xn−2)+4f(xn−1)+f(xn)]\int_a^b f(x)\,dx \approx \frac{\Delta x}{3} \big[ f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + \cdots + 2f(x_{n-2}) + 4f(x_{n-1}) + f(x_n) \big]
  • Points: x0=ax_0 = a, x1=a+Δxx_1 = a+\Delta x, ..., xn=bx_n = b
  • Pattern: 1,4,2,4,2,…,4,11,4,2,4,2,\dots,4,1
  • Very accurate for smooth functions

🔹 Quick Comparison

MethodShape UsedAccuracyKey Idea
RiemannRectanglesLow–MediumSample points
TrapezoidalTrapezoidsMediumLinear interpolation
SimpsonParabolasHighQuadratic interpolation

🔹 Pro Tip

  • If function is linear → trapezoidal is exact
  • If function is quadratic → Simpson is exact
  • Increasing nn → improves all methods