Mathwords logoMathwords

Numerical Integration — Definition, Formula & Examples

Numerical integration is a set of techniques for approximating the value of a definite integral using arithmetic calculations on sampled function values, rather than finding an exact antiderivative.

Given a definite integral abf(x)dx\int_a^b f(x)\,dx, numerical integration (or numerical quadrature) estimates its value by partitioning [a,b][a, b] into nn subintervals and computing a weighted sum of function values at selected points, producing an approximation whose error can be bounded in terms of nn and the derivatives of ff.

Key Formula

Tn=h2[f(x0)+2i=1n1f(xi)+f(xn)],h=banT_n = \frac{h}{2}\Bigl[f(x_0) + 2\sum_{i=1}^{n-1} f(x_i) + f(x_n)\Bigr], \quad h = \frac{b-a}{n}
Where:
  • a,ba, b = Lower and upper bounds of integration
  • nn = Number of subintervals
  • hh = Width of each subinterval
  • xix_i = The $i$-th partition point: $x_i = a + ih$

How It Works

You divide the interval [a,b][a, b] into nn equal subintervals of width h=banh = \frac{b - a}{n}. For the Trapezoidal Rule, you approximate the area under the curve by connecting consecutive points with straight lines, giving Tn=h2[f(x0)+2f(x1)++2f(xn1)+f(xn)]T_n = \frac{h}{2}\bigl[f(x_0) + 2f(x_1) + \cdots + 2f(x_{n-1}) + f(x_n)\bigr]. For Simpson's Rule (which requires nn even), you fit parabolas through consecutive triples of points, giving Sn=h3[f(x0)+4f(x1)+2f(x2)+4f(x3)++4f(xn1)+f(xn)]S_n = \frac{h}{3}\bigl[f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + \cdots + 4f(x_{n-1}) + f(x_n)\bigr]. Simpson's Rule is generally more accurate for smooth functions because parabolas track curvature better than straight lines. Increasing nn reduces error in both methods.

Worked Example

Problem: Use the Trapezoidal Rule with n=4n = 4 to approximate 02x2dx\int_0^2 x^2\,dx.
Step 1: Compute the subinterval width.
h=204=0.5h = \frac{2 - 0}{4} = 0.5
Step 2: List the partition points and function values: x0=0,  x1=0.5,  x2=1,  x3=1.5,  x4=2x_0=0,\; x_1=0.5,\; x_2=1,\; x_3=1.5,\; x_4=2 with f(x)=x2f(x)=x^2 giving 0,  0.25,  1,  2.25,  40,\; 0.25,\; 1,\; 2.25,\; 4.
Step 3: Apply the Trapezoidal Rule formula.
T4=0.52[0+2(0.25)+2(1)+2(2.25)+4]=0.25[0+0.5+2+4.5+4]=0.25(11)=2.75T_4 = \frac{0.5}{2}\bigl[0 + 2(0.25) + 2(1) + 2(2.25) + 4\bigr] = 0.25\bigl[0 + 0.5 + 2 + 4.5 + 4\bigr] = 0.25(11) = 2.75
Answer: T4=2.75T_4 = 2.75. The exact value is 832.6667\frac{8}{3} \approx 2.6667, so the approximation overshoots by about 0.08330.0833.

Why It Matters

Many real-world integrals, such as those arising from experimental data or functions like ex2e^{-x^2}, have no closed-form antiderivative. Numerical integration is the standard tool in engineering, physics, and computational science for evaluating these integrals to any desired accuracy.

Common Mistakes

Mistake: Using Simpson's Rule with an odd number of subintervals.
Correction: Simpson's Rule requires an even number of subintervals (nn must be even) because it fits parabolas through groups of three consecutive points.