Numerical Integration: Orthonormal Basis of Polynomials and Trapezoidal Method, Study notes of Calculus

The concept of numerical integration, focusing on the orthonormal basis of polynomials and the trapezoidal method. The construction of an orthonormal basis of polynomials using laplace's equation and the legendre polynomials. It also explains the trapezoidal method for numerical integration, its error, and an example of its application.

Typology: Study notes

2010/2011

Uploaded on 10/09/2011

deville
deville 🇺🇸

4.7

(23)

390 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Introduction to Numerical Integration
Adrian Down
March 16, 2006
1 Orthonormal basis of polynomials
1.1 Review
Recall that we constructed on orthonormal basis on the space of quadratic
functions on [1,1],
a0(x) = 1
2a1(x) = x a2(x) = 3x21
2q2
5
1.2 Laplace’s equation
These polynomials can be continued using a recursion process. Each resulting
polynomial anis of degree n1 and is orthonormal to the other polynomials
in the set,
am·an=Z1
1
amandx =δmn
The recursion relation is given in problem 7. It can also be derived from
the Laplace partial differential equation describing the spherical harmonics
in R3,
11u+22 u+33u= 0
where 11 =2
∂x2and so on for x2=yand x3=z.
1
pf3
pf4
pf5
pf8

Partial preview of the text

Download Numerical Integration: Orthonormal Basis of Polynomials and Trapezoidal Method and more Study notes Calculus in PDF only on Docsity!

Introduction to Numerical Integration

Adrian Down

March 16, 2006

1 Orthonormal basis of polynomials

1.1 Review

Recall that we constructed on orthonormal basis on the space of quadratic functions on [− 1 , 1],

a 0 (x) =

a 1 (x) = x a 2 (x) =

3 x^2 − 1

2

2 5

1.2 Laplace’s equation

These polynomials can be continued using a recursion process. Each resulting polynomial an is of degree n − 1 and is orthonormal to the other polynomials in the set,

am · an =

− 1

amandx = δmn

The recursion relation is given in problem 7. It can also be derived from the Laplace partial differential equation describing the spherical harmonics in R^3 ,

∂ 11 u + ∂ 22 u + ∂ 33 u = 0

where ∂ 11 = ∂ 2 ∂x^2 and so on for^ x^2 =^ y^ and^ x^3 =^ z.

Write the equation in spherical polar coordinates. We seek solutions that are dependent only on r and θ,

u = rnp(x)

where x = cos θ.

Note. The x in our assumed form of the solution of Laplace’s differential equation is not the same as the x coordinate in R^3.

