Trapezoidal Rule (just need to check my answer)

  • Thread starter Thread starter DivGradCurl
  • Start date Start date
Click For Summary
SUMMARY

The forum discussion focuses on using the Trapezoidal Rule with n=10 to approximate the integral of cos(πx) from 0 to 20. The actual value of the integral is 0, while the approximation yields 20, highlighting a significant discrepancy. The user identifies that the low value of n contributes to this error, referencing the error bound formula |E_T| ≤ (K(b-a)³)/(12n²) to determine that n must be at least 82 for one decimal place accuracy. Additionally, the oscillatory nature of the integrand is noted as a factor necessitating a higher n.

PREREQUISITES
  • Understanding of the Trapezoidal Rule for numerical integration
  • Familiarity with error bounds in numerical methods
  • Knowledge of oscillatory functions and their impact on integration
  • Basic calculus, specifically integration techniques
NEXT STEPS
  • Study the error bounds for numerical integration methods
  • Learn about the effects of oscillatory integrands on numerical approximations
  • Explore the concept of sampling frequency in relation to Fourier analysis
  • Investigate alternative numerical integration methods, such as Simpson's Rule
USEFUL FOR

Students, educators, and professionals in mathematics, engineering, and physics who are interested in numerical integration techniques and their accuracy, particularly in the context of oscillatory functions.

DivGradCurl
Messages
364
Reaction score
0
Problem

Use the Trapezoidal Rule with [tex]n=10[/tex] to approximate

[tex]\int _0 ^{20} \cos ( \pi x) \: dx[/tex]

Compare your result to the actual value. Can you explain the discrepancy?

My work

The actual value can be found as follows

[tex]\int _0 ^{20} \cos ( \pi x) \: dx = \left. \frac{\sin ( \pi x)}{\pi} \right] _{x=20} - \left. \frac{\sin ( \pi x)}{\pi} \right] _{x=0} = 0[/tex]

Next, we have the Trapezoidal Rule with [tex]n=10[/tex]

[tex]T_{10} = \left( \frac{20-0}{10\cdot 2} \right) \left[ \cos (0\cdot \pi) + 2\cos (2\cdot \pi) + 2\cos (4\cdot \pi) + \dots + 2\cos (16\cdot \pi) + 2\cos (18\cdot \pi) + \cos (20\cdot \pi) \right] = 20[/tex]

Can I just say that the reason for the discrepancy is the low value of [tex]n[/tex] ? According to the error bound, we have

[tex]\left| E_T \right| \leq \frac{K(b-a)^3}{12n^2} < \left| \mbox{ error } \right| \Longrightarrow \frac{1\cdot (20-0)^3}{12 n^2} < 10^{-1} \Rightarrow n \geq 82[/tex]

which shows that in order to achieve accuracy to within one decimal place, it is required to have [tex]n \geq 82[/tex].

Is that it?

Thank you

PS: I should have calculated that for the first digit...

[tex]\left| E_T \right| \leq \frac{K(b-a)^3}{12n^2} < \left| \mbox{ error } \right| \Longrightarrow \frac{1\cdot (20-0)^3}{12 n^2} < 10^{0} \Rightarrow n \geq 26[/tex]
 
Last edited:
Physics news on Phys.org
Can I also say that the need for a higher value of n is due to the oscillatory integrand?

Thanks
 
thiago_j said:
Can I also say that the need for a higher value of n is due to the oscillatory integrand?

Thanks


I think yes, you can.

I do not remember the name of theorem concerning transfer of information which says that the sampling frequency should be at least twice that of the highest-frequency Fourier component of the signal to be transmitted.

Your sampling frequency here is the same as the frequency of the function. It is the worst choice possible as it gives the same values at each point, like a constant function would do.

ehild
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
986
Replies
18
Views
2K
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
28
Views
2K
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
4
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K