\documentclass[11pt]{article}
\usepackage{amssymb}
\usepackage{epsfig}

\pagestyle{empty}
\setlength{\textwidth}{6.5in} 
\setlength{\textheight}{9in} 
\setlength{\headheight}{0in} 
\setlength{\evensidemargin}{0in}
\setlength{\oddsidemargin}{0in}
\setlength{\topmargin}{0in}
\input{/home/jeff/tex/shortcuts.tex}

\begin{document}
\begin{center}
{\bf Solutions to Homework 8}
\end{center}
\vspace*{.3in}

\noindent{\bf Supplementary problem 1.}
Let $\epsilon > 0$ be given. Proving that the conclusion holds is equivalent
to constructing a partition $P$ of $[a,b]$ for which 
$$
U(P,f) - L(P,f) < \epsilon.
$$
Let $M$ be an upper bound for $|f|$ on $[a,b]$.
By hypothesis we can find mutually disjoint open intervals 
$I_j$, $j=1,\dots,n$ covering the set $S$ of discontinuities of $f$ such
that 
$$
|I_1| + \dots + |I_n| < \epsilon/2M
$$
Let us write $I_j = (a_j,b_j)$.  By putting the intervals in order (and
intersecting them with $[a,b]$, if necessary)
we can suppose that 
$$
a\leq a_1 < b_1 \leq a_2 < b_2\leq \dots \leq a_n < b_n\leq b.
$$
so that $Q = \{a,a_1,b_1,\dots,a_n,b_n,b\}$ is a (not very well labeled!)
partition of $[a,b]$.  

For convenience, let us define $b_0 = a$, $a_{n+1} = b$.
Then the condition $S\subset I_1\cup\dots\cup I_n$ means that $f$ is 
continuous on the closed intervals $[b_j,a_{j+1}]$ for $0\leq j\leq n$.
Therefore $f$ is integrable on each of these intervals, and we can choose 
a partition $P_j$ of $[b_j,a_{j+1}]$ such that 
$$
U(P_j,f) - L(P_j,f) < \frac{\epsilon}{2(n+1)}.
$$
Now we define our partition $P$ to be the union of the $P_j$, $j=1,\dots,n$
(note in particular that $Q\subset P$, since every point in $Q$ is the endpoint
of one the partitions $P_j$).  Then using the upper bound $M$ for $|f|$
chosen above, we can estimate
\begin{eqnarray*}
U(P,f) & \leq & U(P_0,f) + M(b_1-a_1) + U(P_1,f) + M(b_2-a_2) + \dots
	+ M(b_n - a_n) + U(P_n,f) \\
L(P,f) & \geq & L(P_0,f) - M(b_1-a_1) + L(P_1,f) - M(b_2-a_2) + \dots
	- M(b_n - a_n) + L(P_n,f).
\end{eqnarray*}
Therefore
$$
U(P,f) - L(P,f) \leq \sum_{j=0}^n U(P_j,f) - L(P_j,f) + 
	2M \sum_{k=1}^n (b_k-a_k) < (n+1)\frac{\epsilon}{2n+1} + 
	2M\frac{\epsilon}{4M} = \epsilon.
$$
\qed

\noindent{\bf Supplementary problem 2.}
Given $\epsilon>0$, we again seek to construct a partition $P$ of $[0,1]$ 
satisfying
$$
U(P,f) - L(P,f) < \epsilon.
$$

This time, however, we let 
$$
S = \{x\in[0,1]: f(x) \geq \epsilon/2\}. 
$$
I claim that there are only finitely many points in $S$.  Indeed any
$x\in S$ is rational, and can be written $x = p/q$ where $\gcd(p,q) = 1$
and $q\leq 2/\epsilon$ (since $f(x) = 1/q$).  So if $N\in\N$ exceeds 
$2/\epsilon$, then the denominator $q$ is $x$ can only range from $1$ to $N$.
Moreover, for fixed denominator $q$, the numerator of $x$ must range between
$0$ and $q$.  So all told, $S$ contains at most 
$\sum_{q=1}^N (q+1) = (q+1)(q+2)/2$ elements.

Clearly then, we can cover $S$ with disjoint open intervals $I_j = (a_j,b_j)$,
$j=1,\dots,n:=\#S$ such that $\sum_{j=1}^nb_j-a_j < \epsilon/2$.  Putting the 
intervals in order and intersecting them with $[0,1]$ we obtain a partition $P$
of $[0,1]$ consisting of the points
$$
a = a_1 < b_1 \leq a_2 < b_2 \leq \dots \leq a_n < b_n=b.
$$
Since $0\leq f(x)\leq 1$ for all $x$, we have
$$
0 \leq L(P,f) \leq U(p,f) \leq \sum_{j=1}^n 1(b_j - a_j) + 
	\sum_{j=1}^{n-1} \epsilon/2 (a_{j+1} - b_j).
$$
The first sum is equal to the sum of the lengths of the intervals $I_j$ and
the second is no larger than $\epsilon/2$ times the length of the full
interval $[0,1]$.  Hence
$$
U(P,f) - L(P,f) < \epsilon
$$
and we conclude that $f$ is integrable.
\qed

\vspace*{.2in}
\noindent{\bf Supplementary problem 3.}

\vspace*{.1in}
\noindent{\bf Part a.} 
Let $P = \{n,n+1,\dots,m,m+1\}$ be the partition of $[n,m+1]$ by integers.
Then since $f$ is decreasing, we have $a_k = \sup\{f(x):x\in[k,k+1]\}$,
and
$$
\int_n^{m+1} f(x)\,dx\leq U(P,f) = \sum_{k=n}^m a_k.
$$
Similarly, using the partition $P = \{n-1,n,\dots,m\}$ of $[n-1,m]$ we obtain
$$
\int_{n-1}^m f(x)\,dx \geq L(P,f) = \sum_{k=n}^m a_k.
$$

