Simpson 1/3 rule is a numerical integration technique which give the better result than trapezoidal rule. It is applicable when the number of interval n is even. The Simpson 1/3 rule reduce the error than trapezoidal rule. The large number of interval give the best result and reduce error compare than small number of interval. This rule is also based on computing the area of trapezium. At here, we write the code of **Simpson 1/3 Rule in MATLAB** step by step. MATLAB is easy way to solve complicated problems that are not solve by hand or impossible to solve at page. MATLAB is develop for mathematics, therefore MATLAB is the abbreviation of **MAT**rix **LAB**oratory.

In this program, we evaluate the integral

\int_{a}^{b}\frac{1}{1+x^2}dxThe formula of composite Simpson 1/3 rule is

where a=x_{0} and b=x_{n}

```
% Numerical Method Simpson 1/3 Rule using MATLAB
clear all;
close all;
clc;
f=inline('1/(1+x^2)');
a=input('Enter lower limit of integral=');
b=input('Enter upper limit of integral=');
n=input('Enter number of intervals (multiple of 2)=');
h=(b-a)/n;
sum1=0.0;
sum2=0.0;
for i=1:2:n-1
x=a+i*h;
sum1=sum1+f(x);
end
for i=2:2:n-2
x=a+i*h;
sum2=sum2+f(x);
end
simp=h*(f(a)+4*sum1+2*sum2+f(b))/3;
fprintf('Integrated value is %f',simp)
```

## Other Numerical Methods with MATLAB Coding

- Bisection Method with MATLAB
- Newton Raphson Method with MATLAB
- Secant Method with MATLAB
- Regula Falsi Method with MATLAB
- Fixed Point Iteration with MATLAB
- Trapezoidal Rule with MATLAB
- Simpson 1/3 Rule with MATLAB
- Simpson 3/8 Rule with MATLAB
- Bool’s Rule with MATLAB
- Weddle’s Rule with MATLAB
- Euler Method with MATLAB
- Modified Euler Method with MATLAB
- Midpoint Method with MATLAB
- Runge-Kutta Method with MATLAB
- Millen’s Method with MATLAB
- Adams Bashforth Moulton Method with MATLAB
- Newton Forward Difference Interpolation with MATLAB
- Newton Backward Difference Interpolation with MATLAB
- Lagrange Interpolation with MATLAB
- Newton Divided Difference Interpolation with MATLAB
- Hermite Interpolation with MATLAB
- Natural Cubic Spline Interpolation with MATLAB
- Gauss Jacobi Method with MATLAB
- Gauss Seidal Method with MATLAB
- Power Method with MATLAB