Romberg's Method and Richardson extrapolation

Hi. I've been having some troubles with a particular integral with Romberg's method plus Richardson's extrapolation.

The integral is: $\displaystyle \int_{0}^{\frac{\pi}{4}}{x^2\ sin(x)\, dx} \approx 0.08875$

And the formulas I have are:

Romberg: $\displaystyle R_{k,1} = \frac{1}{2}\left[R_{k-1,1} + h_{k-1}\left(\sum_{i=1}^{2^{k-2}}f\left(a+\frac{2i-1}{2} \cdot h_{k-1}\right)\right)\right]$

Where:

$\displaystyle a = 0$ and $\displaystyle b = \frac{\pi}{4}$

$\displaystyle R_{1,1} = \frac{b-a}{2} \cdot \left(f(a)+f(b)\right)$

$\displaystyle h_{k} = \frac{b-a}{2^{k-1}}$

And we do it from 0 to 3

Then Richardson to get $\displaystyle R_{2,2}$, $\displaystyle R_{3,2}$ and $\displaystyle R_{3,3}$

$\displaystyle R_{i,j} = \frac{4^{j-1}R_{i,j-1} - R_{i-1,j-1}}{4^{j-1} - 1}$

In the end, I get to $\displaystyle R_{3,3} = 0.0291$ a bit far from the real solution. Could it be an error from the method or something wrong with calculations? I've done it a few times but still I can't find a mistake. I'll keep trying though.

Thanks in advance.

Re: Romberg's Method and Richardson extrapolation

Hi russo! :)

Looks to me like an error in your calculations.

Here's what I get:

Code:

`R(1,1) = 0.17128`

R(2,1) = 0.10881

R(3,1) = 0.09373

R(3,2) = 0.08870

R(2,2) = 0.08799

R(3,3) = 0.08875

Re: Romberg's Method and Richardson extrapolation

Thanks. I could get to those results using the formula shown on wikipedia. So I'm starting to think that I got it wrong here. I'll check on a book later. At least now I have your results as a reference haha.

Thanks again.

Re: Romberg's Method and Richardson extrapolation

Ah well, your formulas are identical to those of wikipedia, except for an offset of 1.

Re: Romberg's Method and Richardson extrapolation

Ok so I'll keep checking where is my mistake. I'm sure it's a simple detail.

EDIT: And it was. I was taking the wrong h (Giggle)