I need help using simpsons rule

kggirl

New member
Joined
Oct 5, 2005
Messages
43
evaluate the integral from 0 to 1 xsin[x] dx where n = 4 steps.

I don't know where to begin with this one.
 
Hello, kggirl!

Simpson's Rule
Evaluate: \(\displaystyle \L\int^{\;\;\;\;1}_0 x\cdot\sin(x)\,dx\;\) where n=4\displaystyle \,n = 4\, steps.

I don't know where to begin with this one. . . . . really?
Do you know the formula for Simpson's Rule?

A    h3(y0+4y1+2y2+4y3++2yn2+4yn1+yn)\displaystyle A\;\approx\;\frac{h}{3}\left(y_0\,+\,4y_1\,+\,2y_2\,+\,4y_3\,+\,\cdots\,+\,2y_{n-2}\,+\,4y_{n-1}\,+\,y_n\right)

where h\displaystyle h is the width of the intervals, and yi\displaystyle y_i are the "heights" of the function at each xi\displaystyle x_i.


With 4 steps, we have:   x0=0.00x1=0.25x2=0.50x3=0.75x4=1.00        y0=0.00sin(0.00)=0.0000y1=0.25sin(0.25)0.0619y2=0.50sin(0.50)0.2397y3=0/75sin(0.75)0.5112y4=1.00sin(1.00)0.8415\displaystyle \;\begin{array}{ccccc}x_0\,=\,0.00\\x_1\,=\,0.25 \\x_2\,=\,0.50\\x_3\,=\,0.75\\x_4\,=\,1.00\end{array}\;\;\Rightarrow\;\;\begin{array}{cccc}y_0\,=\,0.00\cdot\sin(0.00)\,= 0.0000\\ y_1\,=\,0.25\cdot\sin(0.25)\,\approx\,0.0619 \\ y_2\,=\,0.50\cdot\sin(0.50)\,\approx\,0.2397\\ y_3\,=\,0/75\cdot\sin(0.75)\,\approx\,0.5112 \\ y_4\,=\,1.00\cdot\sin(1.00)\,\approx\,0.8415\end{array}

. . and we have:   h=0.25\displaystyle \;h\,=\,0.25


Hence:   A    0.253[0+4(0.0619)+2(0.2397)+4(0.5122)+0.8415]  =  0.301108333\displaystyle \;A\;\approx\;\frac{0.25}{3}[0\,+\,4(0.0619)\,+\,2(0.2397)\,+\,4(0.5122)\,+\,0.8415]\;=\;0.301108333

Therefore: \(\displaystyle \L\;A\;\approx\;0.3011\)

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

The actual area is: \(\displaystyle \L\int^{\;\;\;\;1}_0 x\cdot\sin(x)\,dx\;=\;0.301168679\)

. . Our approximation is very good!
 
Thank you, i was trying to solve using h = 1/4 so my answers are different than yours. Thanks again.
 
Top