0% found this document useful (0 votes)
226 views

Trapezoidal Rule

1. The trapezoidal rule approximates the definite integral of a function f(x) from a to b using trapezoids under the graph of the function. It takes the form of (b - a)[f(a) + f(b)]/2. 2. Simpson's rule also approximates a definite integral, but uses a weighted average of the function values at evenly spaced points between the bounds. It takes the form of (b - a)/3n[f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + ... + 4f(xn-1) + f(xn)]. 3.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
226 views

Trapezoidal Rule

1. The trapezoidal rule approximates the definite integral of a function f(x) from a to b using trapezoids under the graph of the function. It takes the form of (b - a)[f(a) + f(b)]/2. 2. Simpson's rule also approximates a definite integral, but uses a weighted average of the function values at evenly spaced points between the bounds. It takes the form of (b - a)/3n[f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + ... + 4f(xn-1) + f(xn)]. 3.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Trapezoidal Rule

𝑏
𝑓(𝑎) + 𝑓(𝑏)
∫ 𝑓(𝑥)𝑑𝑥 = (𝑏 − 𝑎) [ ]
𝑎 2

1. Use the trapezoidal rule with n = 8 to estimate:


5
∫1 √1 + 𝑥 2 𝑑𝑥
𝑏−𝑎 5−1
Our given values are n=8, a=1, b=5; so we will do = = .5
𝑛 8
Then we will get the values of each y’s:
x 1 1.5 2 2.5 3 3.5 4 4.5 5

√2 √3.25 √5 √7.25 √10 √13.25 √17 √21.25 √26


y=√1 + 𝑥 2 Or Or Or Or Or Or Or Or Or
1.4142 1.8027 2.2361 2.6926 3.1623 3.6401 4.1231 4.6098 5.009
A B C D E F G H I

Therefore:
𝐴 𝐼
.5( +𝐵 + 𝐶 +𝐷 + 𝐸 + 𝐹 + 𝐺 + 𝐻 + )
2 2

= 12.7616

2. Use the trapezoidal rule with n = 5 to approximate:


1
∫0 √1 + 𝑥 2
𝑏−𝑎 1−0
Our given values are n=5, a=0, b=1; so we will do = = .2
𝑛 5
Then we will get the values of each y’s:

X 0 0.2 0.4 0.6 0.8 1


Y=
√1 + 𝑥 2 1 1.0198 1.077 1.6619 1.2806 1.4142
A B C D E F
Therefore
𝐴 𝐹
.2( +𝐵 + 𝐶 +𝐷 + 𝐸 + )
2 2

= 1.1502
3. Use the trapezoidal rule with n = 4 to approximate:
2
∫0 𝑥√𝑥 2 + 1 𝑑𝑥
𝑏−𝑎 2−0
Our given values are n=4, a=0, b=2; so we will do = = .5
2 4

Then we will get the values of each y’s:

X 0 0.5 1 1.5 2
Y=
2 0 1.1180 2.8284 5.4083 4.4721
∫ 𝑥 √𝑥 2 + 𝑥
0

A B C D E

𝑏−𝑎 2−0
Then we do = = .25
2𝑛 2∗4
Therefore

. 25(𝐴 + 𝐵 + 𝐶 + 𝐷 + 𝐸)

= 3.4567

4. Use the trapezoidal rule with n = 6 to approximate:


2
∫1 x 3 dx
𝑏−𝑎 2−1 1
Our given values are n=6, a=1, b=2; so we will do = =
2 6 6

Then we will get the values of each y’s:

X 1 7/6 4/3 3/2 5/3 11/6 2


Y=
2 1 3.1759 4.7407 6.75 9.2593 12.4977 8
∫ 𝑥3
1

A B C D E F G
Therefore
1
6
(𝐴 + 𝐵 + 𝐶 + 𝐷 + 𝐸 + 𝐹 + 𝐺)
2

= 3.77
5. Use the trapezoidal rule with n = 4 to approximate:
3 𝑑𝑥
∫1 1+√𝑥
𝑏−𝑎 3−1
Our given values are n=4, a=1, b=3; so we will do 2
= 4
= .5

Then we will get the values of each y’s:


X 1 3/2 2 5/2 3
Y=
3
𝑑𝑥 0.5 .899 .8284 .7748 .366

1 1 + √𝑥
A B C D E
Therefore
1/2
(𝐴 + 𝐵 + 𝐶 + 𝐷 + 𝐸)
2
= 0.8421

6. Use the trapezoidal rule with n = 4 to approximate:


3
1 𝑥2
∫0 3−𝑥 2 𝑑𝑥

