trapeze rule estimate error

Consider the integral $\displaystyle I=\int_a^bf(x)dx$

(a) Write the expression of the trapezoidal rule of integration for approximating I.

$\displaystyle \int_{a}^{b} f(x)\, dx \approx (b-a)\frac{f(a) + f(b)}{2}$

How do i find estimate of the error for this approximation in terms of h = (b − a).

(b) Write the formula for the composite application of the trapezoidal rule of integration. Use

n sub-intervals of integration. $\displaystyle \int_a^b f(x)\,dx \approx \frac{b-a}{n} \left[ {f(a) + f(b) \over 2} + \sum_{k=1}^{n-1} f \left( a+k \frac{b-a}{n} \right) \right]$ (c) Give an estimate for the total error associated with the composite integration formula of

Part(b). Give your estimate of the total error in terms of

h = (b − a)/n. Give also an estimate of the total error in terms of the number n of intervals.

Thanks for your help.