0% found this document useful (0 votes)
20 views12 pages

Evaluate Integral Using Simpson's Rule

The document discusses various techniques for numerical integration, specifically the Trapezoidal Rule and Simpson's Rule. The Trapezoidal Rule approximates the area under a curve using trapezoids, while Simpson's Rule uses parabolic approximations and requires an even number of subintervals. It also outlines the formulas for both methods and compares their accuracy and complexity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views12 pages

Evaluate Integral Using Simpson's Rule

The document discusses various techniques for numerical integration, specifically the Trapezoidal Rule and Simpson's Rule. The Trapezoidal Rule approximates the area under a curve using trapezoids, while Simpson's Rule uses parabolic approximations and requires an even number of subintervals. It also outlines the formulas for both methods and compares their accuracy and complexity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

CSE011

Unit 2
Numerical Integration
Numerical Integration

• There are several techniques for numerical integration


1. Trapezoidal Rule
2. Simpson’s Rule

• Given a set of tabulated values of the integrand f(x),


determining the value of is called numerical integration.
• Trapezoidal Rule is a rule that
evaluates the area under the
curves by dividing the total
area into smaller trapezoids
rather than using rectangles.
• This integration works by
approximating the region under
the graph of a function as a
trapezoid, and it calculates the
area.
• This rule takes the average of
Let f(x) be a continuous function on the interval
the [a,the
left and b].right
Now sum.
divide the
intervals [a, b] into n equal subintervals with each of width,

Such that
We assume that the length of each subinterval is given by . First,
recall that the area of a trapezoid with a height of and bases of
length b1 and b2 is given by

We see that the first trapezoid has a height and parallel bases of
length f(x0) and f(x1).
Thus, the area of the first trapezoid :

The areas of the remaining three trapezoids are


Find Solution of an equation 2x3-4x+1 using Trapezoidal rule
x1 = 2 and x2 = 4; Step value (h) = 0.5

The value of table for x and y

x 2 2.5 3 3.5 4
y=f(x) 9 22.25 43 72.75 113
Using Trapezoidal Rule
Simpson’s ¹/₃ rule
• polynomial based on quadratic approximation
• Instead of area of trapezoids, area of parabolas are considered
• In this, each approximation actually covers two of the subintervals.
• This is why we require the number of subintervals to be even.
ₐ∫ᵇ f (x) dx = h/3 [(y₀ + yₙ) + 4 (y₁ + y₃ + ..) + 2(y₂ + y₄ + ..)]

a, b is the interval of integration


h = (b – a)/ n
y₀ means the first term and yₙ means last
term.
(y₁ + y₃ + ..) means the sum of odd terms.
(y₂ + y₄ + …) means sum of even terms.
Find the integration of f(x) using Simpson’s
1/3 rule.
x 0 0.1 0.2 0.3 0.4
0.997 0.977 0.860
f(x) 1
5
0.99
6 4
Using Simpson’s 1/3 Rule

ₐ∫ᵇ f (x) dx = h/₃ [(y₀ + yₙ) + 4 (y₁ + y₃ + …) + 2 (y₂ + y₄ + …)]

h = 0.1

ₐ∫ᵇ f (x) dx = 0.1/3 [(1+0.8604)+4×(0.9975+0.9776)+2×(0.99)]

ₐ∫ᵇ f (x) dx = 0.1/3 [(1+0.8604)+4×(1.9751)+2×(0.99)]

ₐ∫ᵇ f (x) dx = 0.39136

Solution of Simpson’s 1/3 rule = 0.39136


Find integration of f(x) using Simpson's 1/3 rule

The value of table for x and y=f(x)

x 1.4 1.6 1.8 2 2.2


y 4.0552 4.953 6.0436 7.3891 9.025
Simpson’s 3/8 rule
• polynomial based on quadratic approximation
• Instead of area of trapezoids, area of parabolas are considered
• In this, each approximation actually covers three of the subintervals instead of
two (like in 1/3rd rule)
• This is why we require the number of subintervals to be even.
ₐ∫ᵇ f (x) dx = [(y₀ + yₙ) + 3(y₁ + y₂ + y₄ + …) + 2(y₃ + y₆ +…)]
a, b is the interval of integration

