The other integral gives $$ \begin{equation*} \int_{x_0-h}^{x_0}f(x)dx=\frac{h}{2}\left(f(x_0) + f(x_0-h)\right)+O(h^3), \end{equation*} $$ and adding up we obtain $$ \begin{equation} \int_{x_0-h}^{x_0+h}f(x)dx=\frac{h}{2}\left(f(x_0+h) + 2f(x_0) + f(x_0-h)\right)+O(h^3), \tag{3} \end{equation} $$ which is the well-known trapezoidal rule. Concerning the error in the approximation made, \( O(h^3)=O((b-a)^3/N^3) \), you should note that this is the local error. Since we are splitting the integral from \( a \) to \( b \) in \( N \) pieces, we will have to perform approximately \( N \) such operations.