Learn Numerical Integration with interactive visualization, step-by-step calculations, dynamic graphs, and automatic solutions.
Approximates the area under a curve using 1st-degree linear interpolations (trapezoids). Works with any number of intervals.
Approximates the area using 2nd-degree quadratic curves (parabolas). Offers higher accuracy, but requires an even number of subintervals.
Approximates the area using 3rd-degree cubic segments. Requires the number of subintervals to be a multiple of 3.
Not just answers, but detailed, pedagogical steps including finding step size $h$, computing the points tables, and substituting terms.
Plotly integration displays the function curve and plots the precise geometric boundaries to visualize the approximation area.
Formula derivations and layouts modeled directly on university mathematical syllabi and Newton-Cotes formulations.
Integration is the mathematical process used to find the total accumulation of a quantity. Most commonly, it represents the area under a curve on a graph.
Gives a family of functions plus an integration constant $C$. It has no defined boundaries.
Gives a specific numerical value. It is evaluated between defined boundaries, from $a$ to $b$.
Numerical integration is a branch of numerical analysis that provides algorithms for estimating the value of a definite integral when analytical solutions are difficult or impossible to calculate.
The area under a curve is approximated by dividing the interval $[a, b]$ into $n$ smaller sections and approximating each section using simpler geometric shapes:
| Aspect | Analytical Integration | Numerical Integration |
|---|---|---|
| Precision | Gives the exact value using mathematical formulas | Gives an approximate value using calculations |
| Input Requirements | Requires a known, differentiable mathematical function | Works with complex formulas or tabulated discrete coordinates |
| Difficulty | Can be extremely difficult or impossible for complicated functions | Uniformly simple, computer-friendly arithmetic steps |
| Result Output | Provides symbolic function formulas or exact values | Provides numerical values rounded to required decimals |
The main closed-form methods of numerical integration are derived from the Newton–Cotes Quadrature Formulas. These approximate the value of an integral by replacing the actual function $f(x)$ with an interpolating polynomial $P_n(x)$ of degree $n$ over equally spaced points.
Let $y = f(x)$ be a function evaluated at $n+1$ equally spaced partition points $x_0, x_1, x_2, \dots, x_n$ where $x_i = x_0 + ih$, and $h$ is the step size:
Let's evaluate the definite integral:
We replace $f(x)$ with Newton's Forward Difference Interpolation Formula:
where $x = x_0 + rh$, which gives $dx = h \, dr$.
Changing the limits of integration from $x$ to $r$:
Substituting these into the definite integral:
Integrating this term-by-term with respect to $r$ over the interval $[0, n]$:
Applying the limits $0$ and $n$ and simplifying by factoring out $n$:
This is the General Newton–Cotes Quadrature Formula (or General Quadrature Formula). By setting $n = 1, 2,$ or $3$, we derive the specific integration rules.
If the integration limits $a$ and $b$ are part of the interpolating point set ($x_0 = a$ and $x_n = b$), the formula is Closed Form (e.g. Trapezoidal, Simpson's Rules). If the integration limits lie outside the interpolating points, the formula is Open Form.
Derived by setting $n = 1$ in the General Newton-Cotes formula, assuming the curve is a straight line $y = Ax + B$ in each subinterval.
For $n = 1$, the general formula is integrated over a single interval $[x_0, x_1]$:
Summing across all $n$ subintervals (Composite form):
Derived by setting $n = 2$ in the General Newton-Cotes formula, replacing the curve in each pair of intervals with a second-degree quadratic parabola.
Integrating over two adjacent intervals $[x_0, x_2]$ (setting $n=2$):
Extending this to multiple subintervals. Because we require groups of two subintervals, the total number of subintervals $n$ must be even.
Derived by setting $n = 3$ in the General Newton-Cotes formula, replacing the curve in each group of three intervals with a third-degree cubic polynomial.
Integrating over three adjacent intervals $[x_0, x_3]$ (setting $n=3$):
For composite applications, we group by intervals of 3, meaning the total number of subintervals $n$ must be a multiple of 3.
| Method Name | Degree of Interpolating Polynomial | Number of Intervals ($n$) Required | Formula | Global Error Order |
|---|---|---|---|---|
| Trapezoidal Rule | 1 (Linear) | Any integer ($n \ge 1$) | $I \approx \frac{h}{2}[(y_0 + y_n) + 2\sum y_{rem}]$ | $O(h^2)$ |
| Simpson's 1/3 Rule | 2 (Quadratic) | Must be Even ($n \ge 2$) | $I \approx \frac{h}{3}[(y_0 + y_n) + 4\sum y_{odd} + 2\sum y_{even}]$ | $O(h^4)$ |
| Simpson's 3/8 Rule | 3 (Cubic) | Must be Multiple of 3 ($n \ge 3$) | $I \approx \frac{3h}{8}[(y_0 + y_n) + 3\sum y_{\text{not div 3}} + 2\sum y_{\text{div 3}}]$ | $O(h^4)$ |