1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Problem with Combining Simpson's 1/3 and 3/8 Rule(Matlab)

  1. Jun 25, 2016 #1
    1. The problem statement, all variables and given/known data
    ∫ sin^3(x) dx evaluated from 1 to 6
    I'm pretty what I have is correct, but I got the answer by guessing that the bounds split at 3.
    Is there a formula to calculate where the bounds break?

    2. Relevant equations


    3. The attempt at a solution
    function I = simpson13(func, a, b, n)
    function I = simpson38(func, a, b, n)
    % input:
    % func= name of function to be integrated
    % a,b = integration limits
    % n = number of segments (default = 100)
    % Output:
    % I = integral estimate

    A = @(x) sin(x)^3
    % simpsons rule n = 5
    % from 1 to 6
    simpson13(A,1,3,2)+simpson38(A,3,6,3)
     
  2. jcsd
  3. Jun 25, 2016 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    Yeah, it's called knowing the cardinal values of the sine function.

    BTW, x = 3 is only an approximation. What is sine (π)?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Problem with Combining Simpson's 1/3 and 3/8 Rule(Matlab)
Loading...