Use Simpson's Rule with N=8 to estimate
∫ sin x / x dx
where we take the value of (sin x) / x at x=0 to be 1.
Ok, this is what I did and I'm pretty sure I did it right, but I am getting a different answer from what is in the solution's manual.
pi/48 * (f(0) + 4*f(pi/16) + 2*f(2*pi/16) + 4*f(3*pi/16) + 2*f(4*pi/16) + 4*f(5*pi/16) + 2*f(6*pi/16) + 4*f(7*pi/16) +f(8*pi/16) )
If I do all this, I get 0.026272 which is exactly what the answer would be if you integrated the problem, but the answer is supposed to be 1.37076. What am I doing wrong?
Right. When I just calculated it with my values, I got an answer of 1.305314.
One thing that can be throwing off the answer is calculating the first term - f(0). Sin 0/0 is not possible, so is that where the "x=0 to be 1" condition comes in? (i.e plugging in 1 to the to the function instead of 0?) If that is the case, I get a closer number in 1.36038, but still not quite there.