Local Truncation Error of the Midpoint Method.

1.2k Views Asked by At

I'm looking at a past paper and have been asked to show that the Midpoint method: $$w_{i+1}=w_{i-1}+2hf(t_{i},w_{i})$$ has a local second order truncation error.

with the expansions: $$W_{i+1}= y + hy' + \frac{h^{2}y''}{2} + O(h^{3})$$ $$W_{i-1}= y - hy' + \frac{h^{2}y''}{2} + O(h^{3})$$ $$f(t_{i},w_{i}) = y'$$

So to find the truncation error i rearrange to the following: $$\frac{w_{i+1}-w_{i-1}}{h}-2hf(t_{i},w_{i})$$

Then by substituting in my taylor expansions i get: $$2y'+ O(h^{2})-2hy'$$

I think i've made an error but i'm not sure where as this says its first not second order, i think the factors should cancel to leave just $O(h^{2})$ but i cannot find my mistake.

Thanks for any help you can give.