maths.free › Numerical Methods › Numerical integration: trapezoid and Simpson
Numerical integration: trapezoid and Simpson
Approximating an integral from sampled values, with error bounds.
The trapezoid rule joins samples with straight lines (error ∝ h²); Simpson's rule uses parabolas (error ∝ h⁴). Picture it: the area under the curve chopped into strips. Think it: both are exact for polynomials up to a degree, and Richardson extrapolation combines them to cancel error terms.
Vinna dæmi: integrate e^(-x^2) dx from 0 to 1
Skref fyrir skref
- \int_{0}^{1} e^{- x^{2}}\, dx
First find an antiderivative F, then evaluate F(b) − F(a).
- \int e^{- x^{2}}\, dx = \frac{\sqrt{\pi} \operatorname{erf}{\left(x \right)}}{2}
Erf rule.
- F(1) - F(0) = \left(\frac{\sqrt{\pi} \operatorname{erf}{\left(1 \right)}}{2}\right) - \left(0\right)
Fundamental theorem of calculus: plug in the limits.
- = \frac{\sqrt{\pi} \operatorname{erf}{\left(1 \right)}}{2} \approx 0.74682
Simplify.
Sýna svarið
Symbols used here
Antiderivative (indefinite) or signed area from a to b (definite).
The non-negative number whose square (n-th power) is x.
Ratio of a circle's circumference to its diameter, 3.14159…
2.71828…, the base whose exponential is its own derivative.
Equal to the precision shown, not exactly.
Inequalities that allow equality; < and > exclude it.
Instantaneous rate of change; slope of the graph.
Grows no faster than n² (up to a constant), for large n.
The next approximation follows the tangent to the axis.
How to: Numerical integration: trapezoid and Simpson
- First find an antiderivative F, then evaluate F(b) − F(a).
- Erf rule.
- Fundamental theorem of calculus: plug in the limits.
- Simplify.
Questions people ask
Why not just solve exactly?
Most equations have no closed-form solution at all, and many that do are unusable in practice. A numerical method delivers as many correct digits as you need, and a good one tells you how many that is.
Why can Newton's method fail?
If it starts where the tangent is nearly flat it shoots far away; near a repeated root it slows to a crawl; and with several roots it may land on the wrong one. A bracketing method like bisection is slower but cannot fail.
Prófaðu þitt eigið
Meira í Numerical Methods
Root finding: bisection and Newton's methodInterpolation and Taylor approximationFloating point and error