Our given values are n=4, a=0, b=1; so we will do


𝑏−𝑎
𝑛
=
1−0
4
= ¼ or .25
Then we will get the values of each y’s:
X 0 .25 .5 .75 1
Y=
3 0 .4255 .1286 .2665 .5
1
𝑥2
∫ 2
𝑑𝑥
0 3−𝑥
A B C D E
Therefore
1/4
(𝐴 + 𝐵 + 𝐶 + 𝐷 + 𝐸)
2
= 0.1719
7. Use the trapezoidal rule with n = 6 to approximate:
2
∫0 𝑥√2𝑥 2 + 1 𝑑𝑥
𝑏−𝑎 2−0
Our given values are n=6, a=0, b=2; so we will do = = 1/3
𝑛 6

Then we will get the values of each y’s:


X 0 1/3 2/3 1 4/3 5/3 2
Y=
2 0 .7370 1.832 3.4641 5.6917 8.5346 6

∫ 𝑥√2𝑥 2 + 1 𝑑𝑥
0
A B C D E F G
Therefore
1/3
(𝐴 + 𝐵 + 𝐶 + 𝐷 + 𝐸 + 𝐹 + 𝐺)
2
= 4.3766

8. Use the trapezoidal rule with n = 4 to approximate:


1 1
∫0 dx
1+x
𝑏−𝑎 1−0
Our given values are n=4, a=0, b=1; so we will do 𝑛
= 4
= 1/4

Then we will get the values of each y’s:


X 0 1/4 1/2 3/4 2
Y=
1 1 1.6 1.33 1.14 .5
1
∫ dx
0 1+x
A B C D E
Therefore
1/4
(𝐴 + 𝐵 + 𝐶 + 𝐷 + 𝐸)
2
= .697
9. Use the trapezoidal rule with n = 10 to approximate:
20
∫0 cos 𝜋𝑥 𝑑𝑥
𝑏−𝑎 20−0
Our given values are n=10, a=0, b=20; so we will do 𝑛
= 10
=2
Then we will get the values of each y’s:
0 2 4 6 8 10 12 14 16 18 20
1 1 1 1 1 1 1 1 1 1 1
A B C D E F G H I J K

Therefore
2
(𝐴 + 𝐵 + 𝐶 + 𝐷 + 𝐸 + 𝐹 + 𝐺 + 𝐻 + 𝐼 + 𝐽 + 𝐾)
2
= 20

10. Use the trapezoidal rule with n = 8 to approximate:


5
∫1 √1 + 𝑥 2 𝑑𝑥
𝑏−𝑎 5−1
Our given values are n=8, a=1, b=5; so we will do 𝑛
= 8

