2
$\begingroup$

I have to use Simpson's rule:

$$\int_a^b f(x) \, dx \approx S_n = \frac{1}{3}h[f(a)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+\cdots+4f(x_{n-1})+f(b)]$$

when $n=6$ to approximate the integral:

$$\int_0^3{\sqrt{9-x^2}dx}$$

to four decimal places.

I've gotten $$f(0) = 3$$ $$ 4f\left(\frac{1}{2}\right)=11.831$$ $$2f(1)=5.6569$$ $$4f\left(\frac{3}{2}\right)=10.3923$$ $$2f(2)=4.4721$$ $$4f\left(\frac{5}{2}\right)=6.6332$$ $$f(3)=0$$ and then.. $$\int_0^3{\sqrt{9-x^2} \, dx}\approx S_6 = \left (\frac{1}{3}\right )\left(\frac{1}{2}\right )\left (41.9857\right ) = 6.9976 $$

Did I do this right and is this the correct answer?

  • 0
    compare it with $ {\pi 3^2 \over 4}$ ... I think you need more smaller [step sizes](http://www.wolframalpha.com/input/?i=pi+3^2%2F4)2012-07-30
  • 0
    Yes, that looks correct (I did not check your arithmetic). Note though, to nitpick, you should write e.g., $4f(3/2)\approx 10.3923$.2012-07-30
  • 0
    experiment, what do you mean exactly?2012-07-30
  • 0
    and could you check the arithmetic please? :P. This particular question is an extra credit point for my exam and I want to make sure I get it right!2012-07-30
  • 0
    Hmm, you want us to check your arithmetic so you get extra credit?2012-07-30
  • 0
    you need to match four decimal places ... if you make smaller step sizes $(n = 12 \text{ or } 24)$, you will get more accurate results to match up to four decimal places2012-07-30
  • 0
    Yes, I understand what you mean. But unfortunately I have to use n=6 (actually the problem asked to use either 5 or 6, but n can only equal an even number)2012-07-30
  • 1
    The answers (in 32 bit arithmetic, with 5 digits) are $n=6$: $\approx 6.9978$, $n=60$: $\approx 7.0664$, $n=600$: $\approx 7.0685$, $n=6000$: $\approx 7.0686$, and same for $n=60000$. Your computations above are off a little, I believe.2012-07-30
  • 0
    I did not check all your arithmetic. But for example the second entry should be closer to $11.83216$. Use the memory feature of your calculator! Don't round casually. The setup is just fine, the only issues are minor arithmetical ones.2012-07-30
  • 3
    I'm bored and feeling generous: You should have $3.0000, 11.8322, 5.6569, 10.3923, 4.4721, 6.6332, 0.0000$.2012-07-30

1 Answers 1

3

Since $h=\dfrac {b-a}n$ and $a=0, b=3$:

$$\int_a^b{f(x)dx}\approx S_n = \frac{1}{3}h[f(a)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+...+4f(x_{n-1})+f(b)]\\=\frac 16 ( 3+ 11.8321+ 5.6568+10.3923+4.4721+6.6332+0)\\=6.9977$$