\documentclass[12pt]{article}
\usepackage{fullpage,amsmath,amsfonts}

\newcommand{\x}{\boldsymbol{x}}
\renewcommand{\v}{\boldsymbol{v}}
\newcommand{\w}{\boldsymbol{w}}
\renewcommand{\r}{\boldsymbol{r}}
\renewcommand{\a}{\boldsymbol{a}}
\renewcommand{\b}{\boldsymbol{b}}
\renewcommand{\c}{\boldsymbol{c}}
\newcommand{\e}{\mathrm{e}}
\renewcommand{\d}{\mathrm{d}}
\renewcommand{\Re}{\operatorname{Re}}
\renewcommand{\Im}{\operatorname{Im}}
\newcommand{\Range}{\operatorname{Range}}
\newcommand{\Ker}{\operatorname{Ker}}
\newcommand{\Span}{\operatorname{Span}}
\renewcommand{\dim}{\operatorname{dim}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}

\def\nl{\vphantom\vdots\\}

\begin{document}

\title{Numerical Methods I}
\author{Problem Set 8}
\date{due in class, November 19, 2003}
\maketitle


\begin{enumerate}


\item (From SM.) A quadrature formula on the interval $[-1,1]$ uses
the quadrature points $x_0=-\alpha$ and $x_1=\alpha$, where
$0<\alpha\leq 1$:
\[
  \int_{-1}^1 f(x) \, \d x
  \approx w_0 \, f(-\alpha) + w_1 \, f(\alpha) \,.
\]
\begin{enumerate}
\item The formula is required to be exact whenever $f$ is a polynomial
of degree $1$.  Show that $w_0=w_1=1$, independent of the value of
$\alpha$.
\item Show that there is one particular value of $\alpha$ for which
the formula is exact for all polynomials of degree $2$.  Find this
$\alpha$, and show that, for this value, the formula is also exact for
all polynomials of degree $3$.
\end{enumerate}


\item Consider the composite trapezoidal rule for evaluating the
integral
\[
  \int_0^1 x^{1/3} \, \d x \,.
\]
\begin{enumerate}
\item Show, by explicit evaluation, that the local error on the
interval $[0,h]$ is proportional to $h^{4/3}$.

\item Show that the global error is also proportional to $h^{4/3}$.

Hint: Use part (a) on the first partition and one of the standard
error estimates on all other partitions.
\end{enumerate}

\item \textbf{Project:} Use the composite trapezoidal rule with $N$
partitions to approximate the integral of $f(x)=\sinh x$ and $g(x)=
\cosh x$ on the interval $[-1,1]$.  As in Lab~7, generate a doubly
logarithmic error plot.  Which of the functions is integrated more
accurately?

\item Explain the behavior seen in the previous question using the
Euler--Maclaurin summation formula.

\newpage

\item \textbf{Project:} Use Romberg integration to compute the
integral of
\begin{gather*}
  f(x) = \e^x \,, \\
  g(x) = \sin 2 \pi x \,, \\
  h(x) = x^{1/3} 
\end{gather*}
on the interval $[0,1]$.  Generate a doubly logarithmic error plot and
compare with the results from Lab~7.


\item (From SM.)  Show that the weights in the Gauss quadrature
formula can also be computed via
\[
  W_k = \int_a^b w(x) \, L_k(x) \, \d x \,.
\]

Recall: Gauss quadrature is based on the expression
\[
  \int_a^b w(x) \, f(x) \, \d x
  \approx
  \sum_{k=0}^n W_k \, f(x_k)
  + \sum_{k=0}^n V_k \, f'(x_k) \,,
\]
where
\begin{gather*}
  W_k = \int_a^b w(x) \, H_k (x) \, \d x \,, \\
  V_k = \int_a^b w(x) \, K_k (x) \, \d x \,,
\end{gather*}
and where $H_k$ and $K_k$ are the Hermite interpolation basis
polynomials, which can be written in terms of the Lagrange
interpolation basis polynomials $L_k$ as
\begin{align*}
  H_k(x) &= L_k^2(x) \, \bigl(1 - 2L_k'(x_k) \, (x-x_k) \bigr) \,, \\
  K_k(x) &= L_k^2(x) \, \, (x-x_k) \,.
\end{align*}
The Gauss quadrature points $x_0,\dots,x_n$ are chosen such that
$V_k=0$ for all $k=1,\dots,n$.
\end{enumerate}

\end{document}
