Use this interactive Desmos applet below to visualize and compute numerical approximations to the definite integral $\displaystyle\int\limits_a^b f(x)~\mathrm{d}x$ over an interval $\left\lbrack a, b\right\rbrack$ partitioned into $N$ subintervals of width $\Delta x = \frac{b - a}{N}$.

Features and Instructions

  • Customizable Parameters and Integrand: Set the interval endpoints $a$ and $b$ (with $a<b$), adjust the number of rectangles $N$ using the slider, and enter a function $f(x)$.
  • Visualized Geometric Approximations: Click the circle icon in the left gutter next to any rule folder to toggle its geometric region on the graph, and expand the folder using the triangle button to inspect its value:
    • Left Rule ($L_{\text{eft}}(N)$, Blue): Evaluates $f(x)$ at the left endpoint of each subinterval.
    • Right Rule ($R_{\text{ight}}(N)$, Red): Evaluates $f(x)$ at the right endpoint of each subinterval.
    • Trapezoid Rule ($T_{\text{rap}}(N)$, Purple): Connects subinterval endpoints with line segments and computes ${T_{\text{rap}}(N) = \dfrac{L_{\text{eft}}(N) + R_{\text{ight}}(N)}{2}}$.
    • Midpoint Rule ($M_{\text{id}}(N)$, Orange): Evaluates $f(x)$ at the midpoint of each subinterval.
  • Simpson’s Rule and Exact Definite Integral: Expand the Simpson’s Rule (Calculation Only) folder to view the weighted average ${S_{\text{imp}}(2N) = \dfrac{2M_{\text{id}}(N) + T_{\text{rap}}(N)}{3}}$ and expand Exact Value (via Integration) to compare the approximations against $\displaystyle\int\limits_a^b f(x),\mathrm{d}x$.
  • Utility Controls: Use Toggle Hidden Objects below the applet to inspect the underlying piecewise definitions and summation formulas, or click Save Graph to download a high-resolution PNG screenshot of the current plot.

Calculator Applet