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

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

## 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)

SteamKing
Staff Emeritus
Homework Helper

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