Project:-5 Evaluation of Real Definite Integrals Using Trapezoidal Rule and Simpson's One Third Rule
Project:-5 Evaluation of Real Definite Integrals Using Trapezoidal Rule and Simpson's One Third Rule
Project:-5 Evaluation of Real Definite Integrals Using Trapezoidal Rule and Simpson's One Third Rule
PRESENTED BY :-
NAME – V SAI MANASA
REG.NO - 210101120040
SEC - A
BRANCH :-COMPUTER SCIENCE AND ENGINEERING
Simpson’s one third rule :- Simpson's 1/3 rule is a numerical method for
approximating the definite integral of a function. It is named after the mathematician
Thomas Simpson and is based on approximating the function by a second-order
polynomial over each subinterval of the integration interval.
∫[a,b] f(x) dx ≈ h/3 * [f(a) + 4f(x_1/2) + 2f(x_1) + 4f(x_3/2) + ... + 2f(x_{n-1}) +
4f(x_{n-1/2}) + f(b)]
Evaluate the definite integral ∫[0, 2] x^2 dx using the Trapezoidal rule.
The Trapezoidal rule works by approximating the area under the curve as a series of
trapezoids.
To use the Trapezoidal rule, we first divide the interval [0, 2] into smaller subintervals of
equal length. Let's say we want to use n = 4 subintervals. Then the length of each
subinterval is:
h = (b - a) / n = (2 - 0) / 4 = 0.5
So we'll use four subintervals with endpoints:
x0 = 0
x1 = 0.5
x2 = 1
x3 = 1.5
x4 = 2
Next, we use the Trapezoidal rule formula:
∫[a, b] f(x) dx ≈ h/2 * [f(a) + 2f(x1) + 2f(x2) + 2f(x3) + f(b)]
∫[0, 2] x^2 dx ≈ (1/2)[f(0) + 2f(0.5) + 2f(1) + 2f(1.5) + f(2)]
= (1/2)[0.5 + 4.5 + 9]
=7
Therefore, using the Trapezoidal rule with n = 4, we approximate the value of the definite
integral ∫[0, 2] x^2 dx to be approximately equal to 7.
Evaluate the integral:
∫₀¹ e^x dx
Using Simpson's one-third rule, we first need to divide the interval [0, 1] into an even
number of subintervals of equal width, denoted by h. Let's say we use four subintervals,
so h = (1-0)/4 = 0.25.
Therefore, the endpoints of our subintervals are:
x₀ = 0
x₁ = 0.25
x₂ = 0.5
x₃ = 0.75
x₄ = 1
Now we need to calculate the function values at these endpoints. We have:
f(x₀) = e^0 = 1
f(x₁) = e^0.25
f(x₂) = e^0.5
f(x₃) = e^0.75
f(x₄) = e^1 = e
Next, we can use Simpson's one-third rule to approximate the integral.