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