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

  • Thread starter Thread starter jdawg
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
jdawg
Messages
366
Reaction score
2

Homework Statement


∫ 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?

Homework Equations

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)
 
Physics news on Phys.org
jdawg said:

Homework Statement


∫ 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?
Yeah, it's called knowing the cardinal values of the sine function.

BTW, x = 3 is only an approximation. What is sine (π)?