 # Simpson’s 3/8 Rule for Numerical Integrations

by admin in on April 29, 2019

This code calculates the Numerical Integration of a given equation on a predefined interval using Simpson’s 3/8 Rule. This codes uses variable step size so it gives accurate results.  This method called the second Simpson’s rule and more accurate than 1/3 rule.

### Code Outputs:

• Chart of Integration History
• Chart of Residuals
• Printed values of Final Iteration value, Accuracy and Number of Iterations.

Result is: 0.97609, Accuracy: 9.42e-05, NO Iterations: 19  ### Input Requirements:

• The equation you intended to integrate
• Integration interval [a b].
• predefined error (default 0.0001).
• Maximum number of iterations (default 50000).

For Simpson’s voting rule, see Minimax Condorcet. For Simpson’s rules used in ship stability, see Simpson’s rules (ship stability). Simpson’s rule can be derived by approximating the integrand (x) (in blue) by the quadratic interpolant P(x) (in red).

### Simpson’s 3/8 Rule:

Simpson’s 3/8 rule is another method for numerical integration proposed by Thomas Simpson. It is based upon a cubic interpolation rather than a quadratic interpolation. Simpson’s 3/8 rule is as follows: where b − a = 3h. The error of this method is: where xi is some number between a and b. Thus, the 3/8 rule is about twice as accurate as the standard method, but it uses one more function value. A composite 3/8 rule also exists, similarly as above.

A further generalization of this concept for interpolation with arbitrary-degree polynomials are the Newton–Cotes formulas.

### Composite Simpson’s 3/8 Rule:

Dividing the interval [a, b] into n subintervals of length h = (b-a)/n and introducing the nodes xi = a + ih we have While the remainder for the rule is shown as: Note, we can only use this if n is a multiple of three. The 3/8th rule is also called Simpson’s second rule.

Share Now!

#### Release Information

• Price
:

\$5.99

• Released
:

April 29, 2019

• Last Updated
:

May 28, 2019