You are on page 1of 9

Numerical

Computing
Group no.2

Umer Hafeez -138


Sohaib Raza -139
Muhammad Yousaf - 162
Umer Chattha -157
Topics
SIMPSONS 1/3 & 3/8 RULES EXAMPLES ON MATLAB
STIRLING’S FORMULA
 LAGRANGE FORMULA APPLICATION
SIMPSON 1/3 RULE
Simpson’s 1/3rd rule is an extension of the trapezoidal rule in which
the integrand is approximated by a second-order polynomial.
Simpson rule can be derived from the various way using Newton’s
divided difference polynomial,  Lagrange polynomial and the
method of coefficients. This rule is known as Simpson’s 1/3 Rule.

Formula :-

∫ab f(x) dx = h/3 [(y0 + yn) + 4(y1 + y3 + y5 + …. + yn-1) + 2(y2 + y4 + y6 + ….. + yn-2)]
MATLAB CODE
SIMPSON RULE 3/8
Another method of numerical integration is called “Simpson’s 3/8
rule”. It is completely based on the cubic interpolation rather than
the quadratic interpolation. he 3/8 rule is known as Simpson’s
second rule of integration. This rule is more accurate than the
standard method, as it uses one more functional value.

Formula :-

∫ab f(x) dx = 3h/8 [(y0 + yn) + 3(y1 + y2 + y4 + y5 + …. + yn-1) + 2(y3 + y6 + y9 + ….. + yn-3)]
MATLAB CODE
STIRLING’S FORMULA
Stirling formula or Stirling approximation is used to finding
the approximate value of factorial of a given number
( n! or ΓΓ (n) for n >> ).  It was named after James Stirling.
Stirling formula is a good approximation formula, it helps in
finding the factorial of larger numbers easily and it leads to
exacts results for small values of any number say 'n'. 
Formula :-
APPLICATIONS
Example 1: What will be the factorial of 11 using Stirling
formula?
Solution:

 Using the formula:


 n! ≈ √2π nn+½ e−n
 11! ≈ √2π 1111+½ * e−11
 = 39615625.05
LAGRANGE FORMULA APPLICATIONS

 This formula is used to find the value of the function even when the arguments are
not equally spaced.
 This formula is used to find the value of independent variable x corresponding to a
given value of a function.
 Lagrange interpolating polynomials give no error estimate.
 Lagrange multipliers are used in multivariable calculus to find maxima and minima
of a function subject to constraints (like "find the highest elevation along the given
path" or "minimize the cost of materials for a box enclosing a given volume").

Lagrange Formula :-

You might also like