Results 1 to 11 of 11

Math Help - Using Simpson's Rule For sin x / x

  1. #1
    Newbie
    Joined
    Sep 2009
    Posts
    8

    Using Simpson's Rule For sin x / x

    Use Simpson's Rule with N=8 to estimate

    π/2
    ∫ sin x / x dx
    0

    where we take the value of (sin x) / x at x=0 to be 1.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by johnley View Post
    Use Simpson's Rule with N=8 to estimate

    π/2
    ∫ sin x / x dx
    0

    where we take the value of (sin x) / x at x=0 to be 1.
    See the PlanetMath article, the method is quite simple, if you have problems with that tell us what they are and we will help you with those specific problems.

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Sep 2009
    Posts
    8
    The thing I am having trouble with are the different conditions. The limits are from 0 to pi/2, but then what does it mean by saying "x=0 to be 1"?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Sep 2009
    Posts
    8
    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?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by johnley View Post
    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?
    Check that your calculator is in radian mode.

    CB
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Sep 2009
    Posts
    8
    Sure, delta x is (pi/2)/8 * (1/3) = pi/48.

    If I'm doing it wrong, please correct me as that very well could be where I went wrong.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by johnley View Post
    Sure, delta x is (pi/2)/8 * (1/3) = pi/48.

    If I'm doing it wrong, please correct me as that very well could be where I went wrong.
    When I evaluate the expression in your earler post I get the given answer of 1.37076, so there is something wrong with your arithmetic.

    CB
    Follow Math Help Forum on Facebook and Google+

  8. #8
    MHF Contributor
    Joined
    Oct 2005
    From
    Earth
    Posts
    1,599
    Quote Originally Posted by johnley View Post
    Sure, delta x is (pi/2)/8 * (1/3) = pi/48.

    If I'm doing it wrong, please correct me as that very well could be where I went wrong.
    I made a mistake. You did this part correctly.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Sep 2009
    Posts
    8
    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.
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Newbie
    Joined
    Sep 2009
    Posts
    8
    Anyone?
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by johnley View Post
    Anyone?
    You are giving us nothing new to go on to help identify the reason you are not getting the given answer.

    As I said earlier check you arithmetic, with f(0)=1 the rest of the world gets the given answer.

    Also I will say it again, make sure your calculator is in radian mode.

    Attached is a image of the calculation in Excel

    Using Simpson's Rule For sin x / x-gash.png

    CB
    Last edited by CaptainBlack; September 17th 2009 at 11:32 PM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Simpson's rule, did I do it right?
    Posted in the Calculus Forum
    Replies: 6
    Last Post: June 21st 2010, 04:34 PM
  2. Replies: 0
    Last Post: October 20th 2008, 08:12 PM
  3. simpson's rule
    Posted in the Calculus Forum
    Replies: 2
    Last Post: May 17th 2008, 10:18 AM
  4. Trapezoid Rule/Simpson's Rule
    Posted in the Calculus Forum
    Replies: 1
    Last Post: May 16th 2007, 07:52 PM
  5. Replies: 3
    Last Post: August 31st 2006, 10:08 AM

Search Tags


/mathhelpforum @mathhelpforum