Showing posts with label trapezoidal numerical integration. Show all posts
Showing posts with label trapezoidal numerical integration. Show all posts

Wednesday, August 22

Trapezoidal Numerical Integration


Introduction to numerical integration:  As we have seen, the ideal way to evaluate a definite integral a to b f(x) dx is to find a formula F(x) for one of the antiderivatives of f(x) and calculate the number F(b) – F(a). But some anti derivatives are hard to find, and still others, like the antiderivatives of (sin x)/x and sqrt(1 + x^4), have no elementary formulas. We do not mean merely that no one has yet succeeded in finding elementary formulas for the anti-derivatives of (sin x)/x and sqrt(1 + x^4). We mean it has been proved that no such formulas exist. Whatever, the reason, when we cannot evaluate a definite integral with an anti-derivative, we turn to numerical methods such as the trapezoidal rule and Simpson’s rule.
Numerical Integration Methods are Trapezoidal rule and Simpson’s rule. Let us now describe Trapezoidal numerical integration.

Trapezoidal Numerical Integration: When we cannot find a workable anti-derivative for a function f that we have to integrate, we partition the interval of integration, replace f by a closely fitting polynomial on each sub interval  integrate the polynomials and add the result to approximate the integral of f. The higher the degrees of the polynomials for a given partition, the better the results are.  For a given degree, the finer the partition, the better the results, until we reach the limits imposed by round-off and truncation errors.

The polynomials do not need to be of high degree to be effective. Even line segments (graphs of polynomials of degree 1) give good approximations if we use enough of them  .To see why, suppose we partition the domain [a, b] of f into n subintervals of length delta x = h = (b – a)/n and join the corresponding points on the curve with line segments.

The vertical lines from the ends of the segments to the partition points create a collection of trapezoids that approximate the region between the curve and the x-axis. We add the areas of the trapezoids, counting area above the x-axis as positive and area below the axis as negative.
T = ½ (y0 + y1) h + ½ (y1 + y2)h + ….. + ½ (yn-2 + yn-1) h + ½ (yn-1 + yn)h= h (1/2y0 + y1 + y2 + ….. + yn-1 + ½ yn) = h/2 (y0 + 2y1 + 2y2 + …. + 2yn-1 + yn).Where, Y0 = f (a), y1 = f(x1), Yn-1 = f(x n-1), yn = f(b).

The trapezoidal rule says: use T to estimate the integral of f from a to b. Numerical Integration in R As we have seen , the definition of the Riemann integral is not very efficient way to prove that a function is Riemann integral . However once it is known that a function f is Riemann integral on some interval [a, b] a modification of the definition makes it possible to evaluate the integral of simple limit.