\documentclass[twoside]{article}

\usepackage{palatino}
\usepackage{camnum}

\textheight=22.5cm
\textwidth=15cm
\topmargin=-1cm
\oddsidemargin=0.5cm
\evensidemargin=0.5cm
\parindent=0pt
\parskip=6pt

\begin{document}
\begin{center}
  {\large \textbf{Mathematical Tripos Part IB: Easter 2001}}

  {\Large \textbf{Numerical Analysis -- Detailed Example
      12\footnote{Corrections and suggestions to these notes should
        be emailed to \texttt{a.shadrin@damtp.cam.ac.uk}. All handouts
        are available on the WWW at the URL 
        \texttt{http://www.damtp.cam.ac.uk/user/na/PartIB/Handouts.html}.}}}

  \vspace{8pt}
  \textbf{\textit{\LARGE Gaussian quadrature}}
\end{center}

We wish to integrate
\begin{displaymath}
  \int_0^\infty \CC{e}^{-x} \sin x \CC{d}x=\Frac12
\end{displaymath}
numerically. To this end we set
\begin{displaymath}
  \langle f,g\rangle=\int_0^\infty \CC{e}^{-x}f(x)g(x)\CC{d}x
\end{displaymath}
and derive the underlying orthogonal polynomials (the are called {\em
  Laguerre polynomials\/}). The explicit formula is
\begin{displaymath}
  L_n(x)=\sum_{k=0}^n (-1)^{n-k} {n\choose k}\frac{x^k}{k!},\qquad n\geq0
\end{displaymath}
(in this formulation they aren't monic -- if you {\em must,\/} replace
$L_n$ by $n!L_n$). Hence, for example,
\begin{displaymath}
  L_4(x)=\Frac{1}{24}x^4-\Frac23 x^3+3x^2-4x+1,
\end{displaymath}
with the (approximate) zeros
\begin{displaymath}
  c_1=0.32254768,\qquad c_2=1.74576110, \qquad c_3=4.53662029,\qquad
  c_4=9.39507091. 
\end{displaymath}
These will be the nodes of our quadrature. To derive the weights, we
can use the explicit formula from the lecture, 
\begin{displaymath}
  b_k=\int_0^\infty \CC{e}^{-x} \prod_{\stackrel{\scriptstyle
  j=1}{j\neq k}}^4 \frac{x-c_j}{c_k-c_j}\CC{d}x,\qquad k=1,2,3,4
\end{displaymath}
or, equivalently, solve the linear system
\begin{displaymath}
  \sum_{l=1}^4 c_l^{k-1} b_l=\int_0^\infty \CC{e}^{-x} x^{k-1}\CC{d}x
  =(k-1)!,\qquad k=1,2,3,4
\end{displaymath}
(can you prove this?). The outcome is
\begin{displaymath}
  b_1=0.60315410,\qquad b_2=0.35741869, \qquad b_3=0.03888791,\qquad
  b_4=0.00053929.
\end{displaymath}
The quadrature formula is thus
\begin{displaymath}
  \sum_{k=1}^4 b_k \sin c_k\approx 0.50487928.
\end{displaymath}
(As a matter of interest, choosing 8 quadrature points gives the
answer $0.49998775373530$.)

\end{document}
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
