Advanced Topic 43 of 51 Math for Computing
Numerical Integration
Approximating integrals by sampling.
How it works
Numerical integration approximates definite integrals when antiderivatives are unknown or the function is given as data. Newton-Cotes rules replace the function with polynomials: the trapezoidal rule uses straight segments with error O(h squared), Simpson's rule uses parabolas with error O(h to the fourth). Gaussian quadrature chooses optimal nodes and weights to integrate polynomials of high degree exactly with few points. Adaptive methods refine where the function varies quickly, Romberg uses extrapolation and Monte Carlo methods handle high dimensions.
Where it is used
Computing areas and volumes, probabilities from densities without closed forms, physics simulations, finance option pricing and solving differential equations use numerical integration.
Common pitfall
Singularities, oscillation and infinite ranges need transformations or special methods. Too coarse a step gives large errors, while too fine increases rounding error. Fixed grids waste effort on smooth regions. Estimate error by comparing results at two resolutions, use adaptive libraries such as SciPy's quad and avoid grids for high-dimensional integrals.
Where it fits in the course
Numerical Integration is topic 43 of 51 in Math for Computing, rated Advanced. It follows Root Finding. The next topic is Interpolation.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Math for Computing quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Math for Computing quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Numerical Integration?
Where do people use Numerical Integration?
What is the most common mistake with Numerical Integration?
What should I learn before this topic?
How can I practice it?
Is Numerical Integration hard to learn?
How long does it take to learn Numerical Integration?
Which topics are related to Numerical Integration?
What should I study after Numerical Integration?
Related topics
- Root Finding (Math for Computing)
- Interpolation (Math for Computing)
- Floating Point Error (Math for Computing)
- Markov Chains (Math for Computing)
- Integration Testing (Software Engineering)
- Continuous Integration (DevOps & Tooling)