\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

{\bf Question}

Find, to 3 D.P., the error involved in estimating $\ds\int_0^4
\ds\frac{\,dx}{1+x}$ by using Simpson's rule with five ordinates.

\medskip

{\bf Answer}

First the actual value of the integral:
$$I=\ds\int_0^4\ds\frac{\,dx}{1+x}=[\ln(1+x)]_0^4=\ln
5=\un{1.609}\ \rm{to\ 3d.p.}$$

Simpson's rule with 5 ordinates $\Rightarrow$ 4 strips
$\Rightarrow h=\ds\frac{4-0}{4}=1$

Thus $y=\ds\frac{1}{1+x}$

\begin{tabular} {|c|c|c|c|c|c|}
\hline $x$ & 0 & 1 & 2 & 3 & 4\\ \hline $y$ & 1.000 & 0.500 &
0.333 & 0.250 & 0.200\\ \hline \end{tabular}

So

Area

$=\ds\frac{h}{3}(y_1+4y_2+2y_3+4y_4+y_5)$

$=\ds\frac{1}{3} \times
(\underbrace{1.000+0.200}+4(\underbrace{0.500+0.250})+2 \times
0.333)$

$ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ y_1+y_5 \ \ \ \ \ \ \ \ \ \
\ \ y_2+y_4 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ y_3$

\un{1.622} to 3d.p.

Thus error$=|1.609-1.622|=\un{0.013}$

\end{document}
