Courses / Mathematics I
Scientific Programming

Numerical Integration

Many definite integrals have no closed-form antiderivative — e^-x^2\, dx (the Gaussian) is the famous example.

Mathematics I 339 words Free to read

Computing Integrals Numerically

Many definite integrals have no closed-form antiderivative — ex2dx\int e^{-x^2}\, dx (the Gaussian) is the famous example. When the Fundamental Theorem cannot be applied, numerical integration (quadrature) approximates the integral directly from function values, refining the Riemann-sum idea of Unit 6.

The methods approximate the area under the curve with simple shapes on each subinterval:

The overarching principle: finer subdivisions (smaller hh) give more accuracy, and higher-order rules (fitting richer shapes) converge faster still. Simpson's rule is exact for polynomials up to degree three, which is why it excels on smooth functions.

The subtlety that reconnects to Lesson 2: you cannot make hh arbitrarily small in search of perfect accuracy. Shrinking hh reduces the method's (truncation) error, but very small hh means summing very many tiny terms, so accumulated round-off error eventually grows. There is an optimal subdivision, and a good rule (like Simpson's) reaches high accuracy at a modest hh, avoiding the round-off regime. Numerical integration is a workhorse across physics, statistics (integrating probability densities), and engineering.

Common pitfall: assuming that more subdivisions always give a better answer, without limit. A smaller step size reduces the truncation error of the rule, but summing ever more tiny contributions eventually lets round-off error accumulate and dominate — so accuracy improves only up to an optimal hh. Using a higher-order rule (Simpson's over trapezoidal) is usually the better path to accuracy than blindly shrinking hh.

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

11practice questions
2interactive scenes
Start Mathematics I free

Scientific Programming