Therefore
1
2
= (√2 + √3.25 + √5 + √7.25 + √10 + √13.25 + √17 + √21.25 + √26
2

= 12.76
11. For the intervals [1, 2] approximate the integral of the function 𝑓(𝑥) = 𝑧 3 given four
subintervals here.
2
∫1 𝑥 3 𝑑𝑥
𝑏−𝑎 2−1
Our given values are n=4, a=1, b=2; so we will do 𝑛
= 4

1

= 4
(13 + 2(. 125)3 + 2(1.5)3 + 2(1.75)3 + 23 )
2
= 3.797

12. For int (0 to 2) (𝑒 𝑦 )2 𝑑𝑦 approximate for n = 4.


2
∫0 (𝑒 𝑦 )2 𝑑𝑦
𝑏−𝑎 2−0
Our given values are n=4, a=1, b=2; so we will do 𝑛
= 4

1
= 2
((𝑒 0 )2 + 2(𝑒 0.5 )2 + 2(𝑒 1 )2 + 2(𝑒 1.5 )2 + 2(𝑒 2 )2 )
2
= 20.64
Simpson’s Rule

𝑏
𝑏−𝑎
∫ 𝑓(𝑥)𝑑𝑥 = [𝑓(𝑥0 ) + 4𝑓(𝑥1 ) + 2𝑓(𝑥2 ) + 4𝑓(𝑥3 )+. . . +4𝑓(𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )]
𝑎 3𝑛

13. Use the Simpson’s Rule to approximate the value of the definite integral for the given value
of n = 4.

2
∫0 𝑥√𝑥 2 + 1 𝑑𝑥
𝑏−𝑎 2−0
Our given values are n=4, a=0, b=2; so we will do = = 1/6
3𝑛 3∗4
We then plug in the acquired values into Simpson’s Rule:

1
=6 [(0)√02 + 1 + (4 ∗ 5)√. 52 + 1 + (2 ∗ 1)√12 + 1 + (4 ∗ 1.5)√1.52 + 1 + (2)√22 + 1]
= 3.3922

14. Use the Simpson’s Rule to approximate the value of the definite integral for the given value
of n = 4.

1 1
∫0 1+x
dx
𝑏−𝑎 1−0
Our given values are n=4, a=0, b=1; so we will do = = 1/12
3𝑛 3∗4
We then plug in the acquired values into Simpson’s Rule:
1 1 1 3
= [𝑓(0) + 4𝑓 ( ) + 2𝑓 ( ) + 4𝑓 ( ) + 𝑓(1)]
12 4 2 4
1
= [1 + 3.2 + 1.33 + 2.28 + 0.5]
12
= 0.6931
15. Use the Simpson’s Rule to approximate the value of the definite integral for the given value
of n = 4.

3
1 𝑥2
∫0 3−𝑥 2 𝑑𝑥
𝑏−𝑎 1−0
Our given values are n=4, a=0, b=1; so we will do = = 1/12
3𝑛 3∗4
We then plug in the acquired values into Simpson’s Rule:

1
= [𝑓(𝑥0 ) + 4𝑓(𝑥1 ) + 2𝑓(𝑥2 ) + 4𝑓(𝑥3 ) + 𝑓(𝑥4 )]
12
1
= [(0 + 4(0.04255) + 2(0.12856) + 4(0.26646) + 0.5)]
12

= 0.17026

16. Use the Simpson’s Rule to approximate the value of the definite integral for the given value
of n = 6.
2
∫0 𝑥√2𝑥 2 + 1 𝑑𝑥
𝑏−𝑎 2−0
Our given values are n=6, a=0, b=2; so we will do = =1/9
3𝑛 3∗6
We then plug in the acquired values into Simpson’s Rule:

1 1 2 4 5
= [𝑓(0) + 4𝑓 ( ) + 2𝑓 ( ) + 4𝑓(1) + 2𝑓 ( ) + 4𝑓 ( ) + 𝑓(2)]
9 3 3 3 3
1
= [(0 + 1.4740 + 1.8325 + 6.9282 + 5.6916 + 17.069 + 6)]
9

= 4.33285

17. Use the Simpson’s Rule to approximate the value of the definite integral for the given value
of n = 6.
2
∫1 x 3 dx
𝑏−𝑎 2−1
Our given values are n=6, a=1, b=2; so we will do = =1/18
3𝑛 3∗6
We then plug in the acquired values into Simpson’s Rule:

1
= [(1 + 6.35 + 4.74 + 13.5 + 9.26 + 24.65 + 8)]
18

= 4.20
18. Use the Simpson’s Rule to approximate the value of the definite integral for the given value
of n = 4.
3 𝑑𝑥
∫1 1+√𝑥
𝑏−𝑎 3−1
Our given values are n=4, a=1, b=3; so we will do = =1/6
3𝑛 3∗4
We then plug in the acquired values into Simpson’s Rule:

1
= [(0.5) + 4(0.4495) + 2(0.4142) + 4(0.3874) + 0.366)]
6

= .8403

19. Use the Simpson’s Rule to approximate the value of the definite integral for the given value
of n = 4.
6
∫2 ln 𝑥 𝑑𝑥
𝑏−𝑎 6−2
Our given values are n=4, a=6, b=2; so we will do = =1/3
3𝑛 3∗4
We then plug in the acquired values into Simpson’s Rule:

1
= [(0.6931) + 4(1.0986) + 2(1.3862) + 4(1.6094) + 1.7917)]
3

= 5.3632

20. Use the Simpson’s Rule to approximate the value of the definite integral for the given value
of n = 4.
21
∫1 𝑥 𝑑𝑥
𝑏−𝑎 2−1
Our given values are n=4, a=1, b=2; so we will do = =1/12
3𝑛 3∗4
We then plug in the acquired values into Simpson’s Rule:

1
= [𝑓(𝑥0) + 4𝑓(𝑥1) + 2𝑓(𝑥2) + 4𝑓(𝑥3) + 𝑓(𝑥4)]
12
1 16 4 32 1
=
12
(1 + 5
+ +
3 7
+ )
2

