Skip to main content
Interactive 3D/Numerical Integration
Function
Method
Panels n
n = 6 panels
Interval [a, b]
a = 0.00
b = 3.14
Results
True value:2.000000
Trapezoid:1.954097
|Error|:4.590e-2
Convergence: Trapezoid O(h²), Simpson O(h⁴), Gaussian O(h^2p) - for p nodes, exact on polynomials of degree 2p−1. Watch the error chart steepen as n grows.

Numerical Integration - Interactive Visualization

Numerical integration approximates definite integrals using finite summation. The trapezoid rule uses first-order polynomial fits. Simpson's rule uses second-order, dramatically reducing error. Gaussian quadrature uses strategically placed points (Gauss-Legendre nodes) to achieve polynomial exactness far beyond its apparent simplicity - n points exactly integrate polynomials up to degree 2n-1.

  • Choose from sin, x², exp(-x²), |x| and integration bounds
  • Compare trapezoid, Simpson, and Gaussian quadrature on the same function
  • Adjust n (number of panels/points) to see error decrease
  • See error vs n convergence rate: O(h²) vs O(h⁴) vs exponential
  • Foundation for Monte Carlo integration, expectation computation, and normalizing constants

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.