h = (b – a )/ n

y₀ means the first term and yₙ means the last term.

( y₁ + y₂ + y₄ + … ) means the sum of remaining terms.

( y₃ + y₆ +…) means the multiples of 3.


Simpson's 1/3 rule Method Trapezoidal Method
In Simpson's 1/3 rule Method, we
In trapezoidal method, the boundary
1. approximate only the quadratic
between the ordinates is straight.
polynomial i.e. the parabolic curves.
In Simpson 's 1/3 rule Method , the
In trapezoidal, there is no limitation, it is
2. number of divisions should be even in
applicable for any number of ordinates.
this case.
This method gives an approximate
3. This method gives an accurate results.
result.
The result obtained by Simpson's 1/3 The result obtained by the trapezoidal
rule Method rule are greater or lesser rule are not affected because the
4.
as the curve of the boundary is convex boundary between the ordinates is
or concave towards the baseline. considered straight.
In this method, chances of errors is
5. In this method, chance of errors is less.
more.
Computations are not as complex in Computations are complex in this
6.
this method. method.
The integral function can be calculated
The integral function can be calculated
as = h/3 [(sum of 1st and last
Sr.
Simpson’s 1/3 rule Simpson’s 3/8 rule
No
It approximates function y = f(x) It approximates the function y = f(x)
1. by a parabola i.e. by 2nd order by a parabola i.e. by 3rd order
polynomial. polynomial.
In this, the chances of error are
2. more than Simpson’s 3/8 rule.
In this, the chances of error are less.

The integral function can be The integral function can be calculated


calculated as = h/3 [(sum of 1st as = 3h/8 [(sum of 1st and last
3. and last ordinates) + 4 (sum of ordinates) + 2 (sum of multiple of 3
odd ordinates) + 2 (sum of even ordinates) + 3 (sum of remaining
ordinates)]. ordinates)].
This rule is applied where N is an This rule is applied where N is a
4. even number. multiple of 3.
• Trapezoidal Rule: n=1
• Simpson’s One –third Rule: n=2
• Simpson’s Three –Eighth Rule: n=3

Common questions

Powered by AI

Simpson's 1/3 rule approximates the area under a curve using quadratic or parabolic segments, requiring the number of subintervals to be even . This method considers the curve's shape, leading to more accurate results when the function has curvature. On the other hand, the Trapezoidal rule approximates the area using linear segments between data points, which can lead to inaccuracies when the curve is highly curved as this rule does not account for the curvature . Thus, Simpson's 1/3 rule generally provides more accurate results when the function's behavior is concave or convex because it integrates the curve shape into its calculations, though it can be slightly more complex computationally .

Simpson's 1/3 rule handles functions with curvature more adeptly by using quadratic polynomials to approximate and integrate the function over intervals, which reduces errors associated with curvature deviations . This polynomial approach effectively fits curves when the functional shape across the defined intervals resembles a parabolic arc. Conversely, the trapezoidal rule handles functions based on linearity, approximating by dividing the curve into straight-line segments between ordinate points. This makes it less suitable for flagrantly curved functions, where its linear approximation might miss intricate changes captured by Simpson's rule . Thus, while Simpson's rule encompasses curvature with higher accuracy, the trapezoidal rule offers a straightforward, albeit less flexible, alternative for linear or nearly linear behavior .

The trapezoidal rule applies by treating the integration boundary as linear segments between given data points, irrespective of the curve's actual shape. This method sums the areas of trapezoids under the function, where each trapezoid has a height equal to the interval step and bases given by the function values at the interval's endpoints . The rule calculates the integral as the weighted average of the function evaluated at these boundary points, disregarding any concavity or curve shape alterations between these ordinates . This approach thus simplifies computations and limits errors to those due to discretization rather than curvature, making it robust for piecewise-linear approximations .

The requirement for an even number of subintervals in Simpson's 1/3 rule stems from its use of quadratic polynomials to approximate the area under a curve, which covers two subintervals each . An even number of subintervals ensures that the approximation evenly integrates the parabolic sections over the interval. Conversely, Simpson's 3/8 rule requires the number of subintervals to be a multiple of three since it approximates using cubic polynomials that span three subintervals . This distinction allows Simpson's 3/8 rule to accommodate more points but requires careful partitioning to meet its subinterval criteria .

Simpson's 1/3 rule involves higher occurrences of error when the curve is irregular due to its approximation with quadratic polynomials, particularly if the polynomial does not accurately reflect the function's concavity or convexity . Errors occur when fitting a parabola to intervals of a function where data points don't follow a smooth, consistent pattern, unlike the straight-line approximation of the Trapezoidal rule which can handle varying concavity more resiliently since it effectively partitions the data points linearly without trying to curve fit over each subinterval . Thus, while Simpson's 1/3 rule is generally more accurate for smooth functions that resemble a parabola, irregular regions can exacerbate inaccuracies .

Simpson's 3/8 rule is preferred over the 1/3 rule when the function's behavior within the given interval is complex or requires a higher level polynomial approximation. Its cubic polynomial fit facilitates better accuracy in capturing the function's gradual changes across three subintervals, reducing approximation errors associated with lesser-degree polynomials . This rule’s structure inherently lowers errors for smoothly varying functions where quadratic approximation (like that in Simpson's 1/3) would fall short . The 3/8 rule’s implementation, albeit computationally more intense due to its polynomial degree and subdivision requirements (multiples of three subintervals), provides more precise results by accommodating the entire function range more comprehensively, especially in cases of non-linear behavior .

Applying Simpson's 1/3 rule to integrate f(x) over [0, 0.4], with discrete data points f(x): [1, 0.9975, 0.99, 0.9776, 0.8604], requires first confirming even subinterval count (here, 4 intervals). Using h = 0.1, compute: Integral = (h/3) [(y₀ + yₙ) + 4(y₁ + y₃) + 2(y₂)]. Here, y₀ = 1, yₙ = 0.8604, y₁ + y₃ = 0.9975 + 0.9776, and y₂ = 0.99. The calculated integral becomes: 0.1/3 [(1+0.8604) + 4(1.9751) + 2(0.99)] = 0.39136 . Each step involves sequential applications of the rule's coefficients on alternate data points, enhancing the result's accuracy by leveraging the weighted summation typical in Simpson's methods .

Simpson's 1/3 and 3/8 rules introduce computational complexities due to their polynomial approximations and specific subdivision requirements. Simpson's 1/3 rule involves quadratic polynomial calculations, necessitating even subintervals which can complicate implementation when input data is irregular or sparse . As a result, while offering heightened accuracy over linear methods, it imposes additional computational work to ensure conditions are met. Simpson's 3/8 rule further increases complexity by requiring cubic polynomial calculations and subdivisions that are multiples of three . This heightened degree of polynomial approximation accommodates more significant fluctuation in the function, but the increased computation may make it less suitable for real-time or resource-limited contexts. These complexities influence solver choice based on accuracy versus computational resource availability in numerical tasks .

In numerical integration, the polynomial degree is critical as it defines the fit and accuracy of the approximation. Simpson's 1/3 rule uses a quadratic polynomial (2nd degree), which adequately approximates smooth functions resembling parabolic curves, requiring even subdivisions for precision . Conversely, Simpson's 3/8 rule utilizes cubic polynomials (3rd degree), providing a more accurate approximation for functions with smoother, more gradual changes since it integrates more points (three subintervals) into each polynomial fit . The increasing polynomial degree allows Simpson's 3/8 rule to reduce approximation errors by better mirroring the function's higher-degree changes within each interval, although computational complexity and requirements such as multiples of three subintervals also increase .

To solve the polynomial equation 2x^3-4x+1 in the interval [2, 4] using the trapezoidal rule with a step size of 0.5, we first evaluate the function at x-values 2, 2.5, 3, 3.5, and 4, giving respective y-values of 9, 22.25, 43, 72.75, and 113 . The trapezoidal rule is applied by calculating the area under these points using: Approximation = (step/2) * [(9 + 113) + 2*(22.25 + 43 + 72.75)], resulting in the numerical integral of approximately 148.75 for the given interval . This application provides an estimate rather than an exact solution due to methodical simplifications inherent in numerical integration.

You might also like