DivGradCurl
- 364
- 0
Problem
Use the Trapezoidal Rule with n=10 to approximate
\int _0 ^{20} \cos ( \pi x) \: dx
Compare your result to the actual value. Can you explain the discrepancy?
My work
The actual value can be found as follows
\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
Next, we have the Trapezoidal Rule with n=10
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
Can I just say that the reason for the discrepancy is the low value of n ? According to the error bound, we have
\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
which shows that in order to achieve accuracy to within one decimal place, it is required to have n \geq 82.
Is that it?
Thank you
PS: I should have calculated that for the first digit...
\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
Use the Trapezoidal Rule with n=10 to approximate
\int _0 ^{20} \cos ( \pi x) \: dx
Compare your result to the actual value. Can you explain the discrepancy?
My work
The actual value can be found as follows
\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
Next, we have the Trapezoidal Rule with n=10
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
Can I just say that the reason for the discrepancy is the low value of n ? According to the error bound, we have
\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
which shows that in order to achieve accuracy to within one decimal place, it is required to have n \geq 82.
Is that it?
Thank you
PS: I should have calculated that for the first digit...
\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
Last edited: