\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

{\bf Question} Calculate $\ds\int_1^4 \log_{10} x \,dx$ to 4 S.F.
using

\begin{description}
\item[(i)]
the trapezium rule with seven ordinates,
\item[(ii)]
Simpson's rule with seven ordinates.
\end{description}


\medskip

{\bf Answer}
\begin{description}
\item[(i)]
Trapezium rule with 7 ordinates.

Area $\approx \ds\frac{d}{2}(y_1+2y_2+2y_3+2y_4+2y_5+2y_6+y_7)$

Divide range into 6 equal segments $\Rightarrow
d=\ds\frac{(4-1)}{6}=\ds\frac{1}{2}=0.5$

$y=\log_{10} x$

\begin{tabular} {|c|c|c|c|c|c|c|c|}
\hline $x$ & 1 & 1.5 & 2.0 & 2.5 & 3.0 & 3.5 & 4.0\\ \hline $y$ &
0.000 & 0.1761 & 0.3010 & 0.3979 & 0.4771 & 0.5441 & 0.6021\\
\hline
\end{tabular}



$\begin{array} {rcl} \rm{Area} & = &
\ds\frac{0.5}{2}(\underbrace{0.000+0.6021}\\ & &
\hspace{.7in}y_1+y_7\\ & &
+2\underbrace{(0.1761+0.3010+0.3979+0.4771+0.5441)})\\ & &
\hspace{1in} y_2+y_3+y_4+y_5+y_6\\ & = & \un{1.0986 = 1.099
\rm{to\ 4s.f.}}\end{array}$

\item[(ii)]
Simpson's rule with 7 ordinates

Area $=\ds\frac{h}{3}(y_1+4y_2+2y_3+4y_4+2y_5+4y_6+y_7)$

Again divide into 6 equal segments $\Rightarrow h=0.5$ again and
the $x$ and $y$ values are identical to part (i), so we have



$\begin{array} {rcl} \rm{Area} & = &
\ds\frac{0.5}{3}(\underbrace{0.000+0.6021}+4(\underbrace{0.1761+0.3979+0.5441})
\\ & & \ \ \ \ \ \ \ \ \ \ \ \ \ y_1+y_7 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ y_2+y_4+y_6
\\ & & +2(\underbrace{0.3010+0.4771}))\\ & &
\ \ \ \ \ \ \ \ \ \ \ y_3+y_5\\ & = & \un{1.10512 = 1.105 \rm{to\
4s.f.}} \end{array}$

[Actual value $=\ds\frac{1}{\ln 10}+\ds\frac{4(\ln 4-1)}{\ln
10}=1.105 \rm{to\ 4s.f.}$]

So Simpson's rule is more accurate.
\end{description}
\end{document}
