MATH 417 Chapter 4

From Notes
Jump to navigation Jump to search

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


Section 4.1: Numerical Differentiation

Section 4.3: Numerical Integration

Theorem. [Numerical Quadrature].

abf(x)dx=i=0nαif(xi)approx.+1(n+1)!abf(n+1)(ξ(x))i=0n(xxi)dxerror

Where

  • x0,x1,,xn are points on the interval [a,b]
  • α0,α1,,αn are constants defined by αi=abLi(x)dx
  • ξ(x) is a value in [a,b]

Proof. Let Pn(x)=i=0nf(xi)Li(x) be the Lagrange interpolating polynomial of f(x). Since

f(x)=Pn(x)+f(n+1)(ξ(x))(n+1)!i=0n(xxi)

is true for some ξ(x) in [a,b], it follows that

abf(x)dx=abPn(x)dx + abf(n+1)(ξ(x))(n+1)!i=0n(xxi)dx

By substituting for the definition of Pn(x), we obtain

abf(x)dx=abi=0nf(xi)Li(x)dx + abf(n+1)(ξ(x))(n+1)!i=0n(xxi)dx=i=0nf(xi)abLi(x)dx + abf(n+1)(ξ(x))(n+1)!i=0n(xxi)dx

If we let ai=abLi(x)dx, we arrive at the desired formula:

abf(x)dx=i=0naif(xi) +abf(n+1)(ξ(x))(n+1)!i=0n(xxi)dx

such that i=0naif(xi) is our approximation and abdx is the error.

quod erat demonstrandum


Trapezoidal Rule

The simplest non-trivial case for the interpolating polynomial of f(x) is a line between two sample points.

P1(x)=(xx1)(x0x1)f(x0)+(xx0)(x1x0)f(x1)

For simplicity, the notation h=xkxk1 shall be used to express the (uniform) distance between equidistant points

Theorem. [Trapezoidal Rule]. In the linear interpolating polynomial case, we let a=x0 and b=x1, so our formula is

abf(x)dx=h2(f(x0)+f(x1))approx.+h312f(ξ)error

Proof. We can apply the quadrature formula above using our definitions for P1(x) and h. Observe that f(ξ(x)) can be abstracted to a f(ξ) term by the mean value theorem for some value ξ[a,b] because (xx0)(xx1) does not change signs on [x0,x1].

abf(x)dx=x0x1(xx1)(x0x1)f(x0)+(xx0)(x1x0)f(x1)dx + 12x0x1f(ξ(x))(xx0)(xx1)dx=(xx1)22(x0x1)f(x0)+(xx0)22(x1x0)f(x1)|x0x1 + f(ξ)x0x1(xx0)(xx1)dx=(x1x0)2(f(x0)+f(x1)) + f(ξ)[x33(x1+x0)2x2+x0x1x]x0x1=h2(f(x0)+f(x1))  h312f(ξ)
quod erat demonstrandum


Simpson's Rule

If we use a quadratic interpolating polynomial instead of a linear one, we can derive Simpson's rule. The interpolating parabola defined by three points f(x0), f(x1), and f(x2) is given by

P2(x)=(xx1)(xx2)(x0x1)(x0x2)f(x0)+(xx0)(xx2)(x1x0)(x1x2)f(x1)+(xx0)(xx1)(x2x0)(x2x1)f(x2)

However, integrating this result using the quadrature method described above results in a O(h4) error term. We can do better by using an alternative method involving the 3rd-degree Taylor polynomial expansion of f(x) centered at x1:

f(x)=k=03f(k)(x1)k!(xx1)k+f(4)(ξ(x))4!(xx1)4=f(0)(x1)0!(xx1)0+f(1)(x1)1!(xx1)1+f(2)(x1)2!(xx1)2+f(3)(x1)3!(xx1)3+f(4)(ξ(x))4!(xx1)4=f(x1)+f(x1)1!(xx1)+f(x1)2!(xx1)2+f(x1)3!(xx1)3+f(4)(ξ(x))4!(xx1)4

Theorem. [Simpson's Rule]. In the quadratic interpolating polynomial case, let a=x0 and b=x2 with x1 in between. If the points are equidistant at a distance h, then the following notation may be used. Otherwise, the integral must be calculated in terms of x0, x1, and x2.

abf(x)dx=h3(f(x0)+4f(x1)+f(x2))approx.+h590f(4)(ξ)error

Proof. Plugging in our definitions above yields

x0x2dx=x0x2f(x1)+f(x1)1!(xx1)+f(x1)2!(xx1)2+f(x1)3!(xx1)3dx + x0x2f(4)(ξ(x))4!(xx1)4dx=[f(x1)(xx1)+f(x1)2(xx1)2+f(x1)6(xx1)3+f(x1)4!(xx1)4]x0x2+124x0x2f(4)(ξ(x))(xx1)4dx

Like in the proof for the trapezoidal rule, we can apply the mean value theorem to replace the f(4)(ξ(x)) factor in the integrand with the constant f(4)(ξ1)

x0x2dx=[f(x1)(xx1)+f(x1)2(xx1)2+f(x1)6(xx1)3+f(x1)4!(xx1)4]x0x2+f(4)(ξ1)24x0x2(xx1)4dx=2hf(x1)+h33f(x1)+f(4)(ξ1)60h5

Replacing f(x1) with its approximation from Section 4.1 gives

x0x2=2hf(x1)+h33{1h2(f(x0)2f(x1)+f(x2))h212f(4)(ξ2)}+f(4)(ξ1)60h5=h3(f(x0)+4f(x1)+f(x2))h512(13f(4)(ξ2)15f(4)(ξ1))

The values ξ1 and ξ2 can be replaced by a common value ξ(x0,x2), giving the desired formula:

abf(x)dx=h3(f(x0)+4f(x1)+f(x2))  h590f(4)(ξ)
quod erat demonstrandum


Degree of Accuracy

The degree of accuracy [in class, DAC], or precision, of a quadrature formula is the largest positive integer

n

such that the formula is exact for

xk

, for each

k=0,1,,n

. Burden 197 [1]

I can't believe the book just gave this definition: it treats accuracy and precision as interchangeable terms. However, accuracy and precision are most certainly two distinct, separate topics.

The degree of accuracy may be found by finding the largest degree polynomial such that the error term is identically 0.

The error term of the trapezoidal rule has a second-derivative term, so polynomials of degree 1 are identically zero (e.g. ddx(x)=0), but polynomials of degree 2 are constant (e.g. ddx(x2)=2). Hence the trapezoidal rule has degree of accuracy 1.

Similarly, the error term of Simpson's rule has a fourth-derivative term, so for polynomials of degree 3, d4dx4(x3)=0, but d4dx4(x4)=24. Therefore Simpson's rule has degree of accuracy 3.

Footnotes

  1. Burden, Richard L. and J. Douglas Faires. Numerical Analysis. 9th ed. Boston: Brooks/Cole, Cengage Learning, 2011. 197. Print.