Hi

this is pdf : http://www.cs.umd.edu/~elman/460.10/final/final.pdf

I have question with problem 1

I solved problem 1 but i am not sure if my answers are right.:(

can you check?? plz!!

my answers

for a) i said,

if applying the composite simpson rule on a uniform mesh subdividing [a,b] into intervals of width h/2, two halves of the interval are [a,c] [c,b]

and d,e are midpoints of these two subintervals

d= (a+c)/2 , e= (c+b)/2

apply Simpson's rule to each subinterval, a quadrature rule on [a,b]

S_2 = h/12 ( f(a)+4f(B)+2f(c)+4f(e)+f(b) )

so, S_2 = I(f)- (1/15) (S_2(f)-S(f))

for a) i said,

The two can be combined to get an even more accurate approximation Q

Both rules are of order 4, but step size for S_2 is half the size for S, so the error in S_2 is roughly 2^4=16 times smaller than that of S.

Thus, a new, more accurate rule Q can be obtained by solving

Q-S=16(Q-S_2)

so, S(f)=S_2(f)+ 1/15 ((S_(f)-S(f))

to compute integral[0, pi/2] cos(x) dx,

code:

f=inline('cos(x)')

Q=quad(f,0,pi/2)

and i have no idea what to do with part (c)

can anyone help me?!!!! plz!!!!