The differential equation for p(x) becomes, { (1 − x^2 )p′

  • n(n + 1)p = 0 ∈ (− 1 , 1) (1)

Note. x = 1 corresponds to cos θ = 1 ⇒ θ = 0, i.e. the north pole of the coordinate system. Likewise x = −1 corresponds to the south pole.

1.3 Orthogonality

The functions that satisfy 1 are the Legendre polynomials. pn defined in this way is an nth degree polynomial which is bounded at x = ±1. These polynomials can be normalized such that

∫ (^1)

− 1

a^2 ndx = 1

We found the first three polynomials above in the previous lecture. We showed these functions are orthogonal. Now we show that all other pm con- structed in this was are orthogonal.

Proof. Consider the differential equation 1 applied to two particular Legendre polynomials pn and pm. Multiply the equation for pm by pn and the equation for pn by pm,

pn

(1 − x^2 )p′ m

  • n(n + 1)pmpn = 0 pm

(1 − x^2 )p′ n

  • n(n + 1)pnpm = 0

Subtract these two equations and integrate from −1 to 1,

∫ (^1)

− 1

1 − x^2

(pnp′ m − p′ npm)

dx = {n(n + 1) − m(m + 1)}

− 1

pmpndx

The trapezoidal approximation of each subinterval is then equal to the area of the trapezoid formed by the x axis and the linear approximation of the function, ∫ (^) xj+

xj

(fj + fj+1)h

The trapezoidal approximation to the integral over the entire interval is a function of the mesh spacing. Writing this dependence explicitly,

T (h) =

h 2

(f 0 + f 1 ) +

h 2

(f 1 + f 2 ) +... +

h 2

(fn− 1 + fn)

=

h 2

  • h {f 1 + f 2 +... + fn− 1 } +

h 2

fn

= h {f 0 + f 1 +... + fn} −

h 2

(f 0 + fn)

Note. We take the negative sign on the error term by convention. This formula sometimes appears slightly differently with the error term defined to be positive.

2.2 Error

The error within each interval is the difference between the approximated value of the integral and the exact value,

j (h) =

h 2

(f (xj ) + f (xj + h)) −

∫ (^) xj +h

xj

f (x)dx

Make a change of variables in the integral,

t = x − xj

With this substitution,

j (h) =

h 2

(f (xj ) + f (xj + h)) −

∫ (^) h

0

f (xj + t)dt

Because h is small, Taylor expand f (xj + h) in powers of h about xj. We have done this calculation previously, where we obtained,

j (h) =

f ′′(xj )h^3 + O(h^4 )

The total error is then,

(h) = T (h) −

∫ (^) b

a

f (x)dx =

∑^ n−^1

j=

j (h)

h^2 12

∑^ n−^1

j=

f ′′(xj )h + O(h^3 )

Note. In our original expression for the error, we had a term of the form O(h^4 ). When this term is summed over n, it becomes O(nh^4 ). Since n = b−ha , O(nh^3 ) reduces to O(h^3 ).

In the limit h → 0, the summation becomes an integral,

lim h→ 0

∑^ n−^1

j=

f ′′(xj )h →

∫ (^) b

a

f ′′(x)dx

The integral of a derivative can be evaluated using the Fundamental Theorem of Calculus,

(h) =

h^2 12

{f ′(b) − f ′(a)} + O(h^3 )

In general, (h) is a power series in h. However, it can be shown using advanced analysis that only even powers of h appear in this expansion.

Theorem (Deep result). Let f (x) be analytic on an open interval [a, b]. Then,

T (h) −

∫ (^) b

a

f (x)dx = c 2 h^2 + c 4 h^4 +... ︸ ︷︷ ︸ even powers only

2.3 Example

Consider a simple integral for which we know the value exactly,

∫ (^1)

0

exdx = e − 1

The final expression for the trapezoidal approximation is,

T (h) =

h 2 tanh

(h 2

)(e − 1)

The error term is,

(h) = T (h) −

0

exdx = T (h) − (e − 1)

h 2 tanh

(h 2

(e − 1)

This expression for (h) can be Taylor expansion in even powers of h, starting with h^2. The Taylor series expansion for (h) in terms of h is in even powers of h, as claimed above.

3 Midterm 2

There will be four problems. One or two will have multiple sections.

  1. The first problem will concern polynomial interpolation and error esti- mation thereof. Be aware that it is sometimes possible to estimate the error of polynomial approximation without writing an explicit expres- sion for the polynomial itself.

f (x) − p(x) =

f (n+1)(ζ) (n + 1)!

∏^ n

j=

(x − xj )

  • If the interval is of length L, we can make a maximum bound on the product as, ∣ ∣ ∣ ∣ ∣

∏^ n

j=

(x − xj )

≤ Ln+

A much better bound can be found by actually maximizing the argument of the product.

  • If the polynomial is a Hermite polynomial that approximates the value of a function and its first derivative, the error formula is changed somewhat,

n + 1 → 2 n + 2 (x − xj ) → (x − xj )^2

  • Constructing a Hermite polynomial approximation of a function on an interval using the cubic basis polynomials requires four num- bers: the values of the function and its first derivative at the end- points of the interval. It is also possible to approximate a function using Taylor series expansion. Taking the Taylor series to the third order requires knowledge of the function and its first three deriva- tives, again four numbers. We can estimate the error of the Taylor series approximation using the Lagrange error formula. Be able to compare the errors associated with the approximation polyno- mials constructed using these two methods.
  1. The second problem will concern natural cubic splines. It will be simple if you use common sense.
  2. The third problem will be to find an orthogonal projection onto a sub- space of Rn. Note that the magnitude of the squared error should decrease as the number of dimensions in the approximating subspace is increased.
  3. The fourth problem will concern orthogonal projections of functions, similar to the last problem on the 6th problem set.