Answer:
midpoint rule = 5.93295663
simpson's rule = 5.869246855
Step-by-step explanation:
a) midpoint rule
≈ Δ x (f(x₀+x₁)/2 + f(x₁+x₂)/2 + f(x₂+x₃)/2 +...+ f(x_₂+x_₁)/2 +f(x_₁+x)/2)
Δx = (b − a) / n
We have that a = 0, b = π, n = 8
Therefore
Δx = (π − 0) / 8 = π/8
Divide the interval [0,π] into n=8 sub-intervals of length Δx = π/8 with the following endpoints:
a=0, π/8, π/4, 3π/8, π/2, 5π/8, 3π/4, 7π/8, π = b
Now, we just evaluate the function at these endpoints:
0.00752134
= 0.19277080
= 0.80139415
= 1.85280536
= 3.062800704
= 3.878747709
= 3.61980731
= 1.69230261
Finally, just sum up the above values and multiply by Δx = π/8:
π/8 (0.00752134 +0.19277080+ 0.80139415 + 1.85280536 + 3.062800704 + 3.878747709 + 3.61980731 + 1.69230261) = 5.93295663
b) simpson's rule
≈ (Δx)/3 (f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + 2f(x₄) + ... + 2f() + 4f() + f())
where Δx = (b−a) / n
We have that a = 0, b = π, n = 8
Therefore
Δx = (π−0) / 8 = π/8
Divide the interval [0,π] into n = 8 sub-intervals of length Δx = π/8, with the following endpoints:
a = 0, π/8, π/4, 3π/8, π/2, 5π/8, 3π/4, 7π/8 ,π = b
Now, we just evaluate the function at these endpoints:
f(x₀) = f(a) = f(0) = 0 = 0
= 0.23605838
= 0.87235802
= 5.12905809
= 4.93480220
= 14.24738359
= 7.85122222
= 11.56686065
f(x₈) = f(b) = f(π) = 0 = 0
Finally, just sum up the above values and multiply by Δx/3 = π/24:
π/24 (0 + 0.23605838 + 0.87235802 + 5.12905809 + 4.93480220 + 14.24738359 + 7.85122222 + 11.56686065 = 5.869246855