29-06-2024

Problem: Compute the integral \[ \int _0^x \frac{1}{1 + x}\mathrm{d} x \] correct up to three significant figures taking six intervals by Trapezoidal rule.
Solution: We recall that the Trapezoidal rule is given by \[ \int _a^b f(x) \mathrm{d} x = \frac{h}{2}\left[ (y_0 + y_n) + 2 (y_1 + y_2 + \cdots + y_{n-1} ) \right], \] where \[ x_n - x_{n-1} = h \text{ and } y_n = f(x_n). \] Here in the given problem, \[ a = 0,\quad b = 1, \quad \text{and}\quad n = 6. \] So, \[ h = \frac{b-a}{n} = \frac{1}{6}. \]

Therefore, we have \begin{align*} x_0 = 0 & \implies y_0 = f(x_0) = f(0) = 1 \\ x_1 = x_0 + h = \frac{1}{6} & \implies y_1 = f(x_1) = 0.14286 \\ x_2 = x_1 + h = \frac{2}{6} & \implies y_2 = f(x_2) = 0.25000 \\ x_3 = x_2 + h = \frac{3}{6} & \implies y_3 = f(x_3) = 0.33333 \\ x_4 = x_3 + h = \frac{4}{6} & \implies y_4 = f(x_4) = 0.40000 \\ x_5 = x_4 + h = \frac{5}{6} & \implies y_5 = f(x_5) = 0.45454 \\ x_6 = x_5 + h = 1 & \implies y_6 = f(x_6) = 0.50000. \end{align*} Thus, by the Trapezoidal rule, we have \begin{align*} I & = \frac{h}{2} \left[ (y_0 + y_6) + 2 (y_1 + y_2 + y_3 + y_4 + y_5)\right] \\ & = 0.30512. \end{align*} Thus, \[ \textcolor{teal}{\boxed{I = 0.305 \text{ correct up to three significant figures}}} \]