\documentclass[12pt, letterpaper]{article}

\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{setspace}
\usepackage{multicol}

\title{Homework 11}
\author{Menyoung Lee}
\geometry{margin=1in}
%\doublespacing

%\newcommand{\<}[0]{\Leftarrow}

\begin{document}
\maketitle
\subsection*{CP1}
\begin{multicols}{2}
\[f(x) = \sin{x} - \cos{x}\]
\[f'(x) = \cos{x} + \sin{x}\]
\[f(0) = \cos{0} + \sin{0}  = 1\]
\begin{tabular}{cc}
$h$ & $\frac{f(h)-f(-h)}{2h}-1$ \\
\hline
   0.10000000000000 & -0.00166583353172\\
   0.01000000000000 & -0.00001666658333\\
   0.00100000000000 & -0.00000016666662\\
   0.00010000000000 & -0.00000000166711\\
   0.00001000000000 & -0.00000000001565\\
   0.00000100000000 & -0.00000000002676\\
   0.00000010000000 & -0.00000000052636\\
   0.00000001000000 & -0.00000000052636\\
   0.00000000100000 &  0.00000002722922\\
   0.00000000010000 &  0.00000008274037\\
   0.00000000001000 &  0.00000008274037\\
   0.00000000000100 &  0.00003338943111\\
\end{tabular}
See the log-log plot, esp. at the larger values on h, it's clear that the convergence is quadratic.
(the blue line is the two-point difference formula, and it's plain that it has a linear convergence.)
In the error formula \[E(h) = \frac{h^2}{6}f'''(c) + \frac{\epsilon_{mach}}{h}\]
$M = |f'''(0)| = 1$, so that the $h$ that gives the minimum error is $(\frac{3\epsilon_{mach}}{M})^{1/3} = 6.7 \times 10^{-6} = 10^{-5}$,
while the $|E(h)| \leq \frac{10^{-10}}{6} + \frac{10^{-16}}{10^{-5}} = 2.7 \times 10^{-11}$, so within the bounds \& on the right order of magnitude.
\includegraphics[width = 3in]{hw11-1.jpg}
\end{multicols}

\subsection*{P11}
\[f(x-h) = f(x) - h f'(x) + \frac{h^2}{2}f''(x) - \frac{h^3}{6}f'''(x) + \dots\]
\[f(x+3h) = f(x) + 3h f'(x) + \frac{9h^2}{2}f''(x) - \frac{27h^3}{6}f'''(x) + \dots\]
\[f(x+3h) - 9f(x-h) = -8f(x) + 12h f'(x) - \frac{18h^3}{6}f'''(x) + \dots\]
\[f'(x) = \frac{f(x+3h) - 9f(x-h) + 8f(x)}{12h}.\]

\subsection*{CP5}
\begin{multicols}{2}
\[f(x) = \cos x,\] \[f'(x) = -\sin x\]
\[f''(x) = \cos x\] \[f''(0) = -1.\]
\begin{tabular}{cc}
$h$ & $\frac{f(-h)-2f(h)+f(h)}{h^2} + 1$ \\
\hline
   0.10000000000000 &  0.00083305560514\\
   0.01000000000000 &  0.00000833330527\\
   0.00100000000000 &  0.00000008334899\\
   0.00010000000000 &  0.00000000607747\\
   0.00001000000000 & -0.00000008274037\\
   0.00000100000000 & -0.00008890058234\\
   0.00000010000000 &  0.01190150808361\\
\end{tabular}
\par
See the log-log plot, esp. at the larger values on h, it's clear that the convergence is quadratic.
The minimum error appears at $h = 10^{-4}$, which is on the order of $\epsilon_{mach}^{1/4}$.
\includegraphics[width = 3in]{hw11-2.jpg}
\end{multicols}
\end{document}

