Understanding Numerical Integration

Numerical integration estimates the value of a definite integral by sampling the function on a finite set of subintervals. This is useful when an exact antiderivative is unavailable or inconvenient.

Trapezoidal Rule

The Trapezoidal Rule approximates the area under the curve by dividing it into trapezoids. The formula is:

$$ \int_a^b f(x) \, dx \approx \frac{h}{2} \left[ f(x_0) + 2f(x_1) + 2f(x_2) + \cdots + 2f(x_{n-1}) + f(x_n) \right] $$

Here \( h = \frac{b-a}{n} \) is the step size and \( n \) is the number of subintervals.

Simpson's Rule

Simpson's Rule uses quadratic polynomials to approximate the curve, generally providing a more accurate approximation than the Trapezoidal Rule, especially for smooth functions. The formula is:

$$ \int_a^b f(x) \, dx \approx \frac{h}{3} \left[ f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + \cdots + 2f(x_{n-2}) + 4f(x_{n-1}) + f(x_n) \right] $$

Simpson's Rule typically gives a better estimate for smooth curves, but it requires an even number of subintervals.

Using the Calculator

  • Enter your function in terms of 'x' (e.g., sin(x), x^2 + 2x).
  • Specify the lower and upper bounds of integration.
  • Choose the numerical method: Trapezoidal or Simpson's Rule.
  • Select how many subintervals to use. More subdivisions usually improve the estimate.
  • Click 'Calculate' to get the approximate integral value.
  • View the visualization of the function and the approximated area under the curve.