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

  • Thread starter jdawg
  • Start date
  • #1
367
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)
 

Answers and Replies

  • #2
SteamKing
Staff Emeritus
Science Advisor
Homework Helper
12,796
1,668

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 (π)?
 

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

  • Last Post
Replies
3
Views
2K
Replies
11
Views
3K
  • Last Post
Replies
5
Views
846
  • Last Post
Replies
5
Views
3K
Replies
2
Views
8K
Replies
0
Views
1K
  • Last Post
Replies
1
Views
4K
Replies
4
Views
2K
Replies
1
Views
4K
Replies
1
Views
503
Top