0% found this document useful (0 votes)
83 views4 pages

Numerical Integration: 1) The Trapezoidal Rule

The trapezoidal rule approximates integrals by replacing the function with a linear interpolation between function values at the interval endpoints. This forms a trapezoid whose area approximates the integral. Increasing the number of subintervals improves accuracy by making the linear approximation more accurate over smaller sections. Numerical examples show the error decreasing with more subintervals, demonstrating the rule's convergence towards the true integral as the intervals become smaller.

Uploaded by

Noor Mohammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views4 pages

Numerical Integration: 1) The Trapezoidal Rule

The trapezoidal rule approximates integrals by replacing the function with a linear interpolation between function values at the interval endpoints. This forms a trapezoid whose area approximates the integral. Increasing the number of subintervals improves accuracy by making the linear approximation more accurate over smaller sections. Numerical examples show the error decreasing with more subintervals, demonstrating the rule's convergence towards the true integral as the intervals become smaller.

Uploaded by

Noor Mohammed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Numerical Integration

1) The Trapezoidal Rule


𝑏
The control idea behind most ideas for approximating 𝐼 𝑓 = 𝑎
𝑓 𝑥 𝑑𝑥 is to replace f(x) by an approximating
function whose integral can be evaluated. Approximate f(x) by the linear interpolation
𝑏−𝑥 𝑓 𝑎 + 𝑥−𝑎 𝑓(𝑏)
𝑦 = 𝑃1 𝑥 = which interpolate f(x) at a & b
𝑏−𝑎

The integral of 𝑃1 𝑥 over [a, b] is the area of the shaded trapezoidal shown in fig. below; it is given by:
𝑓 𝑎 +𝑓(𝑏)
𝑇1 𝑓 = 𝑏 − 𝑎 y
2

This approximate the integral I(f) is almost linear on [a, b] 𝑦 = 𝑃1 (𝑥)

x
a b
Example1:
1 𝑑𝑥
Approximate the integral 𝐼 = 0 1+𝑥
.
Solution:
1
The true value is 𝐼 = ln(1 + 𝑥) = 0.69314
0
𝑓 𝑎 + 𝑓(𝑏)
𝑇1 𝑓 = 𝑏 − 𝑎
2

1 1
+
𝑇1 = (1 − 0) 1 + 0 1 + 1
2

1
1+2
𝑇1 =
2

3
𝑇1 = 2
2
𝑇1 = 0.75
The actual error is 𝐼 − 𝑇1 = −0.0569
To improve on the approximation 𝑇1 𝑓 when f(x) is not a nearly linear function on [a, b], break the interval into smaller
𝑓 𝑎 −𝑓(𝑏)
subintervals and apply 𝑇1 𝑓 = 𝑏 − 𝑎 on each subinterval. If the subintervals are small enough, then f(x)
2

will be nearly linear on each one. Finally we obtain this equation:


𝒇 𝒙𝟎 𝒇 𝒙𝒏 𝒃−𝒂
𝑻𝒏 𝒇 = 𝒉. + 𝒇 𝒙𝟏 + 𝒇 𝒙𝟐 + ⋯ + 𝒇 𝒙𝒏−𝟏 + ; 𝒉=
𝟐 𝟐 𝒏
This is trapezoidal numerical integration rule. The subscribe n gives the number of subintervals being used. It is clear that
increasing n leads to more accuracy.
4 𝑑𝑥
Example 2: Calculate 𝑻𝒏 𝒇 and the error for different value of n for the integral 𝐼 = 0 1+𝑥 2
; 𝑛 = (2,4,16, 32,64,128)

4 𝑑𝑥 4
Solution: 𝐼= 0 1+𝑥 2
= tan−1 ( 𝑥)
0
= tan−1 4 − tan−1 0 = 1.325817664
n=2
𝑏−𝑎 4−0
ℎ= 𝑛
= 2
= 2; 𝒙𝟎 = 𝟎, 𝒙𝟏 = 𝟐, 𝒙𝟐 = 𝟒

𝒇 𝒙𝟎 𝒇 𝒙𝒏
𝑻𝒏 𝒇 = 𝒉. + 𝒇 𝒙𝟏 + 𝒇 𝒙𝟐 + ⋯ + 𝒇 𝒙𝒏−𝟏 +
𝟐 𝟐
𝑓 𝑥0 𝑓 𝑥2
𝑇2 𝑓 = 2 + 𝑓 𝑥1 +
2 2

𝑓 0 𝑓 4
𝑇2 𝑓 = 2 +𝑓 2 +
2 2

1 1 1
=2 + + n Actual error
2 5 17 ∗ 2
=1.458823529 2 −1.33005 ∗ 10−1
4 -3.59 ∗ 10−3
Actual error = I - 𝑇2 𝑓 = −0.133005865 = −1.33005 𝑒 − 1
16 1.44 ∗ 10−4
Similarly for n = 4
32 3.6 ∗ 10−5
Actual error = -3.59 e – 3
64 9.01 ∗ 10−6
𝑛 ∝ 𝑎𝑐𝑐𝑢𝑟𝑎𝑐𝑦 128 2.25 ∗ 10−6
1
𝑛∝
𝑎𝑐𝑡𝑢𝑎𝑙 𝑒𝑟𝑟𝑜𝑟

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy