42) Use the trapezoidal rule with n = 10 to approximate Integral (from 0 to 20) of cos(Pi*x)dx. Compare your result to the actual value. Can you explain the discrepancy?
When I use the Trap Rule, I get Delta(x) = 20/10 = 2.
So, 1(f(2) + 2f(4) + 2f(6) + 2f(8) + 2f(10) + 2f(12) + 2f(14) + 2f(16) + 2f(18) + f(20)) = 20.
However, when I calculate the integral I get (1/Pi)*(Sin(Pi*x)) from 0 to 20, or just 0.
I don't really know how to explain the discrepancy -- I only learned what trap. rule was yesterday!
Any help? Am I right in the calculations?