MHB Is My Calculation Correct for Mid-Ordinate and Simpson's Rule?

  • Thread starter Thread starter peterianstaker
  • Start date Start date
peterianstaker
Messages
2
Reaction score
0
Can someone check my working to see if this is correct for both questions?

Estimate: ∫(2,0) 1/1+x^2 dx
i) Using the Mid-Ordinate rule with 4 strips
ii) Using Simpson's rule with 4 strips

i) h=b-a/n

= 2-0/4 = 0.5

x 0 0.5 1 1.5 2
y 1 0.8 0.5 0.308 0.2

=h(y1+y2+y3+...yn)
=0.5(0.8+0.5+0.308+0.2)
= 0.904 (3.d.p)

ii) = h/3(y0+4y1+2y2+4y3+y4)
= 0.5/3(1+4x0.8+2x0.5+4x0.3+4x0.308+0.2)
= 1.105 (3.d.p)

Any comments welcome!
 
Physics news on Phys.org
We are given:

$$f(x)=\frac{1}{x^2+1}$$

$$a=0,\,b=2,\,n=4$$

a) Midpoint Rule

$$M_4=\frac{1}{2}\left(\frac{1}{\frac{1}{16}+1}+\frac{1}{\frac{9}{16}+1}+\frac{1}{\frac{25}{16}+1}+\frac{1}{\frac{49}{16}+1}\right)=\frac{251168}{226525}\approx1.10878710959055$$

b) Simpson's Rule

$$S_4=\frac{1}{6}\left(\frac{1}{0+1}+4\frac{1}{\frac{1}{4}+1}+2\frac{1}{1+1}+4\frac{1}{\frac{9}{4}+1}+\frac{1}{4+1}\right)=\frac{431}{390}=1.1\overline{051282}$$

For comparison, the exact value of the given definite integral is:

$$I=\arctan(2)\approx1.10714871779409$$
 
Back
Top