I'm trying to estimate the value of the following integral on the interval $[0,1]$
$$ I = \int_0^1 \frac{1}{1+x} dx $$
So, using the composite trapezoid rule (and with $n=4$, ie I'm only using the first 4 $x_i$ to do the approximation), I get the following expression:
$$ I = \frac{67}{60} - \frac{1}{96} (2(1+\xi_1)^{-3} + 2(1+\xi_2)^{-3} + 2(1+\xi_3)^{-3} + 2(1+\xi_4)^{-3}) $$
But I'm lost when it comes to calculating the error and finding a value for $\xi$. What's the general way of finding the error like this?
Formula I'm using
$$ I = \frac{h}{2} \sum_{i=1}^n [f(x_{i-1}) + f(x_i)] - \frac{h^3}{12} \sum_{i=1}^n f^{''}(\xi_i) $$
You have to find the upper bound of this error sum. Therefore you should take the maximum value of f'' on each subinterval (according to your formula). With $f(x)=\frac{1}{1+x}$, we got: $f''(x)=\frac{2}{(1+x)^3}$. The largest value of this function in the interval $[x_0,x_1]$ is $f''(x_0)$ , since $\ f''(x) \ $ is a decreasing function in [0,1]. For n=4, we got the intervals [0,0.25], [0.25,0.5] [0.5,0.75] [0.75,1] with corresponding maximum values for $f''(x)$ ,
$\ f''(0)=2, \ f''(0.25)=1.024, \ f''(0.5)=0.592 \ and \ f''(0.75)=0.373$. So an upper bound for your problem would be $\frac{h^3}{12} \sum_{i=1}^n |f^{''}(\xi_i)|=\frac{0.25^3}{12}(2+1.024+0.592+0.373)=0.005194$