🔹 Riemann Sum
Approximate area under f(x) using rectangles.
General form:
∫abf(x)dx≈f(x1∗)Δx+f(x2∗)Δx+⋯+f(xn∗)Δx
- Δx=nb−a
- xi∗ can be:
- Left: x1=a, x2=a+Δx, ..., xn=a+(n−1)Δx
- Right: x1=a+Δx, x2=a+2Δx, ..., xn=b
- Midpoint: x1=a+21Δx, x2=a+23Δx, ..., xn=b−21Δx
🔹 Trapezoidal Rule
Approximate area using trapezoids.
Formula:
∫abf(x)dx≈2Δx[f(x0)+2f(x1)+2f(x2)+⋯+2f(xn−1)+f(xn)]
- Points: x0=a, x1=a+Δx, ..., xn=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≈3Δx[f(x0)+4f(x1)+2f(x2)+4f(x3)+⋯+2f(xn−2)+4f(xn−1)+f(xn)]
- Points: x0=a, x1=a+Δx, ..., xn=b
- Pattern: 1,4,2,4,2,…,4,1
- Very accurate for smooth functions
🔹 Quick Comparison
| Method | Shape Used | Accuracy | Key Idea |
|---|
| Riemann | Rectangles | Low–Medium | Sample points |
| Trapezoidal | Trapezoids | Medium | Linear interpolation |
| Simpson | Parabolas | High | Quadratic interpolation |
🔹 Pro Tip
- If function is linear → trapezoidal is exact
- If function is quadratic → Simpson is exact
- Increasing n → improves all methods