(b) b4 a 4. Integrate the Lagrange interpolation polynomial P1(x)=f0 f1 C0-1 over the interval ro, 1 and establish the trapezoidal rule Figure 7.5 5. Determine the degree of precision of the trapezoidal rule. It will suffice to apply the trapezoidal rule over [0, 1] with the three test functions f()=l, I, and a 6. Determine the degree of precision of Simpson's rule. It will suffice to apply Simpson's rule over 0, 2 with the five test functions f( )=1,, r2, and x. Contrast your result with the degree of precision of Simpson's g rule 7. Determine the degree of precision of Boole's rule. It will suffice to apply Boole's rule over [0, 4] with the seven test functions f(a)=1, x, r2, r3, r4, a s, and z6 8. The intervals in exercises 5, 6, and 7 and Example 2. 4 were selected to simplify the calculation of the quadrature nodes. But, on any closed interval a, b over which the function f is integrable, each of the four quadrature rules(2.4)through(2.7) has the degree of precision determined in Exercises 5, 6, and 7 and Example 2.4, respectively a quadrature formula on the interval [a, b can be obtained from a quadrature formula on the interval c, d by making a change of variables with the linear function b r=9()=a-c where dx b-a dt (a) Verify that a=g(t)is the line passing through the points(c, a)and(d, b) (b) Verify that the trapezoidal rule has the same degree of precision on the interval [a, b as on the interval [0, 1] (c)Verify that Simpson's rule has the same degree of precision on the interval [ a, b as on the interval [ 0, 2 (d) Verify that Simpson s rule has the same degree of precision on the interval a, b on the interval 0, 4 9. Derive Simpson's rule using Lagrange polynomial interpolation. Hint. After chang- ing the variable, integrals similar to those in(2. 16 )are obtained f(a)dr≈-/(t-1)(t-2)(t +f1/(t-0)(t-2)t-3dt h f2(t-0)(t-1)(t-3)t+fs 0)(t-1)(t-2)dt 11t2 h/t4 5t3 2(4 +6t 2(4-3
(a) R b a x 2dx = b 3 3 − a 3 3 (b) R b a x 3dx = b 4 4 − a 4 4 4. Integrate the Lagrange interpolation polynomial P1(x) = f0 x − x1 x0 − x1 + f1 x − x0 x1 − x0 over the interval [x0, x1] and establish the trapezoidal rule. Figure 7.5 5. Determine the degree of precision of the trapezoidal rule. It will suffice to apply the trapezoidal rule over [0, 1] with the three test functions f(x) = 1, x, and x 2 . 6. Determine the degree of precision of Simpson’s rule. It will suffice to apply Simpson’s rule over [0, 2] with the five test functions f(x) = 1, x, x2 , x3 , and x 4 . Contrast your result with the degree of precision of Simpson’s 3 8 rule. 7. Determine the degree of precision of Boole’s rule. It will suffice to apply Boole’s rule over [0, 4] with the seven test functions f(x) = 1, x, x2 , x3 , x4 , x5 , and x 6 . 8. The intervals in exercises 5, 6, and 7 and Example 2.4 were selected to simplify the calculation of the quadrature nodes. But, on any closed interval [a, b] over which the function f is integrable, each of the four quadrature rules (2.4) through (2.7) has the degree of precision determined in Exercises 5, 6, and 7 and Example 2.4, respectively. A quadrature formula on the interval [a, b] can be obtained from a quadrature formula on the interval [c, d] by making a change of variables with the linear function x = g(t) = b − a d − c t + ad − bc d − c . where dx = b−a d−c dt. (a) Verify that x = g(t) is the line passing through the points (c, a) and (d, b). (b) Verify that the trapezoidal rule has the same degree of precision on the interval [a, b] as on the interval [0, 1]. (c) Verify that Simpson’s rule has the same degree of precision on the interval [a, b] as on the interval [0, 2]. (d) Verify that Simpson’s rule has the same degree of precision on the interval [a, b] as on the interval [0, 4]. 9. Derive Simpson’s rule using Lagrange polynomial interpolation. Hint. After changing the variable, integrals similar to those in (2.16) are obtained: Z x3 x0 f(x)dx ≈ −f0 h 6 Z 3 0 (t − 1)(t − 2)(t − 3)dt + f1 h 2 Z 3 0 (t − 0)(t − 2)(t − 3)dt −f2 h 2 Z 3 0 (t − 0)(t − 1)(t − 3)dt + f3 h 6 Z 3 0 (t − 0)(t − 1)(t − 2)dt = f0 h 2 Ã t 4 4 + 2t 3 − 11t 2 2 + 6t ! ¯ ¯ ¯ t=3 t=0 + f1 h 2 Ã t 4 4 − 5t 3 3 + 3t 2 ! ¯ ¯ ¯ t=3 t=0 14
h2/-t44 32)=+6(4-+2 h/t4 t=3 10. Derive the closed Newton-Cotes quadrature formula, based on a Lagrange approx imating polynomial of degree 5, using the 6 equally spaced nodes Tk=To+kh, where k=0.1.....5 11. In the proof of Theorem 2. 1. Simpson's rule was derived by integrating the second- degree Lagrange polynomial based on the three equally spaced nodes To, 1, and 2 Derive Simpsons rule by integrating the second-degree Newton polynomial based on the three equally spaced nodes o, c1, and T2 4.2 Composite Trapezoidal and sinpson's rule An intuitive method of finding the area under the curve y=f(a)over a, b is by approx- imating that area with a series of trapezoids that lie above the intervals ck, 5k+ill Theorem 2.2(Composite Trapezoidal Rule). Suppose that the interval [a, bl is subdivided into M subintervals rk, ak+ll of width h=(b-a)/M by using the qually spaced nodes k=a+kh, for k=0, 1,...,M. The composite trapezoidal rule for M subintervals can be expressed in any of three equivalent way T(,h) h +fl (4.19) k=1 T(,h)=(+2/1+2/2+2+…+2fM-2+2/M-1+fM) h T(, h)=o((a)+f(b))+h2f(ak) This is an approximation to the integral of f(a) over [a, bl, and we write f(x)dr≈T(f,h) (4.22) Proof. Apply the trapezoidal rule over each subinterval [ck-1, Tk(see Figure 2.6). Use the additive property of the integral for subintervals h f(a)dx=∑/f(x)d≈∑(x-x)+f(x) Since h/2 is a constant, the distributive law of addition can be applied to obtain(2.19) Formula(2.20)is the expanded version of(2.19 ). Formula(2. 21) shows how to group all the intermediate terms in(2. 20) that are multiplied by 2
+f2 h 2 Ã −t 4 4 + 4t 3 3 − 3t 2 2 ! ¯ ¯ ¯ t=3 t=0 + f3 h 6 Ã t 4 4 − t 3 + t 2 ! ¯ ¯ ¯ t=3 t=0 10. Derive the closed Newton-Cotes quadrature formula, based on a Lagrange approximating polynomial of degree 5, using the 6 equally spaced nodes xk = x0 + kh, where k = 0, 1, . . . , 5. 11. In the proof of Theorem 2.1. Simpson’s rule was derived by integrating the seconddegree Lagrange polynomial based on the three equally spaced nodes x0, x1, and x2. Derive Simpson’s rule by integrating the second-degree Newton polynomial based on the three equally spaced nodes x0, x1, and x2. 4.2 Composite Trapezoidal and Sinpson’s Rule An intuitive method of finding the area under the curve y = f(x) over [a, b] is by approximating that area with a series of trapezoids that lie above the intervals {[xk, xk+1]}. Theorem 2.2 (Composite Trapezoidal Rule). Suppose that the interval [a, b] is subdivided into M subintervals [xk, xk+1] of width h = (b − a)/M by using the equally spaced nodes xk = a + kh, for k = 0, 1, . . . , M. The composite trapezoidal rule for M subintervals can be expressed in any of three equivalent ways: T(f, h) = h 2 X M k=1 (f(xk−1) + f(xk)) (4.19) or T(f, h) = h 2 (f0 + 2f1 + 2f2 + 2f3 + · · · + 2fM−2 + 2fM−1 + fM) (4.20) or T(f, h) = h 2 (f(a) + f(b)) + h M X−1 k=1 f(xk). (4.21) This is an approximation to the integral of f(x) over [a, b], and we write Z b a f(x)dx ≈ T(f, h). (4.22) Proof. Apply the trapezoidal rule over each subinterval [xk−1, xk] (see Figure 2.6). Use the additive property of the integral for subintervals: Z b a f(x)dx = X M k=1 Z xk xk−1 f(x)dx ≈ X M k=1 h 2 (f(xk−1) + f(xk)). (4.23) Since h/2 is a constant, the distributive law of addition can be applied to obtain (2.19). Formula (2.20) is the expanded version of (2.19). Formula (2.21) shows how to group all the intermediate terms in (2.20) that are multiplied by 2. 15
Approximating f(a)=2+sin(2va) with piecewise linear polynomials results in places where the approximating is close and places where it is not. To achieve accuracy the composite trapezoidal rule must be applied with many subintervals. In the next example we have chosen to numerically integrate this function over the interval [1, 6 Investigation of the integral over 0, 1] is left as an exercise Example2. 5. Consider f(a)=2+ sin(2v r). Use the composite trapezoidal rule with 11 sample points to compute an approximation to the integral of f(ar)taken over 1,6 To generate 11 sample points, we use M=10 and h=(6-1)/10=1/2. Using formula(2. 21), the computation is 1、1/2 T(,2)=2((1)+f(6) +3(f()+f(2)+f(。)+f(3)+f()+f(4)+f()+f(5)+f( (290929743+1.01735756 +2(263815764+2.30807174+1.97931647+168305284+143530410 +1.24319750+1.10831775+1.02872220+1.00024140) 4(3926699+(142435165 0.98166375+7.21219083=8.19385457 Theorem 2.3(Composite Simpson Rule). Suppose that [a, b is subdivided into 2M subintervals k, k+ll of equal width h=(b-a)/(2M) by using ak=a+kh for k=0, 1, .. 2M. The composite Simpson rule for 2M subintervals can be expressed in any of three equivalent ways s(, h) h (f(x2k-2)+4f(x2k-1)+f(x2k) (4.24) h S(f,b)=a(+41+2/+4+…+212M-2+4/M-1+f2M)(4.25) S(,b)=(f(a)+f(b)+x2∑f(x2) 3 k=1 This is an approximation to the integral of f(r)over a, b, and we write f(x)dr≈S(f,h)
Approximating f(x) = 2 + sin(2√ x) with piecewise linear polynomials results in places where the approximating is close and places where it is not. To achieve accuracy the composite trapezoidal rule must be applied with many subintervals. In the next example we have chosen to numerically integrate this function over the interval [1, 6]. Investigation of the integral over [0, 1] is left as an exercise. Example2.5. Consider f(x) = 2 + sin(2√ x). Use the composite trapezoidal rule with 11 sample points to compute an approximation to the integral of f(x) taken over [1, 6]. To generate 11 sample points, we use M = 10 and h = (6 − 1)/10 = 1/2. Using formula (2.21), the computation is T(f, 1 2 ) = 1/2 2 (f(1) + f(6)) + 1 2 µ f( 3 2 ) + f(2) + f( 5 2 ) + f(3) + f( 7 2 ) + f(4) + f( 9 2 ) + f(5) + f( 11 2 ) ¶ = 1 4 (2.90929743 + 1.01735756) + 1 2 (2.63815764 + 2.30807174 + 1.97931647 + 1.68305284 + 1.43530410 +1.24319750 + 1.10831775 + 1.02872220 + 1.00024140) = 1 4 (3.92665499) + 1 2 (14.42438165) = 0.98166375 + 7.21219083 = 8.19385457. Theorem 2.3 (Composite Simpson Rule). Suppose that [a, b] is subdivided into 2M subintervals [xk, xk+1] of equal width h = (b − a)/(2M) by using xk = a + kh for k = 0, 1, . . . , 2M. The composite Simpson rule for 2M subintervals can be expressed in any of three equivalent ways: S(f, h) = h 3 X M k=1 (f(x2k−2) + 4f(x2k−1) + f(x2k)) (4.24) or S(f, h) = h 3 (f0 + 4f1 + 2f2 + 4f3 + · · · + 2f2M−2 + 4f2M−1 + f2M) (4.25) or S(f, h) = h 3 (f(a) + f(b)) + 2h 3 M X−1 k=1 f(x2k) + 4h 3 X M k=1 f(x2k−1). (4.26) This is an approximation to the integral of f(x) over [a, b], and we write Z b a f(x)dx ≈ S(f, h). (4.27) 16
Proof. Apply Simpson's rule over each subinterval [ z2k-2, 12k(see Figure 2.7). Use the additive property of the integral for subintervals a r= f(a)d (4.28) h ∑(f(x2-2)+4f(x2k-1)+f(x2) Since h/3 is a constant, the distributive law of addition can be applied to obtain (2. 24). Formula(2. 25)is the expanded version of(2. 24). Formula(2. 26 ) groups all the intermediate terms in(2. 25) that are multiplied by 2 and those that are multiplied by Approximating f(a)=2+sin (2v) with piecewise quadratic polynomials produces places where the approximation is close and places where it is not. To achieve accu- racy the composite Simpson rule must be applied with several subintervals. In the next example we have chosen to numerically integrate this function over [1, 6] and leave investigation of the integral over [ 0, 1] as an exercise Example 2.6. Consider f(a)=2+sin(2vx). Use the composite Simpson rule with 11 sample points to compute an approximation to the integral of f(a)taken over 1,6] To generate 1l sample points, we must use M=5 and h=(6-1)/10= 1/ 2. Using formula(2. 26), the computation is S(f,)=(f(1)+f(6)+(f(2)+f(3)+f(4)+f(5)) 3(2+/2)+f(5)+171 (290929743+1.01735756) +:(230807174+1.68305284+1.24319750+1.02872220 (2.63815764+1.97931647+143530410+1.10831775+1.00024140) c(3.92665499+2(6.26304429)+元(8.16133735 0.65444250+2.08768143+5.44089157=8.18301550
Proof. Apply Simpson’s rule over each subinterval [x2k−2, x2k] (see Figure 2.7). Use the additive property of the integral for subintervals: Z b a f(x)dx = X M k=1 Z x2k x2k−2 f(x)dx (4.28) ≈ X M k=1 h 3 (f(x2k−2) + 4f(x2k−1) + f(x2k)). Since h/3 is a constant, the distributive law of addition can be applied to obtain (2.24). Formula (2.25) is the expanded version of (2.24). Formula (2.26) groups all the intermediate terms in (2.25) that are multiplied by 2 and those that are multiplied by 4. Approximating f(x) = 2+sin(2√ x) with piecewise quadratic polynomials produces places where the approximation is close and places where it is not. To achieve accuracy the composite Simpson rule must be applied with several subintervals .In the next example we have chosen to numerically integrate this function over [1, 6] and leave investigation of the integral over [0, 1] as an exercise. Example 2.6. Consider f(x) = 2 + sin(2√ x). Use the composite Simpson rule with 11 sample points to compute an approximation to the integral of f(x) taken over [1, 6]. To generate 11 sample points, we must use M = 5 and h = (6−1)/10 = 1/2. Using formula (2.26), the computation is S(f, 1 2 ) = 1 6 (f(1) + f(6)) + 1 3 (f(2) + f(3) + f(4) + f(5)) + 2 3 µ f( 3 2 ) + f( 5 2 ) + f( 7 2 ) + f( 9 2 ) + f( 11 2 ) ¶ = 1 6 (2.90929743 + 1.01735756) + 1 3 (2.30807174 + 1.68305284 + 1.24319750 + 1.02872220) + 2 3 (2.63815764 + 1.97931647 + 1.43530410 + 1.10831775 + 1.00024140) = 1 6 (3.92665499) + 1 3 (6.26304429) + 2 3 (8.16133735) = 0.65444250 + 2.08768143 + 5.44089157 = 8.18301550. 17