= 0.88
21. Use Simpson’s Rule with n=10 to approximate the area of the surface obtained by rotating
the curve about the x-axis.
𝑦 = 𝑥𝑒 𝑥 , 0 ≤ 𝑥 ≤ 1
𝑏−𝑎 1−0
Our given values are n=10, a=0, b=1; so we will do = =0.1
𝑛 10
We then plug in the acquired values into Simpson’s Rule:
0.1
= (𝑓(𝑥0) + 4𝑓(𝑥1) + 2𝑓(𝑥2) + 4𝑓(𝑥3) + 2𝑓(𝑥4) + 4𝑓(𝑥5) +
3
2𝑓(𝑥6) + 4𝑓(𝑥7) + 2𝑓(𝑥8) + 4𝑓(𝑥9) + 𝑓(𝑥10)
0.1
= ( 0 + 4(1.0930) + 2(2.7233) + 4(1.5390) + 2(8.6820) +
3
4(13.8171) + 2(21.1718) + 4(31.5878) + 2(46.1891) + 4(66.4703) +
94.4113)
= 24.1443

22. Use Simpson’s Rule with n = 10 to estimate the arc length of the curve.
𝑦 = ln(1 + 𝑥 3 ) , 0 ≤ 𝑥 ≤ 5

3𝑥 2
First find 𝑦 1 which is 1+𝑥 3

Then setup the arc length formula which is

𝑏 5 9𝑥 4
∫𝑎 √1 + [𝑓 1 (𝑥)]2𝑑𝑥 = ∫0 √(1+𝑥3 )2 𝑑𝑥

𝑏−𝑎 5−0
Our given values are n=10, a=0, b=5; so we will do = =1/2=.5
𝑛 10

.5
= (𝑓(𝑥0) + 4𝑓(𝑥1) + 2𝑓(𝑥2) + 4𝑓(𝑥3) + 2𝑓(𝑥4) + 4𝑓(𝑥5) +
3
2𝑓(𝑥6) + 4𝑓(𝑥7) + 2𝑓(𝑥8) + 4𝑓(𝑥9) + 𝑓(𝑥10)
.5
= ( 0 + 4(1.2019) + 2(1.8028) + 4(1.8386) + 2(1.6667) +
3
4(1.5073) + 2(1.3891) + 4(1.3044) + 2(1.2431) + 4(1.1979) +
1.1637)
= 7.0946
23. Use the Simpson’s Rule to approximate the value of the definite integral for the given value
of n = 4.
3 𝑑𝑥
∫2 𝑥+1
𝑏−𝑎 3−2
Our given values are n=4, a=2, b=3; so we will do = =1/12
3𝑛 3∗4
We then plug in the acquired values into Simpson’s Rule:
1
= (𝑓(𝑥0) + 4𝑓(𝑥1) + 2𝑓(𝑥2) + 4𝑓(𝑥3) + 𝑓(𝑥5)
12
1
= (.333 + 4(. 3077) + 2(. 2857) + 4(. 2667) + .25)
12
= .2877

Composite Trapezoidal Composite

24. Approximate the integral of 𝑓(𝑥) = 𝑥 3 on the interval [1,2] with four subintervals
2−1
First, ℎ = = .25 ,so we calculate for:
4
1
= 2
(𝑓(1) + 2𝑓(1.25) + 𝑓(1.5) + 𝑓(1.75) + 𝑓(2)) ∗ .25
1
= (13 + 2(1.253 + 1.53 + 1.753 ) + 23 ) ∗ .25
2
= 3.7969
(2−1)
If we double the number of intervals, that is eight, we set ℎ = 8
= 0.125 ,so we calculate:
1
= (𝑓(1) + 2(𝑓(1.125) + 𝑓(1.25) + 𝑓(1.375) + 𝑓(1.5) + 𝑓(1.625) + 𝑓(1.75) + 𝑓(1.875)) +
2

𝑓(2)) ∗ 0.125
1
= 2 (13 + 2(1.1253 + 1.253 + 1.3753 + 1.53 + 1.6253 + 1.753 + 1.8753 ) + 23 ) ∗ 0.25
= 3.7617

25. Find the integral of the function of𝑓(𝑥) = 𝑒 −𝑥 sin(𝑥) on the interval [0,3] with N = 10 and
𝐸𝑠𝑡𝑒𝑝 = 0.001. In this case, the initial width is h = 30 and therefore 𝑇0 = 0.010539. The
subsequent iterations are shown:

n 𝑇𝑛 − 1 𝑇𝑛 |𝑇𝑛 − 𝑇𝑛 − 1|
1 0.010539 0.33913 0.33
2 0.33913 0.42756 0.13
3 0.47256 0.50881 0.036
4 0.50881 0.51804 0.0092
5 0.51804 0.52036 0.0023
6 0.52036 0.52094 0.00058

Thus, our approximation to the integral is 0.52094 which has an absolute error of 0.00019 (or
relative error of less than 0.04%) when compared to the correct five digit approximation
0.52113.

You might also like