Trapezoidal Rule (just need to check my answer)

  • Thread starter DivGradCurl
  • Start date
In summary, the Trapezoidal Rule with n=10 was used to approximate the integral of cos(pi*x) from 0 to 20. The result was compared to the actual value, which was found to be 0. The discrepancy can be explained by the low value of n, as shown by the error bound calculation. To achieve accuracy to within one decimal place, n would need to be at least 82. This is due to the oscillatory nature of the integrand. This can be compared to the concept of sampling frequency in signal processing, where a higher frequency is needed to accurately capture high-frequency components.
  • #1
DivGradCurl
372
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
  • #2
Can I also say that the need for a higher value of n is due to the oscillatory integrand?

Thanks
 
  • #3
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
 

1. What is the Trapezoidal Rule?

The Trapezoidal Rule is a numerical method used for approximating the definite integral of a function. It is based on dividing the area under the curve into trapezoids and calculating the sum of their areas.

2. When is the Trapezoidal Rule used?

The Trapezoidal Rule is often used when the function being integrated is difficult to integrate analytically or when the function is only known through a set of discrete points.

3. How does the Trapezoidal Rule work?

The Trapezoidal Rule works by dividing the interval of integration into smaller subintervals and approximating the area under the curve of each subinterval with a trapezoid. The sum of the areas of all the trapezoids is then used as an approximation for the total area under the curve.

4. What is the formula for the Trapezoidal Rule?

The formula for the Trapezoidal Rule is:
ab f(x) dx ≈ (b-a) * [(f(a) + f(b))/2]

5. What are the advantages of using the Trapezoidal Rule?

The Trapezoidal Rule is relatively easy to use and does not require advanced mathematical knowledge. It also provides a more accurate approximation compared to other numerical integration methods, such as the Midpoint Rule or Simpson's Rule.

Similar threads

  • Introductory Physics Homework Help
Replies
5
Views
473
  • Introductory Physics Homework Help
Replies
7
Views
678
  • Introductory Physics Homework Help
Replies
28
Views
368
Replies
1
Views
142
  • Introductory Physics Homework Help
Replies
17
Views
401
  • Introductory Physics Homework Help
Replies
4
Views
575
  • Introductory Physics Homework Help
Replies
2
Views
633
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
22
Views
407
  • Introductory Physics Homework Help
Replies
3
Views
150
Back
Top