Which method would you recommend for error estimation of the following approximation?
$$\frac{1}{K} \sum\_{j=0}^{K-1}\frac{cos(2\pi\frac{j}{K}u)}{P\_{n}(\cos[\pi\frac{j}{K}])}\approx\int\_{0}^{1}\frac{cos(2\pi xu)}{P\_{n}(\cos[\pi x])}dx$$
Here $P\_{n}$ some polynomial
$u=1,2...K/2$


$\frac{1}{12k^2}f''(\psi)$ is a very bad estimator



trapezoidal rule  error approximation. What if f''(x)/12n^2  doesn't work? 
My first guess would be to use the Euler-Maclaurin summation formula ([Wikipedia article](http://en.wikipedia.org/wiki/Euler%E2%80%93Maclaurin_summation_formula)). This proves, amongst other things, that the error goes down exponentially if the integrand is a periodic function on [0,1].


**Added:** After thinking about it a bit more, I'm wondering about some things. Firstly, the formula given in the question is not the trapezoidal rule (as promised in the title and suggested by the result for the error), but it is the rectangle rule which is only first order. Secondly, if the integrand has poles in [0,1] (that is, if $P\_n(\cos(\pi x))=0$ for some $x\in[0,1]$), then the error estimate becomes meaningless; in this case you probably need different techniques like complex analysis to prove anything. A final remark: perhaps you can use the elementary techniques explained in: Weideman, "Numerical integration of periodic functions: a few examples", *Amer. Math. Monthly* **109** (2002), no. 1, 21-36 ([MathSciNet](http://www.ams.org/mathscinet-getitem?mr=1903510)).


I think I need some more background in order to have further help. In particular, do you know anything about the polynomials $P\_n$, and what kind of result do you hope to get?