\vspace*{.1in}
\noindent{\bf Part b.} 
Since the series consists of non-negative terms, it's enough to show
that the partial sums $s_n$ are bounded above uniformly in $n$.  The
function $f(x) = 1/x(\log x)^2$ is non-negative and decreasing, and 
$a_n = f(n)$ for all $n\in\N$, so we can use the previous item to estimate
$$
s_n = a_2 + \sum_{k=3}^n a_k \leq \int_2^n \frac{1}{x(\log x)^2}\,dx
	= a_2 + \frac{1}{\log 2} - \frac{1}{\log n} \leq a_2 + \frac{1}{\log 2}
$$
for all $n\in\N$.  Since the right side is independent of $n$, the series
converges.

\vspace*{.1in}
\noindent{\bf Part c.} 
The difference between the full series $s$ and a given partial sum $s_n$ 
can be estimated as follows.
$$
s - s_n = \lim_{m\to\infty} s_m - s_n \leq \lim_{n\to\infty} 
	\int_{n-1}^m f(x)\,dx = \frac{1}{\log (n-1)}.
$$
So for $s_n$ to approximate $s$ to within $.01$ it is sufficient that
$1/\log(n-1) < .01$.  That is, we need
$$
n\geq 1 + e^100 \approx 2.68812 \times 10^{43}.
$$
Assuming we had a computer capable of evaluating and adding a trillion terms a 
second, we'd have to wait about
$$
2.68812\times 10^{31} \mathrm{ seconds } \approx 3.11125\times 10^{26} 
	\mathrm{ days } \approx 8.5 \times 10^{23} \mathrm{ years}
$$
to find out what the partial sum is.  But really, these days, who's got a 
mole of years to kill anyhow?  

\vspace*{.1in}
\noindent{\bf Part d.} 
The first part of this problem also gives us that
$$
s - s_n = \lim_{m\to\infty} s_m - s_n \geq \lim_{n\to\infty} 
	\int_{n}^{m+1} f(x)\,dx = \frac{1}{\log n}.
$$
So to summarize, we have
$$
s_n + \frac{1}{\log n} \leq s \leq s_n + \frac{1}{\log(n-1)}.
$$
This means that if we choose $n$ large enough that
$$
\frac{1}{\log(n-1)} - \frac{1}{\log n} < .01
$$
we can compute $s_n$ exactly and then replace the sum of the remaining terms
by $1/\log n$, knowing that this will be skewing the result by no more than
$.01$.  We could determine our $n$ by trial and error, but with the mean
value theorem we can do better.  That is, the derivative of the function
$1/\log x$ is $-1/x(\log x)^2$ (why is this not a surprise?), so the mean
value theorem gives us a number $c$ between $n-1$ and $n$ such that
$$
\frac{1}{\log(n-1)} - \frac{1}{\log n} = 1\cdot \frac{1}{c(\log c)^2}
	\leq \frac{1}{n(\log n)^2},
$$
and the latter quantity will certainly be less than $.01$ when $n=100$.
In fact, since $\log 25 > 2$, we can even see that $n = 25$ will suffice.
A little further playing around with a calculator reveals that 
$15$ is the largest value of $n$ for which $1/n(\log n)^2 < .01$.  So
with the help of mathematica, I now estimate
$$
2.114 < \frac{1}{\log 15} + \sum_{k=2}^{15} \frac{1}{k(\log k)^2} \leq 
	\sum_{k=2}^\infty \frac{1}{k(\log k)^2} \leq
\frac{1}{\log 14} + \sum_{k=2}^{15} \frac{1}{k(\log k)^2} < 2.124
$$

\vspace*{.2in}
\noindent{\bf Solution to \#7 on Page 138.}
\vspace*{.1in}
\noindent{\bf Part a.} 
If $f$ is already integrable on $[0,1]$, then by definition $f$ is bounded.
Let $M\in\R$ be an upper bound for $|f|$ on $[0,1]$.  Then by Theorem 6.12
parts (c) and (d), we have for $c\in[0,1]$ that
$$
\left|\int_0^1 f(x)\,dx - \int_c^1 f(x)\,dx\right|
=
\left|\int_0^c f(x)\,dx\right| \leq Mc.
$$
So if $\epsilon > 0$ is given and $0<c<\delta := \epsilon/M$, we have
$$
\left|\int_0^1 f(x)\,dx - \int_c^1 f(x)\,dx\right| < M\delta = \epsilon.
$$
Thus
$$
\lim_{c\to 0} \int_c^1 f(x)\,dx = \int_0^1 f(x)\,dx.
$$
In other words, the two definitions of integral for $f$ coincide. \qed


\vspace*{.1in}
\noindent{\bf Part b.}
Consider the function $f:[0,1]\to\R$ defined as follows.  For each $n\in\Z^+$
and $x\in (1/(n+1),1/n]$, we set $f(x) = n$ if $n$ is even and $-n$ if
$n$ is odd.  Then
$$
\lim_{c\to 0} \int_c^1 |f(x)|\,dx =  
	\sum_{n=1}^\infty n\left(\frac{1}{n} - \frac{1}{n+1}\right)
	= \sum_{n=1}^\infty \frac{1}{n+1} 
$$
which diverges, but
$$
\lim_{c\to 0} \int_c^1 f(x)\,dx =  
	\sum_{n=1}^\infty (-1)^n n\left(\frac{1}{n} - \frac{1}{n+1}\right)
	= \sum_{n=1}^\infty \frac{(-1)^n}{n+1} 
$$
which converges.

\end{document}
\end
