Daily Chess Puzzle – Train your tactical vision with fresh puzzles. Click any card, think, and then reveal the solution in the post body.

Errors in quadrature formulae

Errors in Quadrature: An Interactive Masterclass
A magnifying glass over a complex mathematical graph, focusing on the error

Errors in Numerical Integration: An Interactive Masterclass

Go beyond the formulas and become a numerical detective. Learn how to predict, analyze, and visualize the errors in our best approximation methods.

The Most Important Question: "How Wrong Are We?"

We've learned powerful "recipes" like the Trapezoidal and Simpson's rules to find the area under complex curves. We plug in numbers and get an answer. But in science and engineering, a number without an error estimate is meaningless. Is our calculation for a spacecraft's fuel consumption accurate to the nearest liter, or the nearest thousand liters? Is our estimate for a bridge's load capacity safe by a factor of two, or is it right on the edge of failure? Without knowing the error, our "answer" is just a guess.

This masterclass is about moving from guessing to knowing. We will become numerical detectives, using the powerful Taylor SeriesThe powerful tool that allows us to represent any smooth function as an infinite sum of simple polynomial terms. It is the key to deriving our error formulas. as our magnifying glass to dissect our integration formulas and find the hidden "error terms" within. We'll learn not just that Simpson's Rule is better than the Trapezoidal Rule, but precisely *why* it's better and *by how much*.

Understanding these errors allows us to choose the right tool for the job, to know how many steps we need to achieve a desired accuracy, and even to use clever tricks to get better results from less work.


The Source of the Crime: Truncation Error

When we discuss errors in quadrature formulas, we are primarily talking about truncation errorThe error we deliberately introduce by using a finite approximation (like a parabola) for a process that is truly infinite or more complex (the real function).. This isn't a mistake or a computer glitch; it's the intrinsic error that comes from our core strategy: approximating a complex function $f(x)$ with a simpler polynomial $P(x)$. The error is the area that the polynomial approximation misses.

$$ E_t = \int_a^b f(x) dx - \int_a^b P(x) dx = \int_a^b (f(x) - P(x)) dx $$

The key to finding a formula for this error lies in our master tool for understanding the difference between a function and its polynomial approximation: the error term from Taylor's Theorem. By integrating this error term, we can derive a precise formula for the truncation error of our integration rules.

Local vs. Global Error

We need to distinguish between two types of truncation error:

  • Local Truncation Error: The error from applying our rule just once over a single panel (e.g., one trapezoid or one parabola).
  • Global Truncation Error: The total, cumulative error from applying a composite rule over many panels across the entire interval.

Case File #1: The Trapezoidal Rule Error

Let's put on our detective hats and investigate the Trapezoidal Rule. We know it approximates a curve with a straight line. The error, therefore, must be related to how "un-line-like" the function is.

Deriving the Error Formula

Through a detailed derivation that involves integrating the Taylor series error term, we can find the exact formula for the local truncation error of the single-segment Trapezoidal Rule:

$$ E_t = -\frac{1}{12} f''(c) h^3 $$

Here, $h$ is the width of the interval, and $f''(c)$ is the second derivative at some point $c$ within the interval. This confirms our intuition: the error is proportional to the second derivative, or the curvatureCurvature measures how sharply a curve is bending. A gentle curve has low curvature, while a tight corner has high curvature. of the function. A bendy function will have a large error.

Global Error and Order of Accuracy

For the composite rule with $n$ intervals, the total error is the sum of these local errors. This leads to the global error formula:

$$ E_t \approx -\frac{(b-a)}{12} h^2 \bar{f}'' $$

The most important part is the $h^2$ term. This tells us the Trapezoidal Rule is a second-order method. We write its error as $O(h^2)$. This means if we halve our step size, we quarter the error.


Case File #2: The Simpson's 1/3 Rule Error

Now we turn to Simpson's Rule, which approximates the curve with a parabola. Since a parabola can bend, we expect it to be much more accurate.

The "Magic" of the Fourth Derivative

When we perform the same derivation for Simpson's Rule, something remarkable happens. We are fitting a 2nd-degree polynomial, so we expect the error to depend on the 3rd derivative. However, due to the perfect symmetry of the formula, the error term involving the 3rd derivative magically cancels out to zero! The first term that *doesn't* cancel is the one involving the fourth derivative. The local error for a single panel is:

$$ E_t = -\frac{1}{90} h^5 f^{(4)}(c) $$

This is an incredible result. We get the accuracy of a cubic approximation for the price of a quadratic one! This is why Simpson's Rule is so famously powerful.

Global Error and Order of Accuracy

Summing these local errors gives us the global error for the composite rule:

$$ E_t \approx -\frac{(b-a)}{180} h^4 \bar{f}^{(4)} $$

The error is proportional to $h^4$. Simpson's Rule is a fourth-order method, or $O(h^4)$. If you halve the step size, you reduce the error by a factor of $2^4 = 16$! This rapid reduction in error is what makes it the default choice for most engineering and scientific problems.


The Error Showdown Visualizer

Let's visualize this difference in accuracy. This lab plots the True Error vs. Step Size (h) on a log-log scale. On such a plot, a method with error $O(h^p)$ will appear as a straight line with slope $p$. Watch as the line for the Trapezoidal Rule shows a slope of 2, while the line for Simpson's Rule shows a much steeper slope of 4, visually proving its superior convergence rate.

Error vs. Step Size

The graph shows how the error shrinks as the step size `h` gets smaller for each method. Notice the steeper slope for Simpson's rule, indicating much faster convergence. Also, observe how for very small `h`, round-off error can cause the lines to become chaotic.


Solving Numerical Problems

Problem 1: Estimating and Bounding Error

Question: For the integral $I = \int_0^\pi \sin(x) dx$, estimate the error when using the composite Trapezoidal rule with $n=10$ intervals.

Step 1: Identify Parameters
$a=0, b=\pi, n=10$, so $h = (\pi - 0)/10 = \pi/10$. The function is $f(x) = \sin(x)$.

Step 2: Find the Derivative for the Error Formula
The error formula for the composite Trapezoidal rule is $E_t \approx -\frac{(b-a)}{12} h^2 \bar{f}''$.
We need the second derivative: $f'(x) = \cos(x)$, so $f''(x) = -\sin(x)$.

Step 3: Find the Average Second Derivative
We need to find the average value of $f''(x)$ over $[0, \pi]$. The formula for the average value of a function is $\frac{1}{b-a}\int_a^b g(x)dx$. $$ \bar{f}'' = \frac{1}{\pi-0}\int_0^\pi -\sin(x) dx = \frac{1}{\pi}[\cos(x)]_0^\pi = \frac{1}{\pi}(\cos(\pi) - \cos(0)) = \frac{1}{\pi}(-1-1) = -\frac{2}{\pi} $$

Step 4: Calculate the Error Estimate
$$ E_t \approx -\frac{(\pi)}{12} \left(\frac{\pi}{10}\right)^2 \left(-\frac{2}{\pi}\right) = \frac{\pi}{12} \frac{\pi^2}{100} \frac{2}{\pi} = \frac{2\pi^2}{1200} = \frac{\pi^2}{600} $$ $$ E_t \approx \frac{(3.14159)^2}{600} \approx \frac{9.8696}{600} \approx 0.01645 $$

Conclusion: We can estimate that the error will be approximately 0.01645. (The true value of the integral is 2. A numerical calculation with n=10 gives approx. 1.9835, for a true error of 0.0165, so our estimate was excellent!)


Test Your Intuition!

Integration Errors Quiz

No comments

No comments yet. Be the first!

Post a Comment

Search This Blog

Explore More Topics

Loading topics…