The document discusses the trapezoidal method, which is a technique for approximating definite integrals. It provides the general formula for the trapezoidal rule, explains how it works by approximating the area under a function as a trapezoid, and discusses its history, advantages of being easy to use and having powerful convergence properties. An example application of the trapezoidal rule is shown, along with pseudocode and a C code implementation. The document concludes the trapezoidal rule can accurately integrate non-periodic and periodic functions.
2. Acknowledgement
Md. Jashim Uddin
Assistant Professor
Dept. Of Natural Sciences
Dept. Of Computer Science and
Engineering
Daffodil International University
3. Content
What is Trapezoidal Method
General Formula of Integration
How it works
History of Trapezoidal Method
Advantages
Application of Trapezoidal Rule
Example
Problem & Algorithm
C code for Trapezoidal Rule
Live Preview
Conclusion
References
4. Team : Root Finder
Group Member :
• Syed Ahmed Zaki ID:131-15-2169
• Fatema Khatun ID:131-15-2372
• Sumi Basak ID:131-15-2364
• Priangka Kirtania ID:131-15-2385
• Afruza Zinnurain ID:131-15-2345
5. What is Trapezoidal Method ?
In numerical analysis, the trapezoidal rule or method is a
technique for approximating the definite integral.
푥푛
푥0
f(x) dx
It also known as Trapezium rule.
1
6. General Formula of Integration
In general Integration formula when n=1 its
Trapezoidal rule.
I=h[n푦0+
푛2
2
Δ푦0+
2푛3−3푛2
12
Δ2푦0+
푛4−4푛3+4푛2
24
Δ3푦0 + ⋯ ]
After putting n=1,
Trapezoidal Rule =
ℎ
2
[푦0 + 푦푛 + 2(푦1 + 푦2 + 푦3 + ⋯ . 푦푛−1)]
2
7. How it works ?
Trapezoid is an one kind of rectangle which has 4 sides and minimum two
sides are parallel
Area A=
푏1+푏2
2
ℎ
3
8. The trapezoidal rule works
by approximating the region
under the graph of the
function as a trapezoid and
calculating its area in limit.
It follows that,
푏
f(x) dx ≈
푎
(b−a)
2
[f(a) +f(b)]
4
9. The trapezoidal rule
approximation improves
With More strips , from
This figure we can clearly
See it
5
10. History Of Trapezoidal Method
• Trapezoidal Rule,” by Nick Trefethen and
André Weideman. It deals with a fundamental and
classical issue in numerical analysis—approximating
an integral.
• By focusing on up-to-date covergence of recent
results
Trefethen
6
11. Advantages
There are many alternatives to the trapezoidal rule,
but this method deserves attention because of
• Its ease of use
• Powerful convergence properties
• Straightforward analysis
7
12. Application of Trapezoidal Rule
• The trapezoidal rule is one of the family members of
numerical-integration formula.
• The trapezoidal rule has faster convergence.
• Moreover, the trapezoidal rule tends to become
extremely accurate than periodic functions
8
14. Problem & Algorithm
Problem: Here we have to find integration for the (1+푥2)dx
with lower limit =1 to upper limit = 5
Algorithm:
Step 1: input a,b,number of interval n
Step 2: h=(b-a)/n
Step 3: sum=f(a)+f(b)
Step 4: If n=1,2,3,……i
Then , sum=sum+2*y(a+i*h)
Step 5: Display output=sum *h/2
10
15. C Code for Trapezoidal Method
#include<stdio.h>
float y(float x)
{
return (1+x*x);
}
int main()
{
float a,b,h,sum;
int i,n;
printf("Enter a=x0(lower limit), b=xn(upper limit), number of
subintervals: ");
11
16. scanf("%f %f %d",&a,&b,&n);
h=(b-a)/n;
sum=y(a)+y(b);
for(i=1;i<n;i++)
{
sum=sum+2*y(a+i*h);
}
printf("n Value of integral is %f n",(h/2)*sum);
return 0;
}
12
17. Live Preview
Live Preview of Trapezoidal Method
5
1 + 푥2 푑푥
1
Lower limit =1
Upper limit =5
Interval h=4
13
18. Conclusion
Trapezoidal Method can be applied accurately for
non periodic function, also in terms of periodic
integrals.
when periodic functions are integrated over their
periods, trapezoidal looks for extremely accurate.
14
Periodic Integral Function