MATH 417 Lecture 10

From Notes
Jump to navigation Jump to search

« previous | Thursday, February 13, 2014 | next »


Section 4.3: Numerical Integration

If we have a function f(x) that is impossible (or really hard) to integrate exactly on an interval [a,b], we can estimate the integral based on the values of f at n+1 points x0,x1,,xn.

  1. Choose a partition of the interval [a,b]{Ij}j=1N
  2. Pick ξjIj
  3. Form the riemann sum j=1Nf(ξj)|Ij|.

We usually define partition intervals by a diameter h=maxj|Ij|. The Riemann integral, if it exists, is the limit of the sum as h0.


In practice, we approximate f(x) with a polynomial pn(x), and then integrate the polynomial:

abf(x)dx=abpn(x)dx+abf(n+1)(ξ(x))(n+1)!(xx0)(xxn)dx

Our error is going to be 0 if f is a polynomial of degree n.

We can get an upper bound on this error by approximating xx0ba. Hence

|abf(n+1)(ξ(x))(n+1)!(xx0)(xxn)dx|C(n+1)!|ba|n+1

For equidistant points, this bound can be better estimated by

|abf(n+1)(ξ(x))(n+1)!(xx0)(xxn)dx|C(n+1)!hn


  1. Construct a numerical rule which is exact for degree at most n
  2. Find the degree of accuracy[1] of the rule


Quadrature Rule

Given x0,x1,,xn,

abf(x)dxabpn(x)dx=abj=0nf(xj)i=0;ijnxxixjxidx=j=0nf(xj)abpn,j(x)dx

Thus

abf(x)dxQn(f)=j=0nAjf(xj), where Aj=abpn,j(x)dx=ab(xx0)(xxn)(xjx0)(xjxn)dx


In a simple case where x0=a and x1=b, we get the trapezoid rule.

The degree of accuracy is between n and 2n+1.


To find Ai's, we can set up a linear system instead of integrating the Lagrange polynomials

b0=ab1dx=A01+A11++An1b1=abxdx=A0x0+A1x1++Anxnb2=abx2dx=A0x02+A1x12++Anxn2=bn=abxndx=A0x0n+A1x1n+Anxnn


Change of Variables

Suppose we have a rule for f(x) when x[1,1]. We can scale the rule to fit an arbitrary interval y[a,b] as follows:

1x1

ay(x)b

y(x)=αx+β=ba2x+a+b2

f(x)=g(y(x)), where g is a polynomial of the same degree:

Performing a substitution in the integral 11g(x)dx gives 11g(y(x))y(x)dx

y(x)=ba2

This integral can now be approximated by B0g(y(1))+B1g(y(0))+B2g(y(1)), where

Bj=ba2Aj

f(x)=1+x+x2g(y)=1+y+12+(y+12)2




If abf(x)dx=j=0nAjf(xj) for f(x)=1,x,x2,,x4, then it is also exact for p(x) of degree n.

Take abf(x)dx=abk=0nckxk=k=0nckabxkdx=k=0nckj=0nAjxjk=k=0nj=0nAjckxjk=j=0nAjk=0nckxjk=j=0nAjf(xj)


Footnotes

  1. the degree of accuracy is the largest polynomial degree for which abf(x)dx=Q(f)