Numerical integration using various methods such as Trapezoidal and Simpson’s methods.

Theory

Introduction

Numerical integration is a computational technique used to approximate the definite integral of a function when an analytical solution is difficult or impossible to obtain. In many practical problems, especially in scientific experiments and numerical simulations, function values are available only at discrete points. Numerical integration enables the estimation of the area under a curve using these discrete data points.

Principle of Numerical Integration

The basic principle of numerical integration is to divide the interval of integration, from the lower limit 𝑎 to the upper limit 𝑏, into a finite number of smaller sub-intervals of equal width. If the interval is divided into 𝑛 sub-intervals, the step size ℎ is given by

image

Over each sub-interval, the function is approximated using simple geometric shapes whose areas can be easily calculated. The total area under the curve is then obtained by summing the areas of these shapes.

Trapezoidal Rule

In the Trapezoidal Rule, the curve between two consecutive data points is approximated by a straight line, forming a trapezoid. The area under the curve is estimated by summing the areas of all trapezoids formed over the sub-intervals.

The Trapezoidal Rule is mathematically expressed as:

image

This method is simple to implement and provides good accuracy for functions that do not change rapidly over the integration interval.

Simpson’s Rule

Simpson’s Rule improves upon the Trapezoidal Rule by approximating the function using parabolic curves instead of straight lines. This method requires the number of sub-intervals to be even and uses quadratic interpolation to estimate the area under the curve.

The mathematical expression for Simpson’s Rule is:

image

Due to its higher-order approximation, Simpson’s Rule generally provides more accurate results for smooth and continuous functions.

Accuracy and Step Size Considerations

The accuracy of numerical integration depends on the number of sub-intervals and the step size ℎ . A smaller step size generally leads to better accuracy but increases computational effort. Choosing an appropriate step size is therefore essential for reliable integration results.

Applications of Numerical Integration

Numerical integration is widely used in physics, engineering, computer science, and environmental studies. Common applications include calculating displacement from velocity data, estimating work and energy, determining areas and volumes, and analyzing experimental and measured datasets where analytical integration is not feasible.