You get a bonus - 1 coin for daily activity. Now you have 1 coin

4. Numerical integration

Lecture



Rectangle Formulas
Trapezoid formula
Simpson Formula

Problem Statement: It is required to find the value of a certain integral   4. Numerical integration for some function f ( x ) defined on the segment [ a , b ]. For some functions, the value of the integral can be found exactly. However, in the general case, the value of the integral can only be found approximately using one or another method of numerical integration.

Numerical integration is based on replacing the integral by the sum of the form   4. Numerical integration . Such a replacement follows from the definition of the integral as the limit of the sum   4. Numerical integration . Fixing n, we get the previous amount.

Approximate equality   4. Numerical integration called the quadrature formula   4. Numerical integration - quadrature nodes,   4. Numerical integration - coefficients of the quadrature formula . Difference   4. Numerical integration is called the quadrature error .

We divide the segment [a, b] into n parts, dots   4. Numerical integration . And we will consider a uniform grid, i.e.   4. Numerical integration . Then   4. Numerical integration .

To construct a quadrature formula on the entire segment [a, b], it suffices to construct a quadrature formula on a partial segment   4. Numerical integration .

Rectangle Formulas

Let be   4. Numerical integration i.e. we approximate f (x) with left piecewise linear interpolation. Then we get   4. Numerical integration .

In this way,   4. Numerical integration . This formula is called the left rectangle formula .

Geometric interpretation:

  4. Numerical integration

Given that the integral of some function gives the value of the area, then the area of ​​the curvilinear region is replaced by the sum of the areas of the rectangles.

The formula for the right-hand rectangles is obtained in the same way. Here   4. Numerical integration . As a result, we get:   4. Numerical integration

  4. Numerical integration

We estimate the error formulas. For example, the error formula of the left rectangles.

  4. Numerical integration .

  4. Numerical integration

We use the Taylor formula:

  4. Numerical integration

Then   4. Numerical integration

Let be   4. Numerical integration then   4. Numerical integration ,those. the formula of the left rectangles has the first in h order of accuracy .

Similarly, for the formula of right rectangles.

Formula of average rectangles . Here is the function on the segment   4. Numerical integration is replaced by its value in the middle of the segment, i.e.   4. Numerical integration

Then, we get   4. Numerical integration - This is the formula of medium rectangles.

It is convenient to write it in the form   4. Numerical integration

Let us estimate the error of the formula for average rectangles.

  4. Numerical integration

  4. Numerical integration

We use the Taylor formula:

  4. Numerical integration

  4. Numerical integration

Let be   4. Numerical integration then

  4. Numerical integration i.e. the formula of average rectangles has the second order of h accuracy

In all considered formulas, the area of ​​the curvilinear trapezium was replaced by the area of ​​the rectangles.

Trapezoid formula

In this formula   4. Numerical integration i.e. the area of ​​the curved trapezoid, is replaced by the area of ​​the rectangular trapezoid.

  4. Numerical integration

The trapezoid formula is obtained by replacing the integrand with an interpolation polynomial of the first degree:

  4. Numerical integration .

Really

  4. Numerical integration

Then for the whole segment [a, b] we get:

  4. Numerical integration

  4. Numerical integration It can be shown that the trapezoid formula has the second order of accuracy .

The trapezoid formula can be written as:

  4. Numerical integration

Simpson Formula

When approximating the integral   4. Numerical integration , function f (x) on a segment   4. Numerical integration replace the parabola passing through the points   4. Numerical integration where   4. Numerical integration i.e. use for approximation of the second degree Lagrange polynomial:

  4. Numerical integration

  4. Numerical integration

  4. Numerical integration

Therefore, we obtain the simpson formula

  4. Numerical integration

It can be shown that the Simpson formula has a fourth order of accuracy .

An example . Calculate the integral   4. Numerical integration . We divide the segment [-1,2] into 10 parts, i.e.   4. Numerical integration . We calculate the value of the integral by the formulas of the left, right, middle rectangles, by the trapezoid formula and the Simpson formula. To do this, make the table:

x i

f (x i )

(x i-1 + x i ) / 2

f ((x i-1 + x i ) / 2)

-one

four

-0.85

4.213375

-0.7

4.267

-0.55

4.181125

-0.4

3.976

-0.25

3.671875

-0.1

3.289

0.05

2.847625

0.2

2.368

0.35

1.870375

0.5

1.375

0.65

0.902125

0.8

0.472

0.95

0.104875

1.1

-0.179

1.25

-0.359375

1.4

-0.416

1.55

-0.328625

1.7

-0.077

1.85

0.359125

2

one

S1 =

19.075

S3 =

17.4625

S2 =

16.075

Here   4. Numerical integration

The formula of the left rectangles:

  4. Numerical integration

Formula of the right rectangles:

  4. Numerical integration

Formula of average rectangles:

  4. Numerical integration

Formula trapezoid:

  4. Numerical integration

Simpson's formula:

  4. Numerical integration

Recall that the exact value of the integral is 5.25


Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Numerical methods

Terms: Numerical methods