Approximate definite integrals using multiple numerical methods. Compare Riemann sums, Trapezoidal Rule, Simpson's Rule, and Monte Carlo integration with visualizations.
Numerical integration is used to approximate definite integrals when an analytical solution is difficult or impossible to find. These methods are essential in physics, engineering, finance, and data science.
Concept: Approximate the area under the curve by summing areas of rectangles.
Left Riemann Sum: \(\displaystyle L_n = \sum_{i=0}^{n-1} f(x_i) \Delta x\)
Right Riemann Sum: \(\displaystyle R_n = \sum_{i=1}^{n} f(x_i) \Delta x\)
Midpoint Rule: \(\displaystyle M_n = \sum_{i=1}^{n} f\left(\frac{x_{i-1}+x_i}{2}\right) \Delta x\)
where \(\Delta x = \frac{b-a}{n}\) and \(x_i = a + i\Delta x\)
Accuracy: \(O(\Delta x)\) for Left/Right, \(O(\Delta x^2)\) for Midpoint
Concept: Approximate the area using trapezoids instead of rectangles.
\(\displaystyle T_n = \frac{\Delta x}{2} \left[f(x_0) + 2\sum_{i=1}^{n-1} f(x_i) + f(x_n)\right]\)
Accuracy: \(O(\Delta x^2)\) - More accurate than Riemann sums for the same number of intervals.
Geometric Interpretation: The area under the curve is approximated by the sum of trapezoids formed by connecting consecutive points on the function.
Concept: Approximate the function with quadratic polynomials (parabolas) over pairs of intervals.
\(\displaystyle S_n = \frac{\Delta x}{3} \left[f(x_0) + 4\sum_{i=1,3,5,\ldots}^{n-1} f(x_i) + 2\sum_{i=2,4,6,\ldots}^{n-2} f(x_i) + f(x_n)\right]\)
Note: n must be even for Simpson's Rule.
Accuracy: \(O(\Delta x^4)\) - Significantly more accurate than trapezoidal rule for smooth functions.
Application: Works best when the function is smooth and can be well-approximated by quadratic polynomials.
Concept: Use random sampling to estimate the integral. Particularly useful for high-dimensional integrals.
\(\displaystyle I \approx (b-a) \cdot \frac{1}{N} \sum_{i=1}^{N} f(x_i)\)
where \(x_i\) are uniformly distributed random points in \([a, b]\)
Accuracy: \(O\left(\frac{1}{\sqrt{N}}\right)\) - Slower convergence but works for high-dimensional problems where other methods fail.
Advantage: Works for complex domains and high-dimensional integrals where other methods are impractical.
Order of Convergence: Describes how quickly the error decreases as the number of intervals increases.
Error Estimation: For methods with known convergence orders, we can estimate the error by comparing approximations with different numbers of intervals.
Richardson extrapolation can be used to improve accuracy by combining results from different step sizes.
Adaptive Methods: In practice, adaptive quadrature methods change the interval size based on function behavior - using smaller intervals where the function changes rapidly and larger intervals where it's relatively constant.
Calculator Features: