Documentation
Input
Choose Method:
1. Trapezoidal Rule
2. Simpson's 1/3 Rule
3. Simpson's 3/8 Rule
Enter choice: 2
Enter lower limit a and upper limit b: 0 1
Enter number of subintervals n: 4
Output
Integral value by Simpson's 1/3 Rule = 0.7854
Important Exam Notes
-
Trapezoidal Rule → simple, less accurate
-
Simpson’s 1/3 Rule → n must be even
-
Simpson’s 3/8 Rule → n must be multiple of 3
-
Accuracy:
Simpson’s 1/3 > Simpson’s 3/8 > Trapezoidal
Problem Assumption
Let the function be:
f(x)=1 / 1+x2
Evaluate the integral between limits a and b.