SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Trapezoidal 
Method
Acknowledgement 
Md. Jashim Uddin 
Assistant Professor 
Dept. Of Natural Sciences 
Dept. Of Computer Science and 
Engineering 
Daffodil International University
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
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
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
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
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
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
The trapezoidal rule 
approximation improves 
With More strips , from 
This figure we can clearly 
See it 
5
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
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
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
Example: 
푥1 푥2 푥3 
=2 =3 =4 
=1 =5 
5 
1 + 푥2 푑푥 
1 
h = 
5−1 
4 
=1 
Trapezoidal Rule = 
1 
2 
[ 푓(1) + 푓(5) + 2(푓(2) + 푓(3) + 푓(4)] 
= 
1 
2 
[ (1 + 12) + (1 + 52) + 2((1 + 22) + (1 + 32) + (1 + 42)] 
= 
1 
2 
× 92 
= 46 9
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
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
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
Live Preview 
Live Preview of Trapezoidal Method 
5 
1 + 푥2 푑푥 
1 
Lower limit =1 
Upper limit =5 
Interval h=4 
13
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
References 
 http://en.wikipedia.org/wiki/Trapezoidal_rule 
 http://blogs.siam.org/the-mathematics-and-history- 
of-the-trapezoidal-rule/ 
 And various relevant websites 
15
Thank You

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

NUMERICAL INTEGRATION AND ITS APPLICATIONS
NUMERICAL INTEGRATION AND ITS APPLICATIONSNUMERICAL INTEGRATION AND ITS APPLICATIONS
NUMERICAL INTEGRATION AND ITS APPLICATIONS
 
Trapezoidal rule
Trapezoidal ruleTrapezoidal rule
Trapezoidal rule
 
weddle's rule
weddle's ruleweddle's rule
weddle's rule
 
Spline Interpolation
Spline InterpolationSpline Interpolation
Spline Interpolation
 
Calculus of variations
Calculus of variationsCalculus of variations
Calculus of variations
 
trapezoidal and simpson's 1/3 and 3/8 rule
trapezoidal and simpson's 1/3 and 3/8 ruletrapezoidal and simpson's 1/3 and 3/8 rule
trapezoidal and simpson's 1/3 and 3/8 rule
 
Line integral,Strokes and Green Theorem
Line integral,Strokes and Green TheoremLine integral,Strokes and Green Theorem
Line integral,Strokes and Green Theorem
 
Lesson 30: The Definite Integral
Lesson 30: The  Definite  IntegralLesson 30: The  Definite  Integral
Lesson 30: The Definite Integral
 
Gamma function
Gamma functionGamma function
Gamma function
 
Differential geometry three dimensional space
Differential geometry   three dimensional spaceDifferential geometry   three dimensional space
Differential geometry three dimensional space
 
General Quadrature Equation
General Quadrature EquationGeneral Quadrature Equation
General Quadrature Equation
 
Fourier series
Fourier seriesFourier series
Fourier series
 
numerical methods
numerical methodsnumerical methods
numerical methods
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadratures
 
Lesson 11: Limits and Continuity
Lesson 11: Limits and ContinuityLesson 11: Limits and Continuity
Lesson 11: Limits and Continuity
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
 
Taylor's and Maclaurin series
Taylor's and Maclaurin seriesTaylor's and Maclaurin series
Taylor's and Maclaurin series
 
Bisection method
Bisection methodBisection method
Bisection method
 
Fourier series Introduction
Fourier series IntroductionFourier series Introduction
Fourier series Introduction
 
Interpolation In Numerical Methods.
 Interpolation In Numerical Methods. Interpolation In Numerical Methods.
Interpolation In Numerical Methods.
 

Ähnlich wie Presentation on Numerical Method (Trapezoidal Method)

daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
hodcsencet
 

Ähnlich wie Presentation on Numerical Method (Trapezoidal Method) (20)

An application of the hyperfunction theory to numerical integration
An application of the hyperfunction theory to numerical integrationAn application of the hyperfunction theory to numerical integration
An application of the hyperfunction theory to numerical integration
 
UNIT-II.pptx
UNIT-II.pptxUNIT-II.pptx
UNIT-II.pptx
 
2. Fixed Point Iteration.pptx
2. Fixed Point Iteration.pptx2. Fixed Point Iteration.pptx
2. Fixed Point Iteration.pptx
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
 
Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...
Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...
Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...
 
Gradient_Descent_Unconstrained.pdf
Gradient_Descent_Unconstrained.pdfGradient_Descent_Unconstrained.pdf
Gradient_Descent_Unconstrained.pdf
 
DeepLearn2022 1. Goals & AlgorithmDesign.pdf
DeepLearn2022 1. Goals & AlgorithmDesign.pdfDeepLearn2022 1. Goals & AlgorithmDesign.pdf
DeepLearn2022 1. Goals & AlgorithmDesign.pdf
 
Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...
Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...
Comparison Results of Trapezoidal, Simpson’s 13 rule, Simpson’s 38 rule, and ...
 
1519 differentiation-integration-02
1519 differentiation-integration-021519 differentiation-integration-02
1519 differentiation-integration-02
 
Branch and bounding : Data structures
Branch and bounding : Data structuresBranch and bounding : Data structures
Branch and bounding : Data structures
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
 
勾配法
勾配法勾配法
勾配法
 
Overviewing the techniques of Numerical Integration.pdf
Overviewing the techniques of Numerical Integration.pdfOverviewing the techniques of Numerical Integration.pdf
Overviewing the techniques of Numerical Integration.pdf
 
Mit6 094 iap10_lec03
Mit6 094 iap10_lec03Mit6 094 iap10_lec03
Mit6 094 iap10_lec03
 
MATLAB : Numerical Differention and Integration
MATLAB : Numerical Differention and IntegrationMATLAB : Numerical Differention and Integration
MATLAB : Numerical Differention and Integration
 
HOME ASSIGNMENT (0).pptx
HOME ASSIGNMENT (0).pptxHOME ASSIGNMENT (0).pptx
HOME ASSIGNMENT (0).pptx
 
Numerical differentation with c
Numerical differentation with cNumerical differentation with c
Numerical differentation with c
 
HOME ASSIGNMENT omar ali.pptx
HOME ASSIGNMENT omar ali.pptxHOME ASSIGNMENT omar ali.pptx
HOME ASSIGNMENT omar ali.pptx
 
Introduction to comp.physics ch 3.pdf
Introduction to comp.physics ch 3.pdfIntroduction to comp.physics ch 3.pdf
Introduction to comp.physics ch 3.pdf
 
05_AJMS_16_18_RA.pdf
05_AJMS_16_18_RA.pdf05_AJMS_16_18_RA.pdf
05_AJMS_16_18_RA.pdf
 

Mehr von Syed Ahmed Zaki

Mehr von Syed Ahmed Zaki (11)

Networking Lab Report
Networking Lab ReportNetworking Lab Report
Networking Lab Report
 
Lab report assembly
Lab report assemblyLab report assembly
Lab report assembly
 
Assignment on Numerical Method C Code
Assignment on Numerical Method C CodeAssignment on Numerical Method C Code
Assignment on Numerical Method C Code
 
Presentation on Transmission Media
Presentation on Transmission MediaPresentation on Transmission Media
Presentation on Transmission Media
 
Architecture of 80286 microprocessor
Architecture of 80286 microprocessorArchitecture of 80286 microprocessor
Architecture of 80286 microprocessor
 
Algorithm Presentation
Algorithm PresentationAlgorithm Presentation
Algorithm Presentation
 
Importance of Electric Device Knowledge in Computer Science Education
Importance of Electric Device Knowledge in Computer Science EducationImportance of Electric Device Knowledge in Computer Science Education
Importance of Electric Device Knowledge in Computer Science Education
 
Presentation on bernoulli
Presentation on bernoulliPresentation on bernoulli
Presentation on bernoulli
 
Presentation on inverse matrix
Presentation on inverse matrixPresentation on inverse matrix
Presentation on inverse matrix
 
Project Report - Diabetic Profile Management System : Structured Programming ...
Project Report - Diabetic Profile Management System : Structured Programming ...Project Report - Diabetic Profile Management System : Structured Programming ...
Project Report - Diabetic Profile Management System : Structured Programming ...
 
History and Real Life Applications of Fourier Analaysis
History and Real Life Applications of Fourier AnalaysisHistory and Real Life Applications of Fourier Analaysis
History and Real Life Applications of Fourier Analaysis
 

Kürzlich hochgeladen

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Kürzlich hochgeladen (20)

Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 

Presentation on Numerical Method (Trapezoidal Method)

  • 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
  • 13. Example: 푥1 푥2 푥3 =2 =3 =4 =1 =5 5 1 + 푥2 푑푥 1 h = 5−1 4 =1 Trapezoidal Rule = 1 2 [ 푓(1) + 푓(5) + 2(푓(2) + 푓(3) + 푓(4)] = 1 2 [ (1 + 12) + (1 + 52) + 2((1 + 22) + (1 + 32) + (1 + 42)] = 1 2 × 92 = 46 9
  • 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
  • 19. References  http://en.wikipedia.org/wiki/Trapezoidal_rule  http://blogs.siam.org/the-mathematics-and-history- of-the-trapezoidal-rule/  And various relevant websites 15
  • 20.