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

  • Thread starter Thread starter jdawg
  • Start date Start date
Click For Summary
SUMMARY

The discussion centers on the integration of the function ∫ sin^3(x) dx from 1 to 6 using both Simpson's 1/3 Rule and Simpson's 3/8 Rule in MATLAB. The user implemented the functions simpson13 and simpson38 to estimate the integral, splitting the bounds at x = 3. It was clarified that while x = 3 serves as an approximation for the split, understanding the cardinal values of the sine function is crucial for determining accurate bounds.

PREREQUISITES
  • Understanding of numerical integration techniques, specifically Simpson's 1/3 and 3/8 Rules.
  • Familiarity with MATLAB programming and function creation.
  • Knowledge of trigonometric functions, particularly the sine function.
  • Basic calculus concepts, including definite integrals.
NEXT STEPS
  • Explore the derivation and application of Simpson's 1/3 Rule and Simpson's 3/8 Rule in MATLAB.
  • Learn about the cardinal values of the sine function and their significance in integration.
  • Investigate alternative numerical integration methods, such as the trapezoidal rule and Gaussian quadrature.
  • Practice implementing MATLAB functions for various types of integrals beyond trigonometric functions.
USEFUL FOR

Students and professionals in mathematics, engineering, and computer science who are working with numerical integration in MATLAB, particularly those focusing on trigonometric integrals.

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

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
18K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 11 ·
Replies
11
Views
4K