Graduate

GraduateNumerical AnalysisNumerical Integration and Differentiation


Error Analysis in Numerical Integration and Differentiation


Numerical analysis is a branch of mathematics that deals with algorithms and numerical approximations for solving mathematical problems. When it comes to integration and differentiation, exact calculations are often impossible or impractical, and for this reason, we use numerical methods. However, these methods come with an inherent challenge: error analysis. First, we must ask, what is error analysis? Simply put, error analysis evaluates the accuracy and limitations of numerical solutions.

This discussion will introduce you to the essential elements of error analysis in numerical integration and differentiation, and show how it can affect the reliability of scientific and engineering calculations.

Introduction to numerical error

Numerical errors can arise from a variety of sources, including:

  • Truncation error: resulting from approximations of exact mathematical procedures.
  • Rounding error: This error arises due to the limited number of digits through which computers represent real numbers.

Often, the emphasis is on truncation error in numerical integration and differentiation because round-off errors are specific to hardware or software limitations.

Numerical integration

Understanding truncation error

Consider the task of evaluating an integral numerically. In many cases, we use approximations such as the trapezoidal rule or Simpson's rule. Each of these rules has an associated truncation error.

Trapezoidal rule

The trapezoidal rule approximates the integral of a function using the formula:

[ int_{a}^{b} f(x) , dx approx frac{b-a}{2} left( f(a) + f(b) right) ]

The error of this approximation can be expressed as:

[ E_{T} = -frac{(b-a)^3}{12} f''(xi) ]

where ( f''(xi) ) is the second derivative of ( f ) evaluated at some point ( xi ) in the interval ([a, b]).

Visual example: trapezoidal rule

AXB

The area under the curve is approximated by the trapezoid (in grey). The true integral is the area under the curve in blue, which illustrates the concept of truncation error.

Simpson's rule

Simpson's rule provides a more accurate estimate using parabolic segments:

[ int_{a}^{b} f(x) , dx approx frac{b-a}{6} left( f(a) + 4fleft(frac{a+b}{2}right) + f(b) right) ]

The truncation error is given as:

[ E_{S} = -frac{(b-a)^5}{2880} f^{(4)}(xi) ]

Example calculation

Suppose you want to numerically integrate the function ( f(x) = sin(x) ) from ( x = 0 ) to ( x = pi ) using both methods.

Use of trapezoidal rule:

[ int_{0}^{pi} sin(x) , dx approx frac{pi - 0}{2} left(sin(0) + sin(pi)right) = frac{pi}{2} (0 + 0) = 0 ] [ E_{T} approx -frac{pi^3}{12} (-sin(xi)) approx 0 ]

Use of Simpson's rule:

[ int_{0}^{pi} sin(x) , dx approx frac{pi}{6} left(0 + 4 sinleft(frac{pi}{2}right) + 0right) = frac{pi}{6} times 4 = frac{2pi}{3} ] [ E_{S} approx -frac{pi^5}{2880} cos(xi) approx 0 ]

The actual integral is 2. The approximation using Simpson's rule is close to the exact value, and has small truncation error.

Numerical differentiation

Types of differentiation

In numerical differentiation, the objective is to calculate the derivative using discrete data points rather than a continuous function. Common methods include forward difference, backward difference, and central difference.

Forward difference

This technique uses the following approximation formula for the first derivative:

[ f'(x) approx frac{f(x + h) - f(x)}{h} ]

The truncation error can be represented as:

[ E_{F} approx -frac{h}{2} f''(xi) ]

Visual example: forward difference

XX + H

The green line shows the slope (i.e., the derivative at the point (x)). Forward differencing estimates the slope based on a future point (x + h).

Central difference

A more accurate method is the central difference, which uses the points on both sides:

[ f'(x) approx frac{f(x + h) - f(x - h)}{2h} ]

The truncation error is given as:

[ E_{C} approx -frac{h^2}{6} f^{(3)}(xi) ]

Example calculation

Let us evaluate the derivative of ( f(x) = x^2 ) at ( x = 1 ) with ( h = 0.1 ).

Using forward difference:

[ f'(1) approx frac{f(1.1) - f(1)}{0.1} = frac{1.21 - 1}{0.1} = 2.1 ] [ E_{F} approx -frac{0.1}{2} times 2 = -0.1 ]

Use of central difference:

[ f'(1) approx frac{f(1.1) - f(0.9)}{0.2} = frac{1.21 - 0.81}{0.2} = 2 ] [ E_{C} approx -frac{(0.1)^2}{6} times 0 = 0 ]

The exact derivative is ( f'(x) = 2x ), so at ( x = 1 ) is 2. Central difference provided an exact result, while forward difference had a small error due to the reduction.

Conclusion

Error analysis is an important component of numerical integration and differentiation. It provides valuable information about the limitations and possible improvements of numerical methods. Understanding the sources and types of errors allows mathematicians and engineers to optimize algorithms and choose the right methods for specific applications. By reducing error, we can increase the accuracy of numerical calculations important for scientific research and technological innovation.


Graduate → 6.3.3


U
username
0%
completed in Graduate


Comments