# Appendix C. Solutions to exercises

Each problem is repeated before its solution, in the order of the exercises in the main text. Each exercise number links back to the original exercise. The italic link at the end of that exercise returns to its entry here. Entries without a supplied solution are marked *Awaiting solution.*

## C.1 Sets and foundations of real analysis

### Exercise 1.1.1

Let $\{A_\gamma \mid \gamma \in \Gamma\}$ be a collection of sets. Prove De Morgan’s laws

$$
\begin{aligned}
      \left(\bigcup_{\gamma\in\Gamma} A_\gamma\right)^c
        &= \bigcap_{\gamma\in\Gamma} A_\gamma^c,\\
      \left(\bigcap_{\gamma\in\Gamma} A_\gamma\right)^c
        &= \bigcup_{\gamma\in\Gamma} A_\gamma^c.
    \end{aligned}
$$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:de-morgan)

*Solution.* [^57] Fix a set $S$ such that $A_\gamma\subseteq S$ for every $\gamma\in\Gamma$. All complements in this proof are taken relative to $S$, so

$$
A_\gamma^c=S\setminus A_\gamma.
$$

Suppose first that $\Gamma$ is nonempty. We prove each identity by showing both inclusions.

[![The upper shaded region lies outside both sets. In the lower panel, only the overlap is excluded. All complements are taken within the rectangle S.](https://xyzmaths.org/notes/maths-analysis/figures/de-morgan.svg)](https://xyzmaths.org/notes/maths-analysis/figures/de-morgan.svg "Open original SVG")

Figure C.1. The upper shaded region lies outside both sets. In the lower panel, only the overlap is excluded. All complements are taken within the rectangle $S$.

*The complement of the union.* Suppose that

$$
x\in\left(\bigcup_{\gamma\in\Gamma}A_\gamma\right)^c.
$$

Then $x\in S$ and $x$ does not belong to the union. If $x$ belonged to any $A_\gamma$, it would belong to the union. Therefore $x\notin A_\gamma$ for every $\gamma\in\Gamma$. Since $x\in S$, this gives $x\in A_\gamma^c$ for every $\gamma$, and hence

$$
x\in\bigcap_{\gamma\in\Gamma}A_\gamma^c.
$$

Conversely, suppose that

$$
x\in\bigcap_{\gamma\in\Gamma}A_\gamma^c.
$$

Then $x\in S$ and $x\notin A_\gamma$ for every $\gamma\in\Gamma$. Thus no member of the family contains $x$, so $x$ does not belong to their union. Consequently,

$$
x\in\left(\bigcup_{\gamma\in\Gamma}A_\gamma\right)^c.
$$

Both inclusions hold, proving the first equality.

*The complement of the intersection.* Suppose that

$$
x\in\left(\bigcap_{\gamma\in\Gamma}A_\gamma\right)^c.
$$

Then $x\in S$ and $x$ does not belong to the intersection. There must be an index $\gamma_0\in\Gamma$ for which $x\notin A_{\gamma_0}$. Otherwise, $x$ would belong to every $A_\gamma$ and therefore to their intersection. Thus $x\in A_{\gamma_0}^c$, which gives

$$
x\in\bigcup_{\gamma\in\Gamma}A_\gamma^c.
$$

Conversely, suppose that

$$
x\in\bigcup_{\gamma\in\Gamma}A_\gamma^c.
$$

Then $x\in A_{\gamma_0}^c$ for at least one index $\gamma_0$. Hence $x\in S$ and $x\notin A_{\gamma_0}$. Since $x$ fails to belong to this member of the family, it cannot belong to the intersection. Thus

$$
x\in\left(\bigcap_{\gamma\in\Gamma}A_\gamma\right)^c.
$$

Both inclusions hold, proving the second equality.

If $\Gamma$ is empty, we use the relative conventions

$$
\begin{aligned}
    \bigcup_{\gamma\in\varnothing}A_\gamma&=\varnothing,\\
    \bigcap_{\gamma\in\varnothing}A_\gamma&=S.
  \end{aligned}
$$

Both identities then follow from $\varnothing^c=S$ and $S^c=\varnothing$.

[Figure C.1](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw01:de-morgan) illustrates the difference for two sets. An element outside their intersection may still belong to one of the sets. It simply cannot belong to both. ◻

[^57]: To prove $A=B$, prove both inclusions. Start with an arbitrary $x\in A$ and show $x\in B$. Then start with an arbitrary $x\in B$ and show $x\in A$. No separate choice of a universe is needed unless complements are involved.

### Exercise 1.1.6

Let $A_n$ be a set such that $|A_n|=\aleph_0$ for $n=1,2,\ldots$. Prove $|A|=\aleph_0$ where

$$
A=\bigcup_{n=1}^{\infty} A_n.
$$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:countable-union)

*Solution.* Since each $A_n$ is countably infinite, there exists a bijection from $\mathbb{N}$ to $A_n$. Using the axiom of countable choice, select one such bijection for each $n$. This gives a list without repetition within each row, which we write as

$$
A_n=\{a_{n,1},a_{n,2},a_{n,3},\ldots\}.
$$

Put these lists into rows. Reading one whole row first would never reach the next row. Instead, follow successive diagonals $n+m=2,3,\ldots$, alternating direction as in [Figure C.2](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw01:diagonal-enumeration). This gives

$$
a_{1,1},\ a_{1,2},\ a_{2,1},\ a_{3,1},
  \ a_{2,2},\ a_{1,3},\ a_{1,4},\ldots.
$$

[![Follow the arrows along diagonals of constant n+m. Every entry is reached after finitely many steps.](https://xyzmaths.org/notes/maths-analysis/figures/diagonal-enumeration.svg)](https://xyzmaths.org/notes/maths-analysis/figures/diagonal-enumeration.svg "Open original SVG")

Figure C.2. Follow the arrows along diagonals of constant $n+m$. Every entry is reached after finitely many steps.

Each diagonal is finite, and each $a_{n,m}$ has only finitely many diagonals before its own. Hence every entry is eventually reached. Every element of $A$ occurs in some row, so this sequence contains all of $A$.

The sets may overlap. Skip any value already listed, keeping only its first occurrence. Every element has a first occurrence at a finite position, so none is lost by this procedure. The retained list contains each element of $A$ exactly once. Since $A_1\subseteq A$ is infinite, the retained list is also infinite. Numbering its entries in order gives a bijection from $\mathbb{N}$ to $A$. Therefore

$$
|A|=\aleph_0.
$$

 ◻

### Exercise 1.3.1

List all the elements in the set $\mathcal{P}(\mathcal{P}(\varnothing))$ and verify the cardinality formula.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:power-set)

*Solution.* The power set is the set of all subsets. The empty set has exactly one subset, itself, so

$$
\mathcal{P}(\varnothing)=\{\varnothing\}.
$$

Taking the power set once more gives

$$
\mathcal{P}(\mathcal{P}(\varnothing))
    =\{\varnothing,\{\varnothing\}\}.
$$

Its elements are the empty set and the singleton containing the empty set. These are distinct. Since $|\mathcal{P}(\varnothing)|=1$, the cardinality formula gives

$$
|\mathcal{P}(\mathcal{P}(\varnothing))|
    =2^{|\mathcal{P}(\varnothing)|}=2^1=2.
$$

 ◻

### Exercise 1.3.7

Obtain a bijective map from $(0,1)$ to $\mathbb{R}$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:interval-to-reals)

*Solution.* A map from $A$ to $B$ is a bijection if it is both one-to-one and onto. This means that every element of $B$ is the image of exactly one element of $A$. [Figure C.3](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw01:bijections) contrasts bijections with a map that fails both conditions.

[![The first two maps are bijections. The third map is neither one-to-one nor onto. Crossing arrows do not prevent a map from being bijective.](https://xyzmaths.org/notes/maths-analysis/figures/bijections.svg)](https://xyzmaths.org/notes/maths-analysis/figures/bijections.svg "Open original SVG")

Figure C.3. The first two maps are bijections. The third map is neither one-to-one nor onto. Crossing arrows do not prevent a map from being bijective.

The tangent function is a bijection from $(-\pi/2,\pi/2)$ onto $\mathbb{R}$. To use it on $(0,1)$, we first multiply the input by $\pi$ and then subtract $\pi/2$. These steps give the composition

$$
(0,1)\xrightarrow{\,\times\pi\,}(0,\pi)
    \xrightarrow{\,-\pi/2\,}
    \left(-\frac\pi2,\frac\pi2\right)
    \xrightarrow{\,\tan\,}\mathbb{R}.
$$

We can therefore define

$$
f(x)=\tan\left(\pi x-\frac\pi2\right),
    \qquad 0<x<1.
$$

For $0<x<1$, the angle $\pi x-\pi/2$ lies strictly between $-\pi/2$ and $\pi/2$, so $f(x)$ is defined and real. We verify bijectivity by giving its inverse. For $y\in\mathbb{R}$, put

$$
g(y)=\frac12+\frac{\arctan y}{\pi}.
$$

Here $\arctan y$ is the unique angle in $(-\pi/2,\pi/2)$ whose tangent is $y$. Thus $0<g(y)<1$, and

$$
f(g(y))=\tan(\arctan y)=y.
$$

This proves that $f$ is onto. Conversely, for $x\in(0,1)$, the angle lies in the principal interval, so

$$
g(f(x))=\frac12+
    \frac{\arctan(\tan(\pi x-\pi/2))}{\pi}=x.
$$

If $f(x_1)=f(x_2)$, applying $g$ gives $x_1=x_2$. Therefore $f$ is also one-to-one and hence is a bijection.

[Figure C.4](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw01:tangent-overview) shows the central branch of $y=\tan t$ in blue and the transformed graph alongside it. The horizontal change $x=t/\pi+1/2$ compresses that branch by a factor of $1/\pi$ and shifts it to the right by $1/2$. Its domain becomes $(0,1)$, while its range remains all of $\mathbb{R}$.

[![The left panel highlights the central tangent branch on (-\\pi/2,\\pi/2). The right panel shows this branch after the change of input. The vertical asymptotes now occur at x=0 and x=1. The horizontal axes use different scales.](https://xyzmaths.org/notes/maths-analysis/figures/tangent-overview.svg)](https://xyzmaths.org/notes/maths-analysis/figures/tangent-overview.svg "Open original SVG")

Figure C.4. The left panel highlights the central tangent branch on $(-\pi/2,\pi/2)$. The right panel shows this branch after the change of input. The vertical asymptotes now occur at $x=0$ and $x=1$. The horizontal axes use different scales.

 ◻

### Exercise 1.3.9

Obtain a bijective map from $(0,1)$ to $[0,1]$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:open-to-closed-interval)

*Solution.* The identity $f(x)=x$ maps $(0,1)$ to itself, but it misses the endpoints of $[0,1]$, as shown in [Figure C.5](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw01:identity-map). We can make room for them by moving a countable sequence of points.

First assign

$$
f\left(\frac12\right)=0,
  \qquad f\left(\frac13\right)=1.
$$

[![The identity on (0,1) misses the target values 0 and 1. Both endpoints of the graph are excluded.](https://xyzmaths.org/notes/maths-analysis/figures/identity-map.svg)](https://xyzmaths.org/notes/maths-analysis/figures/identity-map.svg "Open original SVG")

Figure C.5. The identity on $(0,1)$ misses the target values $0$ and $1$. Both endpoints of the graph are excluded.

The values $1/2$ and $1/3$ must now be supplied by other inputs. We use $1/4$ and $1/5$ for these values, and then continue shifting the reciprocals to fill the resulting gaps. This gives

$$
f\left(\frac14\right)=\frac12,\quad
  f\left(\frac15\right)=\frac13,\quad
  f\left(\frac16\right)=\frac14,\quad\ldots
$$

[Figure C.6](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw01:reciprocal-shift) illustrates this shift. We leave all other points fixed. Define a map $f$ from $(0,1)$ to $[0,1]$ by

$$
f(x)=
  \begin{cases}
    0, & x=\frac12,\\[2pt]
    1, & x=\frac13,\\[2pt]
    \dfrac1{n-2}, & x=\frac1n,\quad n\in\mathbb{N},\ n\ge4,\\[4pt]
    x, & \text{otherwise}.
  \end{cases}
$$

[![The reciprocal sequence is shifted to accommodate both endpoints. Every point outside this sequence remains fixed.](https://xyzmaths.org/notes/maths-analysis/figures/reciprocal-shift.svg)](https://xyzmaths.org/notes/maths-analysis/figures/reciprocal-shift.svg "Open original SVG")

Figure C.6. The reciprocal sequence is shifted to accommodate both endpoints. Every point outside this sequence remains fixed.

To check bijectivity, put

$$
S=\left\{\frac1n\mid n\in\mathbb{N},\ n\ge2\right\}.
$$

The cases in the definition are disjoint and cover $(0,1)$. Every output lies in $[0,1]$, so the function is well-defined.

Among the inputs in $S$, only $1/2$ maps to $0$, and only $1/3$ maps to $1$. For each integer $m\ge2$, solving $1/(n-2)=1/m$ gives the unique input $1/(m+2)$. Thus $f$ maps $S$ bijectively onto $S\cup\{0,1\}$.

On $(0,1)\setminus S$, the map is the identity, with image $(0,1)\setminus S$. This image is disjoint from $S\cup\{0,1\}$, so no fixed point can give a second preimage for a value already supplied by the reciprocal sequence. Together the two images cover $[0,1]$. Every target value therefore has exactly one preimage, proving that $f$ is a bijection. ◻

### Exercise 1.3.10

Show that

$$
|(0,1)\times(0,1)|=|(0,1)|=\aleph.
$$

(*Corrected hint.* For each number in $(0,1)$, choose the decimal expansion that is not eventually all $9$s. We can then write

$$
x\in(0,1),\quad x=0.x_1x_2\cdots,\quad
    x_i\in\{0,\ldots,9\},\quad i=1,2,\ldots.
$$

Then define a map from $(0,1)\times(0,1)$ to $(0,1)$ by

$$
(x,y)=(0.x_1x_2\cdots,0.y_1y_2\cdots)
    \mapsto (0.x_1y_1x_2y_2\ldots)=z\in(0,1).
$$

Show that this map is injective, then use injections in both directions.)

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:square-cardinality)

*Solution.* Put $I=(0,1)$. For each number in $I$, we choose the unique decimal expansion that is not eventually all $9$s. For example, we write one half as $0.5000\ldots$ instead of $0.4999\ldots$. Each digit may be any of $0,1,\ldots,9$.

For $x=0.x_1x_2\ldots$ and $y=0.y_1y_2\ldots$, define

$$
F(x,y)=0.x_1y_1x_2y_2\ldots.
$$

[Figure C.7](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw01:decimal-interleaving) shows how the odd positions record $x$ and the even positions record $y$.

[![Interleaving keeps both digit sequences. Read the odd positions to recover x, and the even positions to recover y.](https://xyzmaths.org/notes/maths-analysis/figures/decimal-interleaving.svg)](https://xyzmaths.org/notes/maths-analysis/figures/decimal-interleaving.svg "Open original SVG")

Figure C.7. Interleaving keeps both digit sequences. Read the odd positions to recover $x$, and the even positions to recover $y$.

We first check that this construction gives a number in $I$. The output digits cannot be eventually all $9$s. Otherwise, both input expansions would also be eventually all $9$s, contradicting our choice of decimal expansions.

Since $x>0$, at least one of its digits is nonzero. This digit occurs in an odd position of the output, so $F(x,y)>0$. The output is less than $1$ because its digits are not all $9$s. Therefore $F(x,y)\in I$, and its displayed decimal expansion follows our convention.

If $F(x,y)=F(u,v)$, uniqueness of the digits gives $x_j=u_j$ and $y_j=v_j$ for every $j$. Hence $x=u$ and $y=v$, so $F$ is one-to-one.

However, $F$ is not onto, despite the claim in the original hint. To see this, consider $z=0.101010\ldots\in I$. If $F(x,y)=z$, the even digits would force $y=0.000\ldots=0$. This is impossible because $0\notin I$, so $z$ has no preimage.

We therefore use an injection in the reverse direction as well. Define a map $G$ from $I$ to $I\times I$ by

$$
G(t)=\left(t,\frac12\right).
$$

Both coordinates lie in $I$, so the map is well-defined. If $G(t)=G(s)$, equality of the first coordinates gives $t=s$. Hence $G$ is one-to-one.

The Cantor–Schröder–Bernstein theorem says that injections in both directions imply the existence of a bijection. Applying it to $F$ and $G$ gives $|I\times I|=|I|$. By [Exercise 1.3.7](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:interval-to-reals), $|I|=|\mathbb{R}|=\aleph$. Therefore

$$
|(0,1)\times(0,1)|=|(0,1)|=\aleph.
$$

 ◻

### Exercise 1.3.12

Let $\aleph_0$ and $\aleph$ denote the cardinalities of $\mathbb{N}$ and $\mathbb{R}$ respectively. Recall that the Continuum Hypothesis (CH) states that there is no cardinality between $\aleph_0$ and $\aleph$. Use CH to prove that the set of transcendental numbers, $\mathbb{T}$, has the same cardinality $\aleph$ as that of $\mathbb{R}$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:transcendental-cardinality)

*Solution.* Let $\mathbb{A}$ be the set of real algebraic numbers and $\mathbb{T}$ the set of real transcendental numbers. An algebraic number is a root of a nonzero polynomial with integer coefficients. A transcendental number is not such a root. Hence

$$
\mathbb{R}=\mathbb{A}\cup\mathbb{T},
  \qquad\mathbb{A}\cap\mathbb{T}=\varnothing.
$$

First, we show that $\mathbb{A}$ is countable. For each $n\ge1$, consider the nonzero polynomials

$$
P(X)=c_0+c_1X+\cdots+c_nX^n,
  \qquad c_j\in\mathbb{Z},\quad |c_j|\le n.
$$

Each of the $n+1$ coefficients has $2n+1$ possible values, so there are at most $(2n+1)^{n+1}$ such polynomials. A nonzero polynomial of degree at most $n$ has at most $n$ distinct real roots. Thus the set $F_n$ of all their real roots is finite.

Every algebraic number is a root of a nonzero integer polynomial. Taking $n$ at least as large as its degree and the absolute values of all its coefficients places that root in $F_n$. Conversely, every root in $F_n$ is algebraic. Hence

$$
\mathbb{A}=\bigcup_{n=1}^{\infty}F_n.
$$

Within each finite set $F_n$, list the roots in increasing order. Read these finite lists in the order $F_1,F_2,\ldots$, skipping repeated roots. Each root is reached after finitely many steps. This proves that $\mathbb{A}$ is countable. Every $n\in\mathbb{N}$ is a root of $X-n$, so $\mathbb{N}\subseteq\mathbb{A}$. Thus $\mathbb{A}$ is infinite, and $|\mathbb{A}|=\aleph_0$.

[![CH excludes intermediate cardinalities. Since \\mathbb\{T\} is uncountable and contained in \\mathbb\{R\}, its cardinality must equal \\aleph.](https://xyzmaths.org/notes/maths-analysis/figures/continuum-gap.svg)](https://xyzmaths.org/notes/maths-analysis/figures/continuum-gap.svg "Open original SVG")

Figure C.8. CH excludes intermediate cardinalities. Since $\mathbb{T}$ is uncountable and contained in $\mathbb{R}$, its cardinality must equal $\aleph$.

Now suppose that $\mathbb{T}$ were countable. Then $\mathbb{R}=\mathbb{A}\cup\mathbb{T}$ would be a union of two countable sets and therefore countable. This contradicts the uncountability of $\mathbb{R}$. Hence $\mathbb{T}$ is uncountable. Since $\mathbb{T}\subseteq\mathbb{R}$, we have

$$
\aleph_0<|\mathbb{T}|\le|\mathbb{R}|=\aleph.
$$

By CH there is no cardinality strictly between $\aleph_0$ and $\aleph$, as illustrated in [Figure C.8](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw01:continuum-gap). The lower endpoint is already excluded, so the only possibility is

$$
|\mathbb{T}|=\aleph.
$$

 ◻

### Exercise 1.3.13

Let $\tau$ be a transcendental number whose existence is proven already. Show that for any $n\in\mathbb{N}$, the numbers

$$
\tau,\ldots,\tau^n
$$

are linearly independent over the field $\mathbb{Q}$.

That is, if there are $r_1,\ldots,r_n\in\mathbb{Q}$ such that

$$
r_1\tau+\cdots+r_n\tau^n=0,
$$

then $r_1=\cdots=r_n=0$.

(In the language of Linear Algebra, this result indicates that the set $\mathbb{R}$ viewed as a vector space over $\mathbb{Q}$ is infinitely dimensional.)

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:linear-independence)

*Solution.* Suppose that

$$
r_1\tau+\cdots+r_n\tau^n=0,
  \qquad r_1,\ldots,r_n\in\mathbb{Q}.
$$

We want to show that every coefficient is zero. Suppose, for a contradiction, that at least one $r_j\ne0$.

Write $r_j=a_j/b_j$, where $a_j\in\mathbb{Z}$ and $b_j\in\mathbb{N}$. Put $D=b_1\cdots b_n>0$. We multiply through by $D$ to clear all the denominators and obtain

$$
(Dr_1)\tau+\cdots+(Dr_n)\tau^n=0.
$$

Each $Dr_j$ is an integer, and at least one is nonzero since $D\ne0$. Therefore

$$
P(X)=(Dr_1)X+\cdots+(Dr_n)X^n
$$

is a nonzero polynomial with integer coefficients satisfying $P(\tau)=0$. This would make $\tau$ algebraic, contradicting the assumption that it is transcendental.

Thus $r_1=\cdots=r_n=0$. Since $n$ was arbitrary, the numbers $\tau,\ldots,\tau^n$ are linearly independent over $\mathbb{Q}$ for every $n\in\mathbb{N}$. [^58] ◻

[^58]: Including a constant term does not change the argument. Thus $1,\tau,\ldots,\tau^n$ are also linearly independent over $\mathbb{Q}$.

### Exercise 1.7.2

Use the existence of the Dedekind cut in $\mathbb{R}$ to prove the greatest lower bound property. That is, if $S$ is a nonempty subset of $\mathbb{R}$ which is bounded below, then there is a unique number $c\in\mathbb{R}$ such that

$$
c=\inf S.
$$

(Do not use LUBP.)

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw03:dedekind-infimum)

*Solution.* Let $S\subseteq\mathbb{R}$ be nonempty and bounded below, and let $A$ be the set of all lower bounds of $S$,

$$
A=\{a\in\mathbb{R}\mid\forall s\in S,\quad a\leq s\}.
$$

Since $S$ is bounded below, $A$ is nonempty. Take $B=\mathbb{R}\setminus A$, so that $A\cup B=\mathbb{R}$ and $A\cap B=\varnothing$. More formally,

$$
B=\{b\in\mathbb{R}\mid\exists s\in S,\quad s<b\}.
$$

Choose $s_0\in S$. Then $s_0+1\in B$, so $B$ is also nonempty.

To use the Dedekind cut property (DC), we need to prove that $a<b$ for every $a\in A$ and $b\in B$. Fix such $a$ and $b$. Since $b$ is not a lower bound of $S$, there exists some $s\in S$ such that $s<b$. Since $a$ is a lower bound of $S$, we also have $a\leq s$. Combining these inequalities gives

$$
a\leq s<b,
$$

so $a<b$. DC therefore supplies a boundary $c\in\mathbb{R}$ satisfying

$$
\forall a\in A,\ \forall b\in B,\quad a\leq c\leq b.
$$

To prove that $c$ is the greatest lower bound, we must prove that it is itself a lower bound and that it is greater than or equal to every other lower bound, which belongs to $A$,

$$
\forall a\in A,\quad a\leq c.
$$

The latter follows from the definition of $A$ and the cut inequality $a\leq c$. To prove the former, fix any $s\in S$. We need to show that

$$
c\leq s.
$$

For every $\varepsilon>0$, we have $s+\varepsilon\in B$, since $s<s+\varepsilon$. The cut inequality therefore gives

$$
c\leq s+\varepsilon.
$$

Suppose for a contradiction that $c>s$, and take $\varepsilon=(c-s)/2>0$. Then

$$
\begin{aligned}
{2}
    &          & c  &\leq s+\dfrac{c-s}{2}, \\
    &\iff\quad & 2c &\leq 2s+c-s, \\
    &\iff\quad & c  &\leq s.
  
\end{aligned}
$$

This contradicts $c>s$. Hence $c\leq s$ for every $s\in S$, so $c$ is a lower bound of $S$ and therefore

$$
c=\inf S.
$$

If $d$ is another greatest lower bound, then $c\leq d$ and $d\leq c$, so $c=d$. Thus the greatest lower bound is unique. ◻

### Exercise 1.7.3

Give an example of a sequence of nested nonempty bounded intervals $\{I_n\}$ in $\mathbb{R}$ such that $I_{n+1}\subset I_n$ for each $n=1,2,\ldots$ but

$$
\bigcap_{n=1}^{\infty} I_n=\varnothing.
$$

Explain what goes “wrong”.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw02:nested-bounded-intervals)

*Solution.* Let

$$
I_n=\left(0,\frac1n\right),\qquad n\geq1.
$$

Each $I_n$ is a nonempty bounded interval because it contains $1/(2n)$ and is contained in $(0,1)$. Since $1/(n+1)<1/n$,

$$
I_{n+1}=\left(0,\frac1{n+1}\right)
    \subset I_n.
$$

Thus the intervals are nested, as shown in [Figure C.9](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw02:open-intervals).

[![The nested intervals I\_n=(0,1/n) exclude 0.](https://xyzmaths.org/notes/maths-analysis/figures/open-intervals.svg)](https://xyzmaths.org/notes/maths-analysis/figures/open-intervals.svg "Open original SVG")

Figure C.9. The nested intervals $I_n=(0,1/n)$ exclude $0$.

To prove that their intersection is empty, let $x\in\mathbb{R}$. If $x\leq0$, then $x\notin I_1$. If $x>0$, the Archimedean property gives a positive integer $n>1/x$.[^59] Then $1/n<x$ and $x\notin I_n$. Hence every real number is excluded from at least one interval, and therefore

$$
\bigcap_{n=1}^{\infty}I_n=\varnothing.
$$

The nested interval property guarantees a nonempty intersection for nested nonempty bounded closed intervals in $\mathbb{R}$. Here the missing hypothesis is *closedness*. Every finite intersection is nonempty, but the only point common to all the closures $[0,1/n]$ is $0$, which is excluded from every $I_n$. ◻

[^59]: *Archimedean property.* For every $M\in\mathbb{R}$, there is a positive integer $n>M$.

### Exercise 1.7.4

Give an example of a sequence of nested nonempty closed intervals $\{I_n\}$ in $\mathbb{R}$ such that $I_{n+1}\subset I_n$ for each $n=1,2,\ldots$ but

$$
\bigcap_{n=1}^{\infty} I_n=\varnothing.
$$

Explain what goes “wrong”.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw02:nested-closed-intervals)

*Solution.* Let

$$
I_n=[n,\infty),\qquad n\geq1.
$$

Each $I_n$ is a nonempty closed interval in $\mathbb{R}$, since $n\in I_n$ and its complement $(-\infty,n)$ is open. Moreover,

$$
I_{n+1}=[n+1,\infty)\subset[n,\infty)=I_n,
$$

Thus the intervals are nested, as shown in [Figure C.10](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw02:unbounded-intervals).

For any $x\in\mathbb{R}$, the Archimedean property gives a positive integer $n>x$. Then $x\notin[n,\infty)=I_n$. Consequently, no real number belongs to every $I_n$, and

$$
\bigcap_{n=1}^{\infty}I_n=\varnothing.
$$

[![Each ray \[n,\\infty) includes its finite left endpoint and extends indefinitely to the right.](https://xyzmaths.org/notes/maths-analysis/figures/unbounded-intervals.svg)](https://xyzmaths.org/notes/maths-analysis/figures/unbounded-intervals.svg "Open original SVG")

Figure C.10. Each ray $[n,\infty)$ includes its finite left endpoint and extends indefinitely to the right.

The missing hypothesis in the nested interval property is *boundedness*. All the intervals $I_n$ are unbounded, and their left endpoints eventually exceed every fixed real number. ◻

### Exercise 1.8.2

Consider the seqeunce

$$
x_n=\frac{1}{n^2}+\frac{2}{n^2}+\cdots+\frac{n}{n^2},
    \quad n=1,2,\ldots.
$$

1.  **(a)** Show that it is monotone decreasing and bounded below.

2.  **(b)** Show that it is Cauchy.

3.  **(c)** Obtain the limit of $\{x_n\}$.

4.  **(d)** Let $S=\{x_1,x_2,\ldots,x_n,\ldots\}$. Obtain both $\inf S$ and $\sup S$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw02:decreasing-sequence)

*Solution.*

1.  **(a)** *Monotonicity and a lower bound.* Using $1+2+\cdots+n=n(n+1)/2$, we obtain

    $$
    x_n=\frac1{n^2}\sum_{k=1}^n k
            =\frac{n(n+1)}{2n^2}
            =\frac12+\frac1{2n}.
    $$

    Hence, for every $n\geq1$,

    $$
    x_{n+1}-x_n
            =\frac1{2(n+1)}-\frac1{2n}
            =-\frac1{2n(n+1)}<0.
    $$

    Thus $(x_n)$ is strictly decreasing. Since $1/(2n)>0$, we also have $x_n>1/2$ for every $n\geq1$, so the sequence is bounded below by $1/2$.

2.  **(b)** *The Cauchy property.* Let $\varepsilon>0$. By the Archimedean property, choose $N\in\mathbb{N}$ such that $N>1/\varepsilon$. For all $m,n\geq N$, the triangle inequality gives

    $$
    \begin{aligned}
            |x_n-x_m|
              &=\left|\frac1{2n}-\frac1{2m}\right|\\
              &\leq\frac1{2n}+\frac1{2m}
              \leq\frac1N<\varepsilon.
          \end{aligned}
    $$

    Therefore $(x_n)$ is Cauchy.

3.  **(c)** *The limit.* Since $1/(2n)\to0$ as $n\to\infty$,

    $$
    \lim_{n\to\infty}x_n
            =\lim_{n\to\infty}\left(\frac12+\frac1{2n}\right)
            =\frac12.
    $$

4.  **(d)** *Infimum and supremum.* Part (a) shows that $1/2$ is a lower bound for $S$. If $c>1/2$, choose $n>1/(2(c-1/2))$. Then

    $$
    x_n=\frac12+\frac1{2n}<c,
    $$

    so $c$ is not a lower bound. Thus $\inf S=1/2$. Since $(x_n)$ is decreasing and $x_1=1\in S$, its maximum is $1$, and therefore $\sup S=1$.

 ◻

### Exercise 1.9.3

Consider the sequence

$$
a_n=\frac{1}{n}+\sin\left(\frac{2\pi n}{3}\right),
    \qquad n=1,2,\ldots.
$$

Find all limit points of $\{a_n\}$ and obtain

$$
\liminf_{n\to\infty}a_n,\quad\limsup_{n\to\infty}a_n.
$$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw03:oscillating-sequence)

*Solution.* The sine term repeats every three indices. Let $h=\sqrt{3}/2$. Separating the indices according to their remainder upon division by three gives

$$
\begin{aligned}
    a_{3k}&=\frac{1}{3k}, && k\geq1, \\
    a_{3k+1}&=h+\frac{1}{3k+1}, && k\geq0, \\
    a_{3k+2}&=-h+\frac{1}{3k+2}, && k\geq0.
  
\end{aligned}
$$

The reciprocals tend to zero, so these three subsequences converge to $0$, $h$, and $-h$, respectively. Each of these numbers is therefore a limit point. [Figure C.11](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw03:oscillating-sequence) shows the three groups of terms approaching their limits.

[![The first eighteen terms. The dashed lines mark \\pm\\sqrt\{3\}/2; the horizontal axis marks the third limit, 0.](https://xyzmaths.org/notes/maths-analysis/figures/oscillating-sequence.svg)](https://xyzmaths.org/notes/maths-analysis/figures/oscillating-sequence.svg "Open original SVG")

Figure C.11. The first eighteen terms. The dashed lines mark $\pm\sqrt{3}/2$; the horizontal axis marks the third limit, $0$.

To show that there are no other limit points, suppose a subsequence converges to $\ell$. Among its infinitely many indices, at least one remainder occurs infinitely often. Keeping only those indices gives a further subsequence of one of the three sequences above. It still converges to $\ell$, so uniqueness of limits forces $\ell$ to be $0$, $h$, or $-h$. Thus the set of all limit points is

$$
\left\{-\frac{\sqrt{3}}{2},0,\frac{\sqrt{3}}{2}\right\}.
$$

To find the lower limit, fix a tail beginning at $N\geq1$. Every term in this tail is greater than $-h$, while terms with indices $3k+2$ occur arbitrarily far out and approach $-h$. Therefore

$$
\inf\{a_n\mid n\geq N\}=-h.
$$

For the upper limit, every term in this tail satisfies $a_n\leq h+1/N$. The tail also contains terms with indices $3k+1$, all of which exceed $h$. Hence

$$
h\leq\sup\{a_n\mid n\geq N\}\leq h+\frac{1}{N}.
$$

Taking the limits of these tail bounds gives

$$
\liminf_{n\to\infty}a_n=-\frac{\sqrt{3}}{2},\qquad
    \limsup_{n\to\infty}a_n=\frac{\sqrt{3}}{2}.
$$

 ◻

### Exercise 1.9.8

Give an example of a sequence of nested nonempty bounded closed intervals $\{I_n\}$ in $\mathbb{Q}$ such that $I_{n+1}\subset I_n$ for each $n=1,2,\ldots$ but

$$
\bigcap_{n=1}^{\infty} I_n=\varnothing.
$$

Explain what goes “wrong”.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw02:nested-rational-intervals)

*Solution.* For $n\geq1$, define

$$
m_n=\lfloor10^n\sqrt2\rfloor,\qquad
  a_n=\frac{m_n}{10^n},\qquad b_n=\frac{m_n+1}{10^n},
$$

and let $I_n=[a_n,b_n]\cap\mathbb{Q}$. Since $m_n\in\mathbb{Z}$, both endpoints are rational. Thus $I_n$ is nonempty (it contains $a_n$), bounded, and closed relative to $\mathbb{Q}$, being the intersection of a closed subset of $\mathbb{R}$ with $\mathbb{Q}$.

Because $\sqrt2$ is irrational, the definition of the floor function gives $m_n<10^n\sqrt2<m_n+1$. Consequently,

$$
a_n<\sqrt2<b_n,\qquad b_n-a_n=10^{-n}.
$$

[Figure C.12](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw02:rational-nested-intervals) illustrates these rational intervals around the excluded point $\sqrt2$.

[![Schematic intervals \[a\_n,b\_n\]\\cap\\mathbb\{Q\}. Hollow markers indicate that \\sqrt2\\notin\\mathbb\{Q\}; all endpoints are rational.](https://xyzmaths.org/notes/maths-analysis/figures/rational-nested-intervals.svg)](https://xyzmaths.org/notes/maths-analysis/figures/rational-nested-intervals.svg "Open original SVG")

Figure C.12. Schematic intervals $[a_n,b_n]\cap\mathbb{Q}$. Hollow markers indicate that $\sqrt2\notin\mathbb{Q}$; all endpoints are rational.

Multiplying by $10$ gives $10m_n<10^{n+1}\sqrt2<10m_n+10$. Taking floors therefore yields

$$
10m_n\leq m_{n+1}\leq10m_n+9.
$$

It follows that

$$
a_{n+1}=\frac{m_{n+1}}{10^{n+1}}\geq a_n,
  \qquad
  b_{n+1}=\frac{m_{n+1}+1}{10^{n+1}}\leq b_n.
$$

Thus $I_{n+1}\subseteq I_n$. In fact, the inclusion is strict because the lengths of the corresponding real intervals decrease by a factor of $10$. By the density of $\mathbb{Q}$ in $\mathbb{R}$, any nonempty open portion removed contains a rational number, so at least one point of $I_n$ does not belong to $I_{n+1}$.

The inequalities

$$
0<\sqrt2-a_n<10^{-n},\qquad
  0<b_n-\sqrt2<10^{-n}
$$

show that $a_n\to\sqrt2$ and $b_n\to\sqrt2$. If $x\in\bigcap_{n=1}^{\infty}I_n$, then $x\in\mathbb{Q}$ and $a_n\leq x\leq b_n$ for every $n$. Since both endpoint sequences converge to $\sqrt2$, the squeeze theorem applied to the constant sequence with value $x$ gives $x=\sqrt2$, contradicting $x\in\mathbb{Q}$.[^60] Therefore

$$
\bigcap_{n=1}^{\infty}I_n=\varnothing.
$$

What fails is the *completeness of $\mathbb{Q}$*. The corresponding closed intervals in $\mathbb{R}$ have intersection $\{\sqrt2\}$, but this point is absent from $\mathbb{Q}$. ◻

[^60]: *Squeeze theorem.* If $u_n\leq v_n\leq w_n$ and $u_n,w_n\to\ell$, then $v_n\to\ell$.

### Exercise 1.9.10

Consider the sequence

$$
x_n=\sum_{k=0}^{n}\frac{1}{k!},\quad n=1,2,\ldots,
$$

in $\mathbb{Q}$ and define $S=\{x_1,x_2,\ldots,x_n,\ldots\}$ which is a subset of $\mathbb{Q}$.

1.  **(a)** Show that $S$ is a bounded set.

2.  **(b)** Find $a=\inf S$ and $b=\sup S$.

3.  **(c)** Is it true that $a$ and $b$ both lie in $\mathbb{Q}$? Explain why and why not.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw02:factorial-sequence)

*Solution.*

1.  **(a)** *Boundedness.* For $k\geq2$, each of the $k-1$ factors $2,3,\ldots,k$ is at least $2$, so

    $$
    k!=1\cdot2\cdots k\geq2^{k-1}.
    $$

    Consequently, for $n\geq2$,

    $$
    \begin{aligned}
            2\leq x_n
              &=2+\sum_{k=2}^n\frac1{k!}\\
              &\leq2+\sum_{k=2}^n\frac1{2^{k-1}}\\
              &=2+\frac{\tfrac12(1-(\tfrac12)^{n-1})}{1-\tfrac12}
              =3-2^{1-n}<3.
          \end{aligned}
    $$

    Since $x_1=2$, it follows that $2\leq x_n<3$ for every $n\geq1$. Thus $S$ is bounded.

2.  **(b)** *Infimum and supremum.* We take the infimum and supremum in $\mathbb{R}$. Since $x_1=2$ and all terms are at least $2$, we have $a=\inf S=2$. Moreover, $x_{n+1}-x_n=1/(n+1)!>0$, so $(x_n)$ is strictly increasing. Since part (a) gives an upper bound, the monotone convergence theorem implies that $x_n\to L$ for some $L\in\mathbb{R}$.[^61] Each $x_n\leq L$. If $u<L$, convergence gives a term $x_n>u$, so $u$ is not an upper bound. Therefore $b=\sup S=L$.

    The factorial-series definition of $e$ is the limit of these same partial sums. Thus $L=e$, and

    $$
    a=2,\qquad b=e=\sum_{k=0}^{\infty}\frac1{k!}.
    $$

3.  **(c)** *Rationality.* We have $a=2\in\mathbb{Q}$, but $b=e\notin\mathbb{Q}$. To prove the latter, suppose that $e=p/q$ with $p,q\in\mathbb{N}$. Choose an integer $N\geq\max\{q,2\}$. Then

    $$
    R=N!\left(e-\sum_{k=0}^N\frac1{k!}\right)
    $$

    is an integer because both $N!e=N!p/q$ and every $N!/k!$ with $0\leq k\leq N$ are integers. On the other hand,

    $$
    \begin{aligned}
            0<R
              &=\sum_{j=1}^{\infty}
                \frac1{(N+1)(N+2)\cdots(N+j)}\\
              &\leq\sum_{j=1}^{\infty}\frac1{(N+1)^j}
              =\frac1N\leq\frac12<1.
          \end{aligned}
    $$

    This contradicts $R\in\mathbb{Z}$. Thus $e$ is irrational.

    In particular, $S$ has no supremum in the ordered field $\mathbb{Q}$. Indeed, any rational upper bound $u$ must satisfy $u>e$. By the density of $\mathbb{Q}$ in $\mathbb{R}$, there is a rational $v$ with $e<v<u$, and $v$ is a smaller upper bound for $S$.

 ◻

[^61]: *Monotone convergence theorem.* Every increasing real sequence that is bounded above converges.

### Exercise 1.9.11

Let the rational numbers in $[0,1]$ be enumerated by $q_0,q_1,\ldots,q_n,\ldots$. Let $\varepsilon>0$ and cover this set $Q=\{q_n\}$ by

$$
U_\varepsilon=\bigcup_{n=0}^{\infty}I_n(\varepsilon),
$$

$$
I_n(\varepsilon)=(q_n-\varepsilon 2^{-n},q_n+\varepsilon 2^{-n}),
    \qquad n=0,1,2,\ldots.
$$

That is, $Q\subset U_\varepsilon$.

1.  **(a)** Show that the sum of the lengths of the intervals $\{I_n(\varepsilon)\}$ satisfies the bound

    $$
    \sum_{n=0}^{\infty}|I_n(\varepsilon)|\leq4\varepsilon.
    $$

2.  **(b)** Since $\varepsilon>0$ can be arbitrarily small, the set $Q$ can be covered by intervals of arbitrarily small total length indicating that $Q$ is a rather “sparse” subset of $[0,1]$. In view of this fact, give your explanation regarding the “incompleteness” of $Q$ in $[0,1]$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw03:rational-interval-cover)

*Solution.* For part (a), the length of each interval is the difference between its endpoints, so

$$
|I_n(\varepsilon)|
      =(q_n+\varepsilon2^{-n})-(q_n-\varepsilon2^{-n})
      =2\varepsilon2^{-n}.
$$

The finite geometric sum gives

$$
\sum_{n=0}^{N}|I_n(\varepsilon)|
      =2\varepsilon\sum_{n=0}^{N}2^{-n}
      =4\varepsilon\bigl(1-2^{-(N+1)}\bigr).
$$

Letting $N\to\infty$, we obtain

$$
\sum_{n=0}^{\infty}|I_n(\varepsilon)|=4\varepsilon.
$$

In particular, the requested upper bound holds. Given any $\delta>0$, choosing $0<\varepsilon<\delta/4$ covers every point of $Q$ with intervals whose total length is less than $\delta$.

For part (b), this explains the word “sparse” in terms of covering length. It does not mean that the rationals are separated by gaps. Rational density gives a point of $Q$ in every open subinterval of $[0,1]$, so the closure of $Q$ is the whole interval. Nor does the covering estimate alone prove that $Q$ is incomplete. A singleton is complete and also admits covers of arbitrarily small length.

To prove incompleteness, we must instead exhibit a Cauchy sequence in $Q$ with no limit in $Q$. Let $\alpha=\sqrt{2}/2$. Then $0<\alpha<1$, and $\alpha$ is irrational, since otherwise $\sqrt{2}=2\alpha$ would be rational. Take the decimal approximations

$$
x_n=\frac{\lfloor10^n\alpha\rfloor}{10^n},\qquad n\geq1.
$$

Each $x_n$ belongs to $Q$, and the defining inequalities for the floor function give

$$
0\leq\alpha-x_n<10^{-n}.
$$

Given $\eta>0$, choose $N$ so that $2\cdot10^{-N}<\eta$. For $m,n\geq N$, the triangle inequality then gives

$$
|x_m-x_n|
      \leq|x_m-\alpha|+|x_n-\alpha|
      <2\cdot10^{-N}<\eta.
$$

Thus $(x_n)$ is Cauchy. The same approximation bound shows that $x_n\to\alpha$ in $\mathbb{R}$. By uniqueness of limits, it cannot converge to a point of $Q$. This missing limit proves that $Q$ is incomplete. Since $Q$ is dense in $[0,1]$ and this closed interval is complete, $[0,1]$ is its completion under the usual distance. ◻

### Exercise 1.10.1

Use the triangle inequality to prove

$$
\bigl||x|-|y|\bigr|\leq|x-y|,\qquad x,y\in\mathbb{R}.
$$

When will this become an equality?

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw03:reverse-triangle-inequality)

*Solution.* Write $x=(x-y)+y$. The triangle inequality gives

$$
|x|\leq|x-y|+|y|,
$$

and therefore $|x|-|y|\leq|x-y|$. Interchanging $x$ and $y$ gives $|y|-|x|\leq|y-x|=|x-y|$. Combining the two inequalities, we obtain

$$
-|x-y|\leq|x|-|y|\leq|x-y|.
$$

This is exactly

$$
\bigl||x|-|y|\bigr|\leq|x-y|.
$$

For equality, first suppose $xy\geq0$. If both numbers are nonnegative, then

$$
\bigl||x|-|y|\bigr|=|x-y|.
$$

If both are nonpositive, then $|x|=-x$ and $|y|=-y$, so

$$
\bigl||x|-|y|\bigr|=|-x+y|=|x-y|.
$$

These cases also include either number being zero.

If $xy<0$, the numbers have opposite signs and neither is zero. Then $|x-y|=|x|+|y|$. Since both $|x|$ and $|y|$ are positive,

$$
\bigl||x|-|y|\bigr|<|x|+|y|=|x-y|.
$$

Thus equality holds exactly when $xy\geq0$. Taking absolute values can be pictured as folding the number line at zero. Points on the same side keep their separation, while points on opposite sides move closer together. [Figure C.13](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw03:reverse-triangle-distance) illustrates this folding.

[![Schematic folding by t\\mapsto\|t\|. Both rows use the same scale. Here y\<0\<x\<\|y\|, and the gap shrinks from \|x-y\| to \\bigl\|\|x\|-\|y\|\\bigr\|. Points on the same half-line keep their separation.](https://xyzmaths.org/notes/maths-analysis/figures/reverse-triangle-distance.svg)](https://xyzmaths.org/notes/maths-analysis/figures/reverse-triangle-distance.svg "Open original SVG")

Figure C.13. Schematic folding by $t\mapsto|t|$. Both rows use the same scale. Here $y<0<x<|y|$, and the gap shrinks from $|x-y|$ to $\bigl||x|-|y|\bigr|$. Points on the same half-line keep their separation.

 ◻

### Exercise 1.11.2

Let $p=2,3,5,\ldots$ be a prime. Prove that $\sqrt{p}$ is irrational. Can this result be extended to $p^{\frac{1}{k}}$ for any integer $k\geq 2$?

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:prime-roots)

*Solution.* We use Euclid’s lemma, which states that if a prime divides a product of integers, it divides at least one factor. Applying this repeatedly shows that $p\mid a^k$ implies $p\mid a$ for every positive integer $k$.

*The square root.* Suppose, for a contradiction, that $\sqrt p\in\mathbb{Q}$. Write

$$
\sqrt p=\frac ab,
  \qquad a,b\in\mathbb{Z},\quad b>0,\quad\gcd(a,b)=1.
$$

Squaring gives $a^2=pb^2$, so $p\mid a^2$. Euclid’s lemma gives $p\mid a$, and we can write $a=pm$ for some $m\in\mathbb{Z}$. Substituting and cancelling one factor of $p$ gives

$$
p^2m^2=pb^2
  \quad\Longrightarrow\quad
  pm^2=b^2.
$$

Hence $p\mid b^2$, so Euclid’s lemma also gives $p\mid b$. The prime $p>1$ therefore divides both $a$ and $b$, contradicting $\gcd(a,b)=1$. Thus $\sqrt p$ is irrational.

*The general $k$th root.* Let $k\ge2$ and suppose that $p^{1/k}=a/b$ in lowest terms, with $a,b\in\mathbb{Z}$ and $b>0$. Raising both sides to the $k$th power gives $a^k=pb^k$. Thus $p\mid a^k$, and Euclid’s lemma gives $p\mid a$. Writing $a=pm$, we obtain

$$
p^km^k=pb^k
  \quad\Longrightarrow\quad
  p^{k-1}m^k=b^k.
$$

Since $k-1\ge1$, this shows that $p\mid b^k$, so $p\mid b$. Again, $p$ divides both $a$ and $b$, contradicting that the fraction is in lowest terms. Therefore $p^{1/k}$ is irrational for every integer $k\ge2$. ◻

### Exercise 1.11.3

Show that if $a>0$ is irrational, so is the $k$th root of $a$, $a^{\frac{1}{k}}$, for any $k\in\mathbb{N}$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw01:irrational-roots)

*Solution.* Let $k\ge1$. Suppose, for a contradiction, that $a^{1/k}$ is rational. Then

$$
a^{1/k}=\frac pq,
  \qquad p,q\in\mathbb{Z},\quad q\ne0.
$$

Raising both sides to the $k$th power gives

$$
a=\left(\frac pq\right)^k=\frac{p^k}{q^k}\in\mathbb{Q},
$$

since $p^k,q^k\in\mathbb{Z}$ and $q^k\ne0$. This contradicts the assumption that $a$ is irrational. Therefore $a^{1/k}$ is irrational for every $k\in\mathbb{N}$. ◻

### Exercise 1.11.4

Consider $A=\{a\in\mathbb{R}\mid a^3>5-\sqrt{2}\}$.

1.  **(a)** Find $B\subseteq\mathbb{R}$ such that $\{A,B\}$ forms a Dedekind partition.

2.  **(b)** Find the Dedekind cut for this partition.

3.  **(c)** Show that $A$ is bounded below and $B$ is bounded above and find

    $$
    \inf A\quad\text{and}\quad\sup B.
    $$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw03:cubic-dedekind-cut)

*Solution.* Since $\sqrt{2}<2$, we have $5-\sqrt{2}>0$. The existence and uniqueness of nonnegative cube roots therefore gives a number

$$
c=(5-\sqrt{2})^{1/3}>0,\qquad c^3=5-\sqrt{2}.
$$

If $a\leq0$, then $a^3\leq0<c^3$, so $a\notin A$. On the nonnegative real numbers, $x \mapsto x^3$ is strictly increasing. Hence $a^3>c^3$ holds exactly when $a>c$, and therefore

$$
A=(c,\infty).
$$

For part (a), take

$$
B=\mathbb{R}\setminus A=(-\infty,c].
$$

Then $A\cup B=\mathbb{R}$ and $A\cap B=\varnothing$. Both sets are nonempty, since $c+1\in A$ and $c\in B$. For every $b\in B$ and $a\in A$, we have

$$
b\leq c<a.
$$

Thus $B$ is the lower part and $A$ is the upper part of a Dedekind partition, as shown in [Figure C.14](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw03:cubic-partition).

[![Schematic partition with the boundary included in B and excluded from A. The two intervals together cover the real line.](https://xyzmaths.org/notes/maths-analysis/figures/cubic-partition.svg)](https://xyzmaths.org/notes/maths-analysis/figures/cubic-partition.svg "Open original SVG")

Figure C.14. Schematic partition with the boundary included in $B$ and excluded from $A$. The two intervals together cover the real line.

For part (b), the displayed inequality shows that $c$ is a boundary for this partition. To see that it is unique, suppose $d$ is another boundary. Since $c\in B$, we must have $c\leq d$. If $d>c$, then

$$
a=\frac{c+d}{2}\in A,\qquad a<d,
$$

contradicting the boundary inequality $d\leq a$. Thus $d=c$, so the Dedekind cut is $(5-\sqrt{2})^{1/3}$.

Geometrically, the two proposed boundaries would leave $(c,d)$ uncovered. Every element of $B$ is at most $c$, and the proposed boundary $d$ would require every element of $A$ to be at least $d$. The midpoint lies in neither region, contradicting $A\cup B=\mathbb{R}$, as illustrated in [Figure C.15](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw03:dedekind-cut-uniqueness).

[![Schematic regions allowed by two proposed boundaries c\<d. They force B\\subseteq(-\\infty,c\] and A\\subseteq\[d,\\infty). Their gap contains (c+d)/2, contradicting A\\cup B=\\mathbb\{R\}.](https://xyzmaths.org/notes/maths-analysis/figures/dedekind-cut-uniqueness.svg)](https://xyzmaths.org/notes/maths-analysis/figures/dedekind-cut-uniqueness.svg "Open original SVG")

Figure C.15. Schematic regions allowed by two proposed boundaries $c<d$. They force $B\subseteq(-\infty,c]$ and $A\subseteq[d,\infty)$. Their gap contains $(c+d)/2$, contradicting $A\cup B=\mathbb{R}$.

For part (c), $c$ is a lower bound of $A$. Any $d>c$ fails to be a lower bound, because $(c+d)/2$ belongs to $A$ and is smaller than $d$. Hence $c$ is the greatest lower bound of $A$. Also, $c$ is an upper bound of $B$ and belongs to $B$, so it is its greatest element and therefore its least upper bound. Consequently,

$$
\inf A=\sup B=(5-\sqrt{2})^{1/3}.
$$

 ◻

### Exercise 1.11.6

For $x\in\mathbb{R}_+$, we defined the function $x^{1/n}$ for $n\in\mathbb{N}$.

1.  **(a)** For $x,y\in\mathbb{R}_+$, prove that $(xy)^{1/n}=x^{1/n}y^{1/n}$.

2.  **(b)** For $x\in\mathbb{R}_+$, we defined $x^{m/n}=(x^m)^{1/n}$ for $m\in\mathbb{N}$. Show that this is the same as $(x^{1/n})^m$.

3.  **(c)** For $x\in\mathbb{R}_+$ and $r,s\in\mathbb{Q}_+$, prove the laws of exponents

    $$
    (x^r)^s=x^{rs},\qquad x^{r+s}=x^rx^s.
    $$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw03:rational-exponent-laws)

*Solution.* We use $\mathbb{R}_+=[0,\infty)$ and positive rational exponents. The nonnegative $n$th root exists and is unique for every positive integer $n$.

For part (a), put $u=x^{1/n}$ and $v=y^{1/n}$. Both are nonnegative, and the integer power laws give

$$
(uv)^n=u^nv^n=xy.
$$

Thus $uv$ is the nonnegative $n$th root of $xy$. Uniqueness gives

$$
(xy)^{1/n}=x^{1/n}y^{1/n}.
$$

For part (b), put $w=(x^{1/n})^m$. This number is nonnegative, and

$$
w^n=(x^{1/n})^{mn}=\bigl((x^{1/n})^n\bigr)^m=x^m.
$$

Hence $w$ is the nonnegative $n$th root of $x^m$. Again by uniqueness,

$$
x^{m/n}=(x^m)^{1/n}=(x^{1/n})^m.
$$

For part (c), write $r=m/n$ and $s=p/q$, where $m,n,p,q$ are positive integers. We use the fact that rational powers are independent of the fraction used to represent the exponent. First let $u=(x^r)^s$. By definition, $u\geq0$ and $u^q=(x^r)^p$. Taking integer powers gives

$$
u^{nq}=\bigl((x^r)^p\bigr)^n
      =\bigl((x^r)^n\bigr)^p=x^{mp}.
$$

Since $rs=mp/(nq)$, the number $x^{rs}$ is also the nonnegative $(nq)$th root of $x^{mp}$. Therefore

$$
(x^r)^s=x^{rs}.
$$

For the sum law, let $v=x^rx^s$. This is nonnegative, and

$$
\begin{aligned}
    v^{nq}
      &=(x^r)^{nq}(x^s)^{nq} \\
      &=\bigl((x^r)^n\bigr)^q\bigl((x^s)^q\bigr)^n \\
      &=x^{mq}x^{pn}=x^{mq+pn}.
  
\end{aligned}
$$

But $r+s=(mq+pn)/(nq)$, so $x^{r+s}$ is the nonnegative $(nq)$th root of the same number. Uniqueness therefore gives

$$
x^{r+s}=x^rx^s.
$$

These arguments include $x=0$, since all exponents are positive and we never divide by $x$. ◻

### Exercise 1.11.7

Show that for $n=3,5,7,\ldots$, the function $x^{1/n}$ is a well-defined monotone increasing function which is a bijection from $\mathbb{R}$ to itself. (Hint: Study $x^n$.)

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw03:odd-roots)

*Solution.* Fix an odd integer $n\geq3$ and let $p(x)=x^n$. We first show that $p$ is strictly increasing on the whole real line. If $0\leq x<y$, the strict increase of nonnegative integer powers gives $x^n<y^n$. If $x<y\leq0$, then $0\leq-y<-x$, so

$$
(-y)^n<(-x)^n.
$$

Since $n$ is odd, this becomes $-y^n<-x^n$, or $x^n<y^n$. Finally, if $x<0<y$, then $x^n<0<y^n$. These cases cover every pair $x<y$, so $p$ is strictly increasing and therefore injective.

To prove surjectivity, take any $t\in\mathbb{R}$. If $t\geq0$, the existence of nonnegative roots supplies an $x\geq0$ with $x^n=t$. If $t<0$, let $u=(-t)^{1/n}>0$ and take $x=-u$. Since $n$ is odd,

$$
x^n=(-u)^n=-u^n=-(-t)=t.
$$

Thus every real number has an $n$th root. Injectivity shows that this root is unique, so the inverse function

$$
g(t)=t^{1/n}
$$

is well defined on all of $\mathbb{R}$.

To show that $g$ is strictly increasing, take $s<t$. If $g(s)\geq g(t)$, the increase of $p$ would give

$$
s=p(g(s))\geq p(g(t))=t,
$$

a contradiction. Hence $g(s)<g(t)$, which also proves injectivity. For any $x\in\mathbb{R}$, we have $g(x^n)=x$, so $g$ is surjective as well. Therefore the real $n$th root function is a strictly increasing bijection from $\mathbb{R}$ to itself. [Figure C.16](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw03:odd-root-inverse) illustrates this inverse relationship for $n=3$.

[![The graphs of y=x^3 and y=x^\{1/3\} are reflections of one another across y=x. Both are strictly increasing.](https://xyzmaths.org/notes/maths-analysis/figures/odd-root-inverse.svg)](https://xyzmaths.org/notes/maths-analysis/figures/odd-root-inverse.svg "Open original SVG")

Figure C.16. The graphs of $y=x^3$ and $y=x^{1/3}$ are reflections of one another across $y=x$. Both are strictly increasing.

 ◻

### Exercise 1.11.8

Consider the iteration process

$$
x_{n+1}=a+\frac{1}{x_n},\quad n=0,1,2,\ldots,
    \quad a\geq 1,\quad x_0>0,
$$

whose limit gives us the continuous fraction

$$
b=a+\frac{1}{a+\frac{1}{a+\frac{1}{a+\cdots}}}.
$$

That is, $b$ is a fixed point of the function

$$
f(x)=a+\frac{1}{x},\quad x>0,
$$

which is realized as a root of the function $F(x)=x-f(x)$ $(x>0)$.

1.  **(a)** Show that the iterative algorithm

    $$
    x_{n+1}=\frac{ax_n^2+2x_n}{1+x_n^2},
            \quad n=0,1,2,\ldots,\quad x_0>0,
    $$

    arises from Newton’s method that may be used to approach $b$ of our problem.

2.  **(b)** Assume that $\{x_n\}$ in (a) converges. Verify that the limit is indeed the continuous fraction $b$ defined above.

3.  **(c)** Take $a=\frac{3}{2}$. Prove $0<x_n\leq 2$ for $n=1,2,\ldots$.

4.  **(d)** Prove that $\{x_n\}_{n=1,2,\ldots}$ increases for any $x_0\ne 2$ and is constant when $x_0=2$.

5.  **(e)** Show that $\{x_n\}$ converges to $2$ with any initial state $x_0$ (thereby establishing the “global convergence” of the algorithm).

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw02:newton-iteration)

*Solution.*

1.  **(a)** *Newton’s method.* For $x>0$, let

    $$
    F(x)=x-a-\frac1x,\qquad F'(x)=1+\frac1{x^2}>0.
    $$

    Newton’s method for $F(x)=0$ is therefore

    $$
    \begin{aligned}
            x_{n+1}
              &=x_n-\frac{F(x_n)}{F'(x_n)}\\
              &=x_n-\frac{x_n-a-1/x_n}{1+1/x_n^2}\\
              &=\frac{x_n(1+x_n^2)-(x_n^3-ax_n^2-x_n)}{1+x_n^2}\\
              &=\frac{ax_n^2+2x_n}{1+x_n^2},
          \end{aligned}
    $$

    which is the stated iteration. If $x_n>0$, then the numerator and denominator are positive. Since $x_0>0$, induction shows that every iterate is positive and the algorithm is well defined.

2.  **(b)** *Identification of the limit.* Suppose $x_n\to L$. Positivity implies $L\geq0$. We first rule out $L=0$. If $L=0$, there is an $N$ such that $0<x_n<1$ for all $n\geq N$. For these indices,

    $$
    \frac{x_{n+1}}{x_n}
            =\frac{ax_n+2}{1+x_n^2}>1.
    $$

    The tail is then increasing and satisfies $x_n\geq x_N>0$, contradicting $x_n\to0$. Hence $L>0$.

    Passing to the limit in the recurrence gives

    $$
    L=\frac{aL^2+2L}{1+L^2}.
    $$

    Thus $L(L^2-aL-1)=0$. Since $L>0$, we obtain

    $$
    L^2-aL-1=0,\qquad
          L=\frac{a+\sqrt{a^2+4}}2.
    $$

    This is the unique positive solution of $L=a+1/L$. The continued fraction $b$ is a positive fixed point of $f(x)=a+1/x$, so uniqueness implies $L=b$.

3.  **(c)** *Bounds when $a=3/2$.* For the remaining parts, set $a=3/2$ and write

    $$
    g(x)=\frac{\tfrac32x^2+2x}{1+x^2},\qquad x>0.
    $$

    We have $g(x)>0$ and

    $$
    2-g(x)
            =\frac{2(1+x^2)-\tfrac32x^2-2x}{1+x^2}
            =\frac{(x-2)^2}{2(1+x^2)}\geq0.
    $$

    The nonnegativity of the numerator is illustrated in [Figure C.17](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw02:nonnegative-parabola).

    [![The numerator (x-2)^2 is nonnegative, with equality only at x=2.](https://xyzmaths.org/notes/maths-analysis/figures/nonnegative-parabola.svg)](https://xyzmaths.org/notes/maths-analysis/figures/nonnegative-parabola.svg "Open original SVG")

    Figure C.17. The numerator $(x-2)^2$ is nonnegative, with equality only at $x=2$.

    Therefore $0<g(x)\leq2$ for every $x>0$, with $g(x)=2$ if and only if $x=2$. Applying this to $x_n>0$ proves

    $$
    0<x_n\leq2\qquad\text{for every }n\geq1,
    $$

    regardless of whether $x_0\leq2$.

4.  **(d)** *Monotonicity.* If $x_0=2$, then $g(2)=2$, so induction gives $x_n=2$ for all $n\geq0$.

    Now suppose $x_0\ne2$. The equality condition in part (c) gives $0<x_1<2$. Repeatedly applying the same condition yields $0<x_n<2$ for every $n\geq1$. For these indices,

    $$
    \begin{aligned}
            x_{n+1}-x_n
              &=\frac{\tfrac32x_n^2+2x_n-x_n(1+x_n^2)}{1+x_n^2}\\
              &=\frac{x_n(-2x_n^2+3x_n+2)}{2(1+x_n^2)}\\
              &=\frac{x_n(2-x_n)(2x_n+1)}{2(1+x_n^2)}>0.
          \end{aligned}
    $$

    Every factor in the last expression is positive. Equivalently, the quadratic $-2x^2+3x+2=(2-x)(2x+1)$ is positive on $(-1/2,2)$, as shown in [Figure C.18](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw02:concave-parabola).

    [![The quadratic -2x^2+3x+2 is positive between its roots -1/2 and 2.](https://xyzmaths.org/notes/maths-analysis/figures/concave-parabola.svg)](https://xyzmaths.org/notes/maths-analysis/figures/concave-parabola.svg "Open original SVG")

    Figure C.18. The quadratic $-2x^2+3x+2$ is positive between its roots $-1/2$ and $2$.

    Thus $(x_n)_{n\geq1}$ is strictly increasing when $x_0\ne2$. The restriction $n\geq1$ is necessary because if $x_0>2$, the first iterate is below $2$ and hence below $x_0$.

5.  **(e)** *Global convergence.* If $x_0=2$, the sequence is constant and converges to $2$. If $x_0>0$ and $x_0\ne2$, parts (c) and (d) show that $(x_n)_{n\geq1}$ is increasing and bounded above by $2$. The monotone convergence theorem therefore gives a limit. By part (b), with $a=3/2$, this limit is

    $$
    \frac{\tfrac32+\sqrt{(\tfrac32)^2+4}}2
            =\frac{\tfrac32+\tfrac52}2=2.
    $$

    Adding the initial term does not affect convergence, so $x_n\to2$ for every allowed initial state $x_0>0$.

 ◻

### Exercise 1.11.9

The Fibonacci sequence $\{F_n\}$ is defined by

$$
F_0=0,\quad F_1=1,\quad F_n=F_{n-2}+F_{n-1},
    \qquad n=2,3,\ldots.
$$

1.  **(a)** Show that $\{F_n\}$ is an increasing sequence. *Here increasing means nondecreasing.*

2.  **(b)** Show that $\{F_n\}$ is unbounded.

3.  **(c)** Show that the Fibonacci ratios

    $$
    r_n=\frac{F_n}{F_{n-1}},\qquad n=2,3,\ldots,
    $$

    is a bounded sequence.

4.  **(d)** Assume the limit of $\{r_n\}$ exists. Find the limit (which happens to be the golden ratio).

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sets-and-foundations/#ex:hw03:fibonacci-ratios)

*Solution.* For part (a), the initial values and the recurrence show by induction that $F_n\geq0$ for every $n\geq0$, and $F_n\geq1$ for every $n\geq1$. For $n\geq1$, the recurrence gives

$$
F_{n+1}-F_n=F_{n-1}\geq0.
$$

Together with $F_1\geq F_0$, this proves that the sequence is nondecreasing. It is strictly increasing from $F_2$ onward, since $F_{n-1}>0$ when $n\geq2$. The only repeated adjacent values are $F_1=F_2=1$.

For part (b), suppose $(F_n)$ is bounded above. Since it is nondecreasing, the monotone convergence theorem gives $F_n\to L$ as $n\to\infty$. The shifted sequences $F_{n-1}$ and $F_{n-2}$ also tend to $L$, so the recurrence and the limit laws give

$$
L=\lim_{n\to\infty}F_n
      =\lim_{n\to\infty}F_{n-1}+\lim_{n\to\infty}F_{n-2}
      =L+L.
$$

Subtracting $L$ gives $L=0$.

But $F_n\geq1$ for every $n\geq1$, so taking limits gives $L\geq1$. This contradicts $L=0$. Therefore the sequence is unbounded above.

For part (c), the ratios are well defined because their denominators are positive. We have $r_2=1$. For $n\geq3$, substitute the recurrence into the numerator and split the fraction to obtain

$$
\begin{aligned}
    r_n&=\frac{F_n}{F_{n-1}}\\
       &=\frac{F_{n-1}+F_{n-2}}{F_{n-1}}\\
       &=\frac{F_{n-1}}{F_{n-1}}+\frac{F_{n-2}}{F_{n-1}}\\
       &=1+\frac{F_{n-2}}{F_{n-1}}.
  
\end{aligned}
$$

By part (a), we have $0<F_{n-2}\leq F_{n-1}$. Dividing by the positive number $F_{n-1}$ gives

$$
0<\frac{F_{n-2}}{F_{n-1}}\leq1.
$$

Adding $1$ now gives $1<r_n\leq2$. Including $r_2$, we conclude that

$$
\forall n\geq2,\quad 1\leq r_n\leq2.
$$

Thus the ratio sequence is bounded.

For part (d), assume that $r_n\to L$. The bounds above give $1\leq L\leq2$, so $L$ is nonzero.

[![The positive intersection satisfies \\varphi=1+1/\\varphi. Dotted guides locate both coordinates at \\varphi\\approx1.618. The axes use equal units.](https://xyzmaths.org/notes/maths-analysis/figures/golden-ratio-fixed-point.svg)](https://xyzmaths.org/notes/maths-analysis/figures/golden-ratio-fixed-point.svg "Open original SVG")

Figure C.19. The positive intersection satisfies $\varphi=1+1/\varphi$. Dotted guides locate both coordinates at $\varphi\approx1.618$. The axes use equal units.

To express $r_n$ in terms of $r_{n-1}$, recall from part (c) that, for $n\geq3$,

$$
r_n=\frac{F_n}{F_{n-1}}=1+\frac{F_{n-2}}{F_{n-1}}.
$$

The preceding ratio is $r_{n-1}=F_{n-1}/F_{n-2}$. Since both Fibonacci terms are positive, we can take its reciprocal to obtain

$$
\frac{1}{r_{n-1}}
      =\frac{1}{F_{n-1}/F_{n-2}}
      =\frac{F_{n-2}}{F_{n-1}}.
$$

Substituting this into the expression for $r_n$ gives the recurrence

$$
r_n=1+\frac{1}{r_{n-1}},\qquad n\geq3.
$$

The shifted sequence $r_{n-1}$ also tends to $L$. Since $L\neq0$, the limit laws give

$$
L=1+\frac{1}{L}.
$$

Geometrically, $(L,L)$ lies on both $y=x$ and $y=1+1/x$, as shown in [Figure C.19](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw03:golden-ratio-fixed-point). Multiplying by $L$ and bringing all terms to one side gives

$$
L^2=L+1,\qquad L^2-L-1=0.
$$

The two roots are $(1+\sqrt{5})/2$ and $(1-\sqrt{5})/2$. The second is negative and cannot satisfy $L\geq1$. Therefore the assumed limit is the golden ratio

$$
L=\frac{1+\sqrt{5}}{2}=\varphi\approx1.6180339887.
$$

 ◻

The identity $\varphi-1=1/\varphi$ also has a geometric interpretation.

[![A golden rectangle subdivides into squares with side lengths 1,\\varphi^\{-1\},\\varphi^\{-2\},\\ldots. The golden spiral passes through successive corners. Each quarter-turn inward shrinks the distance from its centre by 1/\\varphi. The subdivision continues indefinitely.](https://xyzmaths.org/notes/maths-analysis/figures/golden-rectangle-spiral.svg)](https://xyzmaths.org/notes/maths-analysis/figures/golden-rectangle-spiral.svg "Open original SVG")

Figure C.20. A golden rectangle subdivides into squares with side lengths $1,\varphi^{-1},\varphi^{-2},\ldots$. The golden spiral passes through successive corners. Each quarter-turn inward shrinks the distance from its centre by $1/\varphi$. The subdivision continues indefinitely.

A rectangle with side lengths $1$ and $\varphi$ leaves a smaller, rotated copy of itself when a unit square is removed. Repeating this step gives the squares in [Figure C.20](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw03:golden-rectangle-spiral). The golden spiral winds through their corners, shrinking its distance from the centre by $1/\varphi$ with each quarter-turn ([Duan 2019](https://xyzmaths.org/notes/maths-analysis/references/#ref-Duan2019GoldenSpirals)).

## C.2 Sequences of real numbers

### Exercise 3.1.6

Find the limit

$$
\lim_{n\to\infty}(5n^3-2n+100)^{1/n}.
$$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-of-real-numbers/#ex:hw04:polynomial-root-limit)

*Solution.* We start by taking out a factor of $n^3$ to simplify the term inside the $n$th root. The remaining factor is positive for every $n\ge1$, since $5-2/n^2+100/n^3\ge5-2=3$. We first factor at each $n$ and take limits only after establishing convergence of both factors.

$$
\begin{aligned}
    (5n^3-2n+100)^{1/n}
      &=\left(n^3\left(5-\frac{2}{n^2}+\frac{100}{n^3}\right)\right)^{1/n}\\
      &=(n^3)^{1/n}\left(5-\frac{2}{n^2}+\frac{100}{n^3}\right)^{1/n}.
  
\end{aligned}
$$

Since we know $\lim_{n\to\infty}n^{1/n}=1$,

$$
\lim_{n\to\infty}n^{3/n}
      =\lim_{n\to\infty}(n^{1/n})^3=1^3=1.
$$

Next for the right-side factor, the bounds below hold for $n\ge5$. Indeed,

$$
4<5-\frac{2}{25}
      \le5-\frac{2}{n^2}+\frac{100}{n^3}
      \le5+\frac{100}{125}<6.
$$

$$
\begin{aligned}
    4&<5-\frac{2}{n^2}+\frac{100}{n^3}<6,\\
    4^{1/n}&<\left(5-\frac{2}{n^2}+\frac{100}{n^3}\right)^{1/n}<6^{1/n}.
  
\end{aligned}
$$

Both bounds need only hold on this tail. The bounding sequences have limits

$$
\lim_{n\to\infty}4^{1/n}=1,\quad
    \lim_{n\to\infty}6^{1/n}=1.
$$

Then by the squeeze theorem,

$$
\lim_{n\to\infty}\left(5-\frac{2}{n^2}+\frac{100}{n^3}\right)^{1/n}=1.
$$

Both factor limits now exist, so the product rule applies to the factored expression.

Therefore

$$
\lim_{n\to\infty}(5n^3-2n+100)^{1/n}=1.
$$

 ◻

### Exercise 3.1.7

Find the limit

$$
\lim_{n\to\infty}(a^n+n)^{1/n}
$$

for $0\le a\le1$ and $a>1$, respectively.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-of-real-numbers/#ex:hw04:exponential-root-limit)

*Solution.* *Case $(0\le a\le1)$*. For $n\ge1$, we have $0\le a^n\le1$, including when $a=0$ or $a=1$. Therefore,

$$
n\le a^n+n\le n+1.
$$

For $n\ge1$, $n+1\le2n$, so

$$
\begin{aligned}
    n&\le a^n+n\le n+1\le2n,\\
    n&\le a^n+n\le2n,\\
    n^{1/n}&\le(a^n+n)^{1/n}\le(2n)^{1/n}.
  
\end{aligned}
$$

The parentheses matter here. The entire product $2n$ is inside the root, and

$$
(2n)^{1/n}=2^{1/n}n^{1/n}\longrightarrow1\cdot1=1.
$$

Applying the squeeze property with the limits

$$
\lim_{n\to\infty}n^{1/n}=1,\quad
    \lim_{n\to\infty}(2n)^{1/n}=1
$$

establishes convergence of the middle sequence. The limit over $0\le a\le1$ is $1$.

*Case $(a>1)$*. Since $a^n\ge1$ for $n\ge1$, we have $n\le na^n$. Hence

$$
\begin{aligned}
    a^n&\le a^n+n\le a^n+na^n,\\
    a^n&\le a^n+n\le a^n(1+n),\\
    (a^n)^{1/n}&\le(a^n+n)^{1/n}\le(a^n(1+n))^{1/n},\\
    a&\le(a^n+n)^{1/n}
      \le a(1+n)^{1/n}.
  
\end{aligned}
$$

These are inequalities between terms. We have not yet assumed that the middle sequence converges. Applying the squeeze theorem again, we use

$$
\begin{aligned}
    1&\le n+1\le2n,\\
    1^{1/n}&\le(n+1)^{1/n}\le(2n)^{1/n}.
  
\end{aligned}
$$

Since $(2n)^{1/n}\to1$, it follows that $(n+1)^{1/n}\to1$. The upper bound $a(n+1)^{1/n}$ therefore tends to $a$. Substituting back into the previous inequality, the squeeze property proves

$$
\lim_{n\to\infty}(a^n+n)^{1/n}=a,\quad a>1.
$$

Joining both cases together gives

$$
\lim_{n\to\infty}(a^n+n)^{1/n}
      =\begin{cases}
        1,&0\le a\le1,\\
        a,&a>1.
      \end{cases}
$$

 ◻

### Exercise 3.2.7

Let $a,b\ge0$. Prove the arithmetic mean-geometric mean inequality

$$
\sqrt{ab}\le\frac{a+b}{2}
$$

and deduce the necessary and sufficient condition when the inequality above is strict. (Hint: Consider $(\sqrt a-\sqrt b)^2$.)

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-of-real-numbers/#ex:hw04:two-variable-am-gm)

*Solution.* From the hint, we have

$$
(\sqrt a-\sqrt b)^2=a-2\sqrt{ab}+b.
$$

Since a square is nonnegative,

$$
\begin{aligned}
    (\sqrt a-\sqrt b)^2&\ge0,\\
    a-2\sqrt{ab}+b&\ge0,\\
    a+b&\ge2\sqrt{ab},\\
    \frac{a+b}{2}&\ge\sqrt{ab}.
  
\end{aligned}
$$

Each rearrangement is reversible. Thus

$$
\begin{aligned}
    \frac{a+b}{2}>\sqrt{ab}\quad
      &\Longleftrightarrow\quad
        (\sqrt a-\sqrt b)^2>0\\
      &\Longleftrightarrow\quad \sqrt a\ne\sqrt b\\
      &\Longleftrightarrow\quad a\ne b.
  
\end{aligned}
$$

Therefore the inequality is strict if and only if $a\ne b$. Equality holds exactly when $a=b$, including $a=b=0$. ◻

## C.3 Infinite series of numbers

### Exercise 4.1.4

An alternating series is one of the following form

$$
\sum_{n=0}^{\infty}(-1)^n a_n,
    \qquad
    \begin{gathered}
      a_n\ge0,\quad a_n\ge a_{n+1},\quad n=0,1,2,\ldots;\\
      \lim_{n\to\infty}a_n=0.
    \end{gathered}
$$

Prove that an alternating series converges. (Hint: Use the Cauchy convergence criterion.)

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/infinite-series-of-numbers/#ex:hw04:alternating-series)

*Solution.* Let $m>n\ge0$ and consider the following partial sums.

$$
S_n=\sum_{k=0}^{n}(-1)^k a_k,\quad
    S_m=\sum_{k=0}^{m}(-1)^k a_k.
$$

To prove $(S_n)$ converges we need to show that it satisfies the Cauchy convergence criterion. For every $\varepsilon>0$ we need to find $N\in\mathbb{N}$ such that for $m,n\ge N$,

$$
|S_m-S_n|<\varepsilon.
$$

There are $\ell=m-n$ terms in the finite tail. Put

$$
T=\sum_{j=1}^{\ell}(-1)^{j-1}a_{n+j}.
$$

Its first term is $a_{n+1}$ and its last is $(-1)^{\ell-1}a_m$. This notation keeps the final term explicit, including for short tails.

We start by understanding the nature of the sequence.

$$
\begin{aligned}
    |S_m-S_n|
      &=\left|\sum_{k=0}^{m}(-1)^k a_k-\sum_{k=0}^{n}(-1)^k a_k\right|\\
      &=\left|\sum_{k=n+1}^{m}(-1)^k a_k\right|\\
      &=\left|(-1)^{n+1}T\right|\\
      &=\left|(-1)^{n+1}\right||T|\\
      &=|T|.
  
\end{aligned}
$$

The third equality uses $k=n+j$, so $(-1)^k=(-1)^{n+1}(-1)^{j-1}$. Grouping by the following pairs requires accounting for the parity of the tail.

An empty sum below is zero. If $\ell=2r$ with $r\ge1$, every term is paired. If $\ell=2r+1$ with $r\ge0$, the last term is positive and remains unpaired. Thus

$$
\begin{aligned}
    T&=\sum_{j=1}^{r}(a_{n+2j-1}-a_{n+2j})
      &&\text{if }\ell=2r,\\
    T&=\sum_{j=1}^{r}(a_{n+2j-1}-a_{n+2j})+a_m
      &&\text{if }\ell=2r+1.
  
\end{aligned}
$$

Since $a_n\ge a_{n+1}$, each pair $(a_n-a_{n+1})\ge0$, and any unpaired $a_m$ is also nonnegative. Thus the alternating tail is nonnegative in the sense that $T\ge0$. Now consider a different arrangement of pairs.

Leaving the first term alone and pairing from the second gives

$$
\begin{aligned}
    T&=a_{n+1}-\sum_{j=1}^{r-1}(a_{n+2j}-a_{n+2j+1})-a_m
      &&\text{if }\ell=2r,\\
    T&=a_{n+1}-\sum_{j=1}^{r}(a_{n+2j}-a_{n+2j+1})
      &&\text{if }\ell=2r+1.
  
\end{aligned}
$$

The last term is subtracted in the even case. In the odd case, every term after the first is paired. This includes $\ell=1$, when $r=0$ and $T=a_{n+1}$.

Similarly, each pair $(a_n-a_{n+1})\ge0$, and $a_m\ge0$, so $T\le a_{n+1}$. Since $T\ge0$, we have $|T|=T$. Therefore $|S_m-S_n|$ can be at most $|a_{n+1}|$.

$$
\begin{aligned}
    |S_m-S_n|&\le|a_{n+1}|,\\
    |S_m-S_n|&\le a_{n+1},\quad a_n\ge0.
  
\end{aligned}
$$

Since $\lim_{n\to\infty}a_n=0$, for every $\varepsilon>0$ there exists $N\in\mathbb{N}$ such that $a_n<\varepsilon$ for all $n\ge N$.

Thus, for all $m>n\ge N$,

$$
|S_m-S_n|\le a_{n+1}\le a_n<\varepsilon.
$$

Swapping the indices preserves the absolute difference, and equal indices give zero. Hence the same $\varepsilon$ bound holds for every pair $m,n\ge N$.

Hence $(S_n)$ satisfies the Cauchy convergence criterion and therefore converges in $\mathbb{R}$. Consequently, the alternating series

$$
\sum_{n=0}^{\infty}(-1)^n a_n
$$

converges. ◻

### Exercise 4.2.3

Prove that the telescope series

$$
\sum_{n=1}^{\infty}\left(\frac{1}{\sqrt n}-\frac{1}{\sqrt{n+a}}\right)
$$

converges for any $a>0$ and obtain the sum when $a=1$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/infinite-series-of-numbers/#ex:hw04:shifted-root-series)

*Solution.* Let $a>0$. We first rationalise the difference.

$$
\begin{aligned}
    \frac{1}{\sqrt n}-\frac{1}{\sqrt{n+a}}
      &=\frac{\sqrt{n+a}-\sqrt n}{\sqrt n\sqrt{n+a}}\\
      &=\frac{\sqrt{n+a}-\sqrt n}{\sqrt n\sqrt{n+a}}
        \cdot\frac{\sqrt{n+a}+\sqrt n}{\sqrt{n+a}+\sqrt n}\\
      &=\frac{n+a-n}
        {\sqrt n\sqrt{n+a}(\sqrt{n+a}+\sqrt n)}\\
      &=\frac{a}{\sqrt n(n+a)+n\sqrt{n+a}}.
  
\end{aligned}
$$

Since $n+a>n$, we have $\sqrt{n+a}>\sqrt n$. Thus

$$
n\sqrt{n+a}>n\sqrt n,\qquad
    \sqrt n(n+a)=n\sqrt n+a\sqrt n>n\sqrt n.
$$

Adding these inequalities gives

$$
n\sqrt{n+a}+\sqrt n(n+a)>2n\sqrt n.
$$

Taking reciprocals and multiplying by $a>0$ gives

$$
0<
    \frac{1}{\sqrt n}-\frac{1}{\sqrt{n+a}}
    =\frac{a}{n\sqrt{n+a}+\sqrt n(n+a)}
    <\frac{a}{2n\sqrt n}=\frac{a}{2n^{3/2}}.
$$

Apply this bound to finite partial sums. For every $N\ge1$,

$$
0\le\sum_{n=1}^{N}
      \left(\frac{1}{\sqrt n}-\frac{1}{\sqrt{n+a}}\right)
    \le\frac a2\sum_{n=1}^{N}\frac{1}{n^{3/2}}.
$$

We know that $\sum_{n=1}^{\infty}n^{-p}$ converges whenever $p>1$. Here $p=3/2>1$, so the upper bounding series converges. Therefore the original series also converges by comparison, since its terms are nonnegative.

For $a=1$, the partial sums telescope.

$$
\begin{aligned}
    S_N
      &=\sum_{n=1}^{N}
        \left(\frac{1}{\sqrt n}-\frac{1}{\sqrt{n+1}}\right)\\
      &=\left(1-\frac{1}{\sqrt2}\right)
        +\left(\frac{1}{\sqrt2}-\frac{1}{\sqrt3}\right)
        +\cdots+\left(\frac{1}{\sqrt N}-\frac{1}{\sqrt{N+1}}\right)\\
      &=1-\frac{1}{\sqrt{N+1}}.
  
\end{aligned}
$$

As $N\to\infty$, we have $1/\sqrt{N+1}\to0$. Hence the sum is $1$. ◻

### Exercise 4.2.4

Consider

$$
\sum_{n=1}^{\infty}a_n,\qquad\sum_{n=1}^{\infty}b_n,
$$

where $a_n\ge0$ and $b_n>0$ for $n=1,2,\ldots$. Define

$$
r=\liminf_{n\to\infty}\frac{a_n}{b_n},\qquad
    R=\limsup_{n\to\infty}\frac{a_n}{b_n}.
$$

1.  **(i)** Show that if $r>0$ and $\sum_{n=1}^{\infty}b_n$ diverges, so does $\sum_{n=1}^{\infty}a_n$.

2.  **(ii)** Show that if $R<\infty$ and $\sum_{n=1}^{\infty}b_n$ converges, so does $\sum_{n=1}^{\infty}a_n$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/infinite-series-of-numbers/#ex:hw04:lower-upper-comparison)

*Solution.* Recall the tail infima and suprema of the ratios.

$$
\alpha_n=\inf\left\{\frac{a_j}{b_j}\mid j\ge n\right\},
    \qquad
    \beta_n=\sup\left\{\frac{a_j}{b_j}\mid j\ge n\right\}.
$$

$$
\begin{aligned}
    r&=\sup_n\alpha_n=\lim_{n\to\infty}\alpha_n,\\
    R&=\inf_n\beta_n=\lim_{n\to\infty}\beta_n.
  
\end{aligned}
$$

We can think of $r$ and $R$ as long-term lower and upper bounds with the following precise meaning. A bound strictly below $r$ or strictly above $R$ holds on a sufficiently late tail.

*Part (i).* Since $r>0$, there is $c>0$ with $c<r$. Choose a finite such $c$, also when $r=+\infty$. Since $r=\sup_n\alpha_n$, some $N\in\mathbb{N}$ has $\alpha_N>c$. Thus

$$
\forall n\ge N\quad \frac{a_n}{b_n}\ge c.
$$

Since $b_n>0$, this gives $a_n\ge cb_n$ for every $n\ge N$.

Sum over this tail, where the comparison is known to hold. For $m\ge N$,

$$
\sum_{n=N}^{m}a_n\ge c\sum_{n=N}^{m}b_n.
$$

Removing the first $N-1$ terms does not change divergence.

Since $b_n>0$, its partial sums are increasing and tend to $+\infty$. Therefore the partial sums of $\sum a_n$ also tend to $+\infty$. Hence $\sum_{n=1}^{\infty}a_n$ diverges.

*Part (ii).* Since $R<\infty$, choose $M>R$. The ratios are nonnegative, so $R\ge0$ and $M>0$. Since $R=\inf_n\beta_n$, some $N\in\mathbb{N}$ has $\beta_N<M$. It follows that

$$
\forall n\ge N\quad \frac{a_n}{b_n}\le M,
    \qquad 0\le a_n\le Mb_n.
$$

We know that $\sum_{n=1}^{\infty}b_n=L$ is finite.

Put $A_m=\sum_{n=1}^{m}a_n$. For every $m\ge N$,

$$
\begin{aligned}
    A_m
      &=\sum_{n=1}^{N-1}a_n+\sum_{n=N}^{m}a_n\\
      &\le\sum_{n=1}^{N-1}a_n+M\sum_{n=N}^{m}b_n\\
      &\le\sum_{n=1}^{N-1}a_n+ML.
  
\end{aligned}
$$

The finite prefix is zero when $N=1$. Earlier partial sums are bounded by the same constant because the terms are nonnegative.

This establishes a finite upper bound. Since $a_n\ge0$, the partial sums are monotone nondecreasing. Therefore, by the monotone convergence theorem, $A_m$ tends to a finite limit. Hence $\sum_{n=1}^{\infty}a_n$ converges.

Direct comparison gives the same conclusion on the tail. Adding the finite prefix preserves convergence. ◻

### Exercise 4.2.7

Consider series

$$
\sum_{n=1}^{\infty}a_n,\qquad a_n>0,\quad n=1,2,\ldots.
$$

The following are ratio and root tests for divergence.

1.  **(i)** Define

    $$
    R_1=\liminf_{n\to\infty}\frac{a_{n+1}}{a_n}.
    $$

    Show that if $R_1>1$, then the series diverges.

2.  **(ii)** Define

    $$
    R_2=\liminf_{n\to\infty}(a_n)^{1/n}.
    $$

    Show that if $R_2>1$, then the series diverges.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/infinite-series-of-numbers/#ex:hw04:divergence-tests)

*Solution.* *Part (i).* Suppose $R_1>1$. Choose $L$ such that

$$
1<L<R_1.
$$

By the definition of the lower limit, there is $N\in\mathbb{N}$ such that

$$
\forall n\ge N\quad
    \frac{a_{n+1}}{a_n}>L>1.
$$

Since $a_n>0$, we obtain

$$
a_{n+1}>La_n>a_n.
$$

In other words, $(a_n)$ is strictly increasing from index $N$ onwards. Consequently,

$$
\forall n\ge N\quad a_n\ge a_N>0.
$$

Thus the terms $a_n$ cannot converge to zero. This violates the necessary condition for a convergent series, which requires $a_n\to0$.

To see the contradiction directly, take $\varepsilon=a_N/2$. If $a_n\to0$, there would be $N'\in\mathbb{N}$ such that

$$
\forall n\ge N'\quad
    |a_n-0|<\frac{a_N}{2}.
$$

This would give $a_n<a_N/2$. For $n\ge\max\{N,N'\}$, this contradicts $a_n\ge a_N$. Therefore the series does not converge. [Figure C.21](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw04:divergence-convergence-band) recalls the tail condition used in this contradiction.

[![A convergence-band recall. Beyond N, every term must lie strictly between L-\\varepsilon and L+\\varepsilon. This example has limit L=1; the proof above tests convergence to 0.](https://xyzmaths.org/notes/maths-analysis/figures/convergence-band.svg)](https://xyzmaths.org/notes/maths-analysis/figures/convergence-band.svg "Open original SVG")

Figure C.21. A convergence-band recall. Beyond $N$, every term must lie strictly between $L-\varepsilon$ and $L+\varepsilon$. This example has limit $L=1$; the proof above tests convergence to $0$.

*Part (ii).* Suppose $R_2>1$. Choose $L$ such that

$$
1<L<R_2.
$$

Again, the definition of the lower limit gives $N\in\mathbb{N}$ such that

$$
\forall n\ge N\quad
    (a_n)^{1/n}\ge L.
$$

Raising both sides to the positive integer power $n$ gives $a_n\ge L^n$. Since $L>1$, we have $L^n\to+\infty$. Hence $a_n\to+\infty$, so $a_n$ cannot converge to zero. The necessary term condition therefore shows that $\sum_{n=1}^{\infty}a_n$ diverges. ◻

## C.4 Continuity

### Exercise 5.1.4

Use the definition of a function being continuous at a point, show that if $f(x)$ is continuous at $x_0$, so is the function

$$
g(x)=|f(x)|.
$$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/continuity/#ex:hw05:absolute-value-continuity)

*Solution.* Let $\varepsilon>0$. Since $f$ is continuous at $x_0$, there is a $\delta>0$ such that

$$
|x-x_0|<\delta
      \quad\Longrightarrow\quad |f(x)-f(x_0)|<\varepsilon.
$$

We can use the same $\delta$ for $g(x)=|f(x)|$. The reason is the reverse triangle inequality,

$$
\bigl||u|-|v|\bigr|\le |u-v|,\qquad u,v\in\mathbb{R}.
$$

Taking absolute values cannot increase the distance between two outputs, as illustrated in [Figure C.22](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw05:absolute-value-fold).

[![ Absolute value folds the negative half-line onto the positive half-line. In the illustrated case u\<0\<v\<\|u\|, the original distance is \|u\|+v, while the folded distance is \|u\|-v. Folding brings the two points closer together.](https://xyzmaths.org/notes/maths-analysis/figures/absolute-value-fold.svg)](https://xyzmaths.org/notes/maths-analysis/figures/absolute-value-fold.svg "Open original SVG")

Figure C.22. Absolute value folds the negative half-line onto the positive half-line. In the illustrated case $u<0<v<|u|$, the original distance is $|u|+v$, while the folded distance is $|u|-v$. Folding brings the two points closer together.

Applying the inequality with $u=f(x)$ and $v=f(x_0)$ gives

$$
|g(x)-g(x_0)|
      =\bigl||f(x)|-|f(x_0)|\bigr|
      \le |f(x)-f(x_0)|<\varepsilon
$$

whenever $|x-x_0|<\delta$. Hence $g$ is continuous at $x_0$. ◻

### Exercise 5.1.6

Let $f(x)$ be continuous over $\mathbb{R}$ satisfying the additivity condition

$$
f(s+t)=f(s)+f(t),\qquad s,t\in\mathbb{R}.
$$

Show that there is a constant $a$ such that $f(x)=ax$. (Hint: First prove this when $x$ is an integer and identify what $a$ is. Then prove this when $x$ is rational. Finally pass to limit for any real $x$ by using the denseness of $\mathbb{Q}$ in $\mathbb{R}$.)

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/continuity/#ex:hw05:continuous-additive-function)

*Solution.* Following the hint, we first determine $f$ on the integers, then on the rationals, and finally on all of $\mathbb{R}$. Set $a=f(1)$.

Taking $s=t=0$ in the additivity condition gives

$$
f(0)=f(0)+f(0),\qquad\text{so }f(0)=0.
$$

For any $t\in\mathbb{R}$, we also have

$$
0=f(t+(-t))=f(t)+f(-t),
$$

and therefore $f(-t)=-f(t)$. For a positive integer $m$, repeated addition gives

$$
f(m)=f(\underbrace{1+\cdots+1}_{m\text{ terms}})
      =mf(1)=ma.
$$

Together with $f(0)=0$ and $f(-m)=-f(m)$, this proves $f(m)=am$ for every integer $m$.

Now let $r=m/n$ be rational, where $m\in\mathbb{Z}$ and $n\in\mathbb{N}$. Adding $m/n$ to itself $n$ times gives

$$
nf\left(\frac mn\right)
      =f\left(\underbrace{\frac mn+\cdots+\frac mn}_{n\text{ terms}}\right)
      =f(m)=am.
$$

Dividing by $n$ yields

$$
f\left(\frac mn\right)=a\frac mn.
$$

Thus $f(r)=ar$ for every $r\in\mathbb{Q}$.

Let $x\in\mathbb{R}$ be arbitrary. By the density of $\mathbb{Q}$ in $\mathbb{R}$, there exists a sequence $(q_n)$ of rational numbers such that

$$
q_n\longrightarrow x.
$$

Since $f$ is continuous at $x$, the sequential characterization of continuity gives

$$
\lim_{n\to\infty}f(q_n)=f(x).
$$

But we have already established that $f(q_n)=aq_n$ for every $n$. Therefore,

$$
\begin{aligned}
      \lim_{n\to\infty}f(q_n)
        &=\lim_{n\to\infty}aq_n\\
        &=a\lim_{n\to\infty}q_n\\
        &=ax.
    \end{aligned}
$$

By the uniqueness of limits,

$$
f(x)=ax.
$$

Since $x\in\mathbb{R}$ was arbitrary, we conclude

$$
f(x)=ax,\qquad\forall x\in\mathbb{R},\quad a=f(1).
$$

 ◻

The central insight is that additivity determines $f$ on all rational numbers. Because the rationals are dense in the reals, continuity forces the function to preserve that same linear relationship at every irrational number.

### Exercise 5.1.12

Use the definition of a function being continuous at a point, prove that if $f(x)$ is continuous at $x_0$, $g(y)$ is continuous at $y_0=f(x_0)$, then $h(x)=g(f(x))=(g\circ f)(x)$ is continuous at $x_0$ as well.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/continuity/#ex:hw05:composition-continuity)

*Solution.* Let $\varepsilon>0$. Our goal is to make $|g(f(x))-g(f(x_0))|<\varepsilon$ by taking $x$ sufficiently close to $x_0$. We first find how close $f(x)$ must be to $f(x_0)$.

Write $y_0=f(x_0)$. Since $g$ is continuous at $y_0$, there is an $\eta>0$ such that

$$
|y-y_0|<\eta
      \quad\Longrightarrow\quad |g(y)-g(y_0)|<\varepsilon.
$$

Since $f$ is continuous at $x_0$, there is a $\delta>0$ such that

$$
|x-x_0|<\delta
      \quad\Longrightarrow\quad |f(x)-f(x_0)|<\eta.
$$

The choices are made in this order because the tolerance $\eta$ for $f$ comes from the continuity of $g$. [Figure C.23](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw05:composition-neighbourhoods) illustrates the two steps.

[![ Schematic neighbourhoods for a composition. First choose \\eta to reach the required output tolerance \\varepsilon. Then choose \\delta to reach that intermediate tolerance \\eta. The arrows show the order in which inputs pass through the maps.](https://xyzmaths.org/notes/maths-analysis/figures/composition-neighbourhoods.svg)](https://xyzmaths.org/notes/maths-analysis/figures/composition-neighbourhoods.svg "Open original SVG")

Figure C.23. Schematic neighbourhoods for a composition. First choose $\eta$ to reach the required output tolerance $\varepsilon$. Then choose $\delta$ to reach that intermediate tolerance $\eta$. The arrows show the order in which inputs pass through the maps.

If $|x-x_0|<\delta$, the second implication places $y=f(x)$ within $\eta$ of $y_0$. Applying the first implication with this value of $y$ gives

$$
|h(x)-h(x_0)|
      =|g(f(x))-g(f(x_0))|<\varepsilon.
$$

This is the definition of continuity of $h=g\circ f$ at $x_0$. ◻

### Exercise 5.2.2

Let $f(x)$ be continuous over $\mathbb{R}$ and satisfy the “coercive” condition:

$$
f(x)\ge a|x|-b,\qquad x\in\mathbb{R},
$$

where $a>0$ and $b>0$ are two constants.

1.  **(a)** Show that $\inf f$ exists.

2.  **(b)** Show that $f$ attains $\inf f$ somewhere at $x_0\in\mathbb{R}$. That is, there is some $x_0$ such that

    $$
    f(x_0)=\inf f.
    $$

    Such a point $x_0$ is called a global minimum point of $f$ over $\mathbb{R}$.

(Hint: Let $\{x_n\}$ be a sequence such that

$$
f(x_n)\to\inf f\quad\text{as }n\to\infty.
$$

Show that $\{x_n\}$ contains a convergent subsequence.)

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/continuity/#ex:hw05:coercive-minimum)

*Solution.* *(a)* Since $a|x|\ge0$ for every $x\in\mathbb{R}$, the given bound implies

$$
f(x)\ge a|x|-b\ge-b.
$$

Thus the range $f(\mathbb{R})$ is bounded below. It is nonempty because it contains $f(0)$. By completeness of $\mathbb{R}$, its infimum exists as a real number. Write

$$
m=\inf f(\mathbb{R}),\qquad -b\le m\le f(0).
$$

*(b)* We follow the hint by choosing inputs whose outputs approach $m$. By the defining property of the infimum, for every $n\in\mathbb{N}$ there is an $x_n\in\mathbb{R}$ such that

$$
m\le f(x_n)<m+\frac1n.
$$

Indeed, if no such point existed, $m+1/n$ would be a lower bound for $f(\mathbb{R})$ larger than $m$. These inequalities give $f(x_n)\to m$.

We next show that the inputs $x_n$ stay in a bounded interval. Combining the coercive bound with the choice of $x_n$ gives

$$
\begin{aligned}
    a|x_n|-b&\le f(x_n)<m+\frac1n\le m+1,\\
    a|x_n|&<m+b+1,\\
    |x_n|&<\frac{m+b+1}{a}.
  
\end{aligned}
$$

Since $m\ge-b$ and $a>0$, the number $R=(m+b+1)/a$ is positive and finite. Thus $(x_n)$ is contained in $[-R,R]$. The coercive bound prevents inputs with nearly minimal outputs from escaping to infinity, as illustrated in [Figure C.24](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw05:coercive-minimum).

[![ An example with f(x)=1+x^2 and the lower bound \|x\|-1. Here m=1. If f(x)\<m+1=2, the lower bound forces \|x\|\<3. The indicated points approach the minimum inside this bounded interval.](https://xyzmaths.org/notes/maths-analysis/figures/coercive-minimum.svg)](https://xyzmaths.org/notes/maths-analysis/figures/coercive-minimum.svg "Open original SVG")

Figure C.24. An example with $f(x)=1+x^2$ and the lower bound $|x|-1$. Here $m=1$. If $f(x)<m+1=2$, the lower bound forces $|x|<3$. The indicated points approach the minimum inside this bounded interval.

By the Bolzano–Weierstrass theorem, there is a subsequence $(x_{n_k})$ converging to some $x_0\in\mathbb{R}$. Continuity of $f$ at $x_0$ gives

$$
f(x_{n_k})\longrightarrow f(x_0).
$$

But the same subsequence satisfies

$$
m\le f(x_{n_k})<m+\frac1{n_k},
$$

so $f(x_{n_k})\to m$ as $n_k\to\infty$. By uniqueness of limits, $f(x_0)=m=\inf f(\mathbb{R})$. Hence $f$ attains its global minimum. ◻

### Exercise 5.3.3

Let $F(x)$ be a continuous function which maps the interval $[a,b]$ into itself. Prove that $F$ has a fixed point in $[a,b]$. That is, there is some $c\in[a,b]$ such that $F(c)=c$. Use your result to prove that for any $n\in\mathbb{N}$ there is some $x\in(0,1)$ such that

$$
x=\frac{1}{1+x^n}.
$$

Find $x$ for $n=1$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/continuity/#ex:hw05:interval-fixed-point)

*Solution.* A fixed point is a point where $F(x)$ and $x$ have the same value. To find one, consider their difference,

$$
G(x)=F(x)-x.
$$

This function is continuous on $[a,b]$. Since $F$ maps $[a,b]$ into itself, $F(a)\ge a$ and $F(b)\le b$. Hence

$$
G(a)\ge0,\qquad G(b)\le0.
$$

If either value is zero, the corresponding endpoint is a fixed point. Otherwise $G(a)>0>G(b)$, so the intermediate value theorem gives a $c\in(a,b)$ with $G(c)=0$. Thus $F(c)=c$. This also covers a one-point interval, since then $F(a)=a$.

Now fix $n\in\mathbb{N}$ and define

$$
F_n(x)=\frac{1}{1+x^n},\qquad x\in[0,1].
$$

The denominator is positive on this interval, so $F_n$ is continuous. Also $0\le x^n\le1$, which gives

$$
\frac12\le F_n(x)\le1.
$$

Therefore $F_n$ maps $[0,1]$ into itself. By the result just proved, it has a fixed point $c\in[0,1]$. Neither endpoint is fixed, since $F_n(0)=1$ and $F_n(1)=1/2$. Consequently $c\in(0,1)$ and

$$
c=\frac{1}{1+c^n}.
$$

[Figure C.25](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw05:interval-fixed-point) shows the intersection when $n=1$.

[![ For n=1, the graph y=1/(1+x) crosses y=x inside the unit square. At the crossing, the input equals its output.](https://xyzmaths.org/notes/maths-analysis/figures/interval-fixed-point.svg)](https://xyzmaths.org/notes/maths-analysis/figures/interval-fixed-point.svg "Open original SVG")

Figure C.25. For $n=1$, the graph $y=1/(1+x)$ crosses $y=x$ inside the unit square. At the crossing, the input equals its output.

When $n=1$, multiplying by $1+c>0$ gives

$$
\begin{aligned}
    c=\frac{1}{1+c}
      &\iff c(1+c)=1\\
      &\iff c^2+c-1=0\\
      &\iff c=\frac{-1+\sqrt5}{2}
        \quad\text{or}\quad c=\frac{-1-\sqrt5}{2}.
  
\end{aligned}
$$

Only the first value belongs to $(0,1)$. Hence the required value is $c=(\sqrt5-1)/2$. ◻

### Exercise 5.3.4

Show that if the highest degree term of a polynomial is odd powered, then it must have a real root.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/continuity/#ex:hw05:odd-polynomial-root)

*Solution.* Let

$$
p(x)=a_mx^m+a_{m-1}x^{m-1}+\cdots+a_0,
$$

where $m$ is odd and $a_m\ne0$. Dividing by $a_m$ does not change the roots, so we work with

$$
q(x)=\frac{p(x)}{a_m}
      =x^m+b_{m-1}x^{m-1}+\cdots+b_0.
$$

We want to choose two inputs where the leading term is larger in absolute value than all the remaining terms together.

Set $C=\sum_{k=0}^{m-1}|b_k|$. For $|x|\ge1$, every power $|x|^k$ with $k\le m-1$ is at most $|x|^{m-1}$. The triangle inequality therefore gives

$$
\left|\sum_{k=0}^{m-1}b_kx^k\right|
      \le\sum_{k=0}^{m-1}|b_k||x|^k
      \le C|x|^{m-1}.
$$

Choose $R>\max\{1,C\}$. Since $m$ is odd, $(-R)^m=-R^m$. Applying the bound at $R$ and $-R$, we obtain

$$
\begin{aligned}
    q(R)&\ge R^m-CR^{m-1}
      =R^{m-1}(R-C)>0,\\
    q(-R)&\le -R^m+CR^{m-1}
      =-R^{m-1}(R-C)<0.
  
\end{aligned}
$$

The polynomial $q$ is continuous on $[-R,R]$. By the intermediate value theorem, there is a $c\in(-R,R)$ such that $q(c)=0$. Since $p(c)=a_mq(c)$, we also have $p(c)=0$. ◻

### Exercise 5.4.3

Let $f(x)$ be a continuous function over an interval $I$, with finite endpoints $a,b$, which may or may not be closed. Prove that if $f(x)$ is uniformly continuous over $I$, then $f$ is bounded. With this result, show that the function

$$
f(x)=\frac{1}{1+x},\qquad x\in(-1,1)
$$

is continuous but not uniformly continuous.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/continuity/#ex:hw05:uniform-continuity-boundedness)

*Solution.* **Claim.** Let $I\subseteq \mathbb{R}$ be an interval with finite endpoints $a$, $b$. If $f: I \rightarrow \mathbb{R}$ is uniformly continuous then $f$ is bounded on $I$.

Suppose $f$ is uniformly continuous on $I$. By definition, for every $\varepsilon > 0$ there is a $\delta > 0$ such that

$$
\forall x,y \in I,\quad |x - y| < \delta \implies |f(x) - f(y)| < \varepsilon.
$$

Choose $\varepsilon = 1$. Then there exists a $\delta > 0$ such that

$$
|x - y| < \delta \implies |f(x) - f(y)| < 1.
$$

Our goal is to show that there exists a finite constant $M > 0$ such that

$$
|f(x)| \le M,\quad \forall x \in I.
$$

If $I$ is empty, the claim is immediate. Otherwise, fix $x_0\in I$ once and for all.

Since $a$ and $b$ are finite endpoints, we consider an arbitrary point $x\in I$. We will connect $x_0$ to $x$ by $N$ steps, each shorter than $\delta$. Uniform continuity then bounds each output change by $1$.

[Figure C.26](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw05:uniform-continuity-chain) illustrates the finite chain of small steps.

[![ A schematic chain inside I, with the open-interval case shown. Every successive gap is less than \\delta, so each corresponding output change is less than 1. The dots omit intermediate steps in the finite chain.](https://xyzmaths.org/notes/maths-analysis/figures/uniform-continuity-chain.svg)](https://xyzmaths.org/notes/maths-analysis/figures/uniform-continuity-chain.svg "Open original SVG")

Figure C.26. A schematic chain inside $I$, with the open-interval case shown. Every successive gap is less than $\delta$, so each corresponding output change is less than $1$. The dots omit intermediate steps in the finite chain.

Since $I\subseteq[a,b]$, taking $N$ equally spaced steps between $x_0$ and $x$ makes each step no longer than

$$
\dfrac{b - a}{N}.
$$

To apply the uniform-continuity bound at each step, choose $N$ so that

$$
\dfrac{b - a}{N} < \delta \iff \dfrac{b - a}{\delta} < N.
$$

Since $b - a$ and $\delta$ are both fixed, we can select an integer $N\ge2$ that works for every pair of points in $I$.

Such an integer exists by the Archimedean property. Set

$$
x_k=x_0+\frac{k}{N}(x-x_0),\qquad k=0,\ldots,N.
$$

Each $x_k$ lies between $x_0$ and $x$, so it belongs to $I$ because $I$ is an interval. For $k=1,\ldots,N$,

$$
|x_k-x_{k-1}|=\frac{|x-x_0|}{N}
  \le\frac{b-a}{N}<\delta.
$$

Uniform continuity therefore gives $|f(x_k)-f(x_{k-1})|<1$ at every step. This construction also works when $x\le x_0$.

The output changes telescope along the chain,

$$
f(x)-f(x_0)=f(x_N)-f(x_0)
    =\sum_{k=1}^N\bigl(f(x_k)-f(x_{k-1})\bigr).
$$

The triangle inequality and the bound of $1$ at every step give

$$
|f(x)-f(x_0)|
    \le\sum_{k=1}^N|f(x_k)-f(x_{k-1})|<N.
$$

Taking one more triangle inequality yields

$$
|f(x)|\le |f(x)-f(x_0)|+|f(x_0)|<N+|f(x_0)|.
$$

Set $M=N+|f(x_0)|>0$.

Both $N$ and $x_0$ are fixed, so $M$ does not depend on $x$. Since $N$ and $|f(x_0)|$ are both finite, $f$ is bounded on $I$. Therefore we have proved that if $f$ is uniformly continuous over $I$, then it is bounded.

For $f(x)=1/(1+x)$ on $(-1,1)$, we will prove continuity and unboundedness. The contrapositive of the claim will then rule out uniform continuity on this bounded interval.

[Figure C.27](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw05:unbounded-reciprocal) shows the graph near the excluded endpoint $-1$.

[![ The graph of f(x)=1/(1+x) on (-1,1) rises without bound as x approaches -1 from the right. The dashed line is the vertical asymptote. The open point at (1,1/2) is also excluded from the graph.](https://xyzmaths.org/notes/maths-analysis/figures/unbounded-reciprocal.svg)](https://xyzmaths.org/notes/maths-analysis/figures/unbounded-reciprocal.svg "Open original SVG")

Figure C.27. The graph of $f(x)=1/(1+x)$ on $(-1,1)$ rises without bound as $x$ approaches $-1$ from the right. The dashed line is the vertical asymptote. The open point at $(1,1/2)$ is also excluded from the graph.

The numerator $1$ and denominator $1+x$ are continuous, and $1+x>0$ on $(-1,1)$. The quotient of two continuous functions is continuous wherever the denominator is not equal to zero, so for $x \in (-1, 1)$ the function $f(x)$ is continuous.

At the excluded left endpoint,

$$
\lim_{x \rightarrow -1^+} \dfrac{1}{1 + x} = +\infty.
$$

This means that there is no finite upper bound for $f$ on $(-1,1)$. More explicitly, for any $B>0$, choose an integer $n>\max\{B,1\}$. Then

$$
x_n=-1+\frac1n\in(-1,1),\qquad
  f(x_n)=\frac{1}{1+x_n}=n>B.
$$

Thus $f$ is unbounded on $(-1,1)$.

By the contrapositive of the above claim, if $f$ is not bounded, then it cannot be uniformly continuous over $(-1,1)$. ◻

### Exercise 5.4.4

Show that the function $f(x)=x^2$ is not uniformly continuous over $\mathbb{R}$ and explain what goes “wrong”.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/continuity/#ex:hw05:square-not-uniformly-continuous)

*Solution.* To disprove uniform continuity, we need one fixed output tolerance that no single input tolerance can guarantee over all of $\mathbb{R}$. Choose $\varepsilon_0=1$.

Let $\delta>0$ be arbitrary. By the Archimedean property, choose $n\in\mathbb{N}$ with $n>1/\delta$, and set

$$
x_n=n,\qquad y_n=n+\frac1n.
$$

These inputs are less than $\delta$ apart, since

$$
|y_n-x_n|=\frac1n<\delta.
$$

However, their outputs satisfy

$$
\begin{aligned}
    |f(y_n)-f(x_n)|
      &=\left(n+\frac1n\right)^2-n^2\\
      &=n^2+2+\frac1{n^2}-n^2\\
      &=2+\frac1{n^2}>1=\varepsilon_0.
  
\end{aligned}
$$

Thus every $\delta>0$ fails for the same $\varepsilon_0=1$, so $f$ is not uniformly continuous on $\mathbb{R}$.

What goes wrong is visible in the factorisation

$$
|y^2-x^2|=|y-x||y+x|.
$$

Even when $|y-x|$ is small, the factor $|y+x|$ can be arbitrarily large. In our construction the inputs get closer together as they move to the right, while the output gap stays above $2$. [Figure C.28](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw05:square-output-gap) shows one pair from this sequence.

[![ A local view of y=x^2 for the pair x\_n=n, y\_n=n+1/n when n=3. A horizontal gap of 1/n produces a vertical gap of 2+1/n^2. The two axes use different scales.](https://xyzmaths.org/notes/maths-analysis/figures/square-output-gap.svg)](https://xyzmaths.org/notes/maths-analysis/figures/square-output-gap.svg "Open original SVG")

Figure C.28. A local view of $y=x^2$ for the pair $x_n=n$, $y_n=n+1/n$ when $n=3$. A horizontal gap of $1/n$ produces a vertical gap of $2+1/n^2$. The two axes use different scales.

 ◻

### Exercise 5.4.5

Consider a function $f(x)$ over $\mathbb{R}$. We say that $f(x)$ is Lipschitzian if there is a constant $L>0$ such that

$$
|f(x)-f(y)|\le L|x-y|,\qquad x,y\in\mathbb{R}.
$$

Here $L$ is called the Lipschitz constant of $f$.

1.  **(a)** Prove that a Lipschitz function is uniformly continuous over the entire $\mathbb{R}$.

2.  **(b)** Consider the function

    $$
    f(x)=\frac{1}{1+x^2},\qquad x\in\mathbb{R}.
    $$

    Show that this function is Lipschitzian and estimate its Lipschitzian constant.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/continuity/#ex:hw05:lipschitz-continuity)

*Solution.* *(a)* Let $\varepsilon>0$ and choose $\delta=\varepsilon/L$. Since $L>0$, we have $\delta>0$. For any $x,y\in\mathbb{R}$,

$$
|x-y|<\delta
      \quad\Longrightarrow\quad
      |f(x)-f(y)|\le L|x-y|<L\delta=\varepsilon.
$$

The same $\delta$ works for every pair $x,y$, so $f$ is uniformly continuous on $\mathbb{R}$.

*(b)* For $f(x)=1/(1+x^2)$, we first subtract the fractions and factor the numerator,

$$
\begin{aligned}
    |f(x)-f(y)|
      &=\left|\frac{1}{1+x^2}-\frac{1}{1+y^2}\right|\\
      &=\frac{|y^2-x^2|}{(1+x^2)(1+y^2)}\\
      &=|x-y|\frac{|x+y|}{(1+x^2)(1+y^2)}.
  
\end{aligned}
$$

It remains to bound the last fraction independently of $x$ and $y$. For any $t\in\mathbb{R}$, the inequality $(|t|-1)^2\ge0$ gives

$$
t^2-2|t|+1\ge0,
    \qquad\text{so}\qquad |t|\le\frac{1+t^2}{2}.
$$

Applying this to both $x$ and $y$, we obtain

$$
\begin{aligned}
    \frac{|x+y|}{(1+x^2)(1+y^2)}
      &\le\frac{|x|+|y|}{(1+x^2)(1+y^2)}\\
      &\le\frac{(1+x^2)+(1+y^2)}{2(1+x^2)(1+y^2)}\\
      &=\frac{1}{2(1+y^2)}+\frac{1}{2(1+x^2)}\\
      &\le\frac12+\frac12=1.
  
\end{aligned}
$$

Therefore

$$
|f(x)-f(y)|\le |x-y|,\qquad x,y\in\mathbb{R}.
$$

Thus $f$ is Lipschitz with $L=1$. The estimate proves the required property without finding the smallest possible constant. By part (a), $f$ is also uniformly continuous on $\mathbb{R}$. ◻

## C.5 Differentiation and its applications

### Exercise 6.1.6

Consider the function

$$
f(x)=\begin{cases}
      \displaystyle\frac{x}{1+e^{1/x}},&x\ne0,\\[4pt]
      0,&x=0.
    \end{cases}
$$

1.  **(i)** Show that $f$ is continuous at $x=0$.

2.  **(ii)** Find the left- and right-derivatives of $f$ at $x=0$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:one-sided-derivatives)

*Solution.* Part (i). Recall that continuity at $c$ is defined by

$$
\lim_{x\to c}f(x)=f(c).
$$

We want to prove that $\lim_{x\to0}f(x)=0=f(0)$. Analyzing both left and right sides, where $x\to0^-$ and $x\to0^+$ respectively, we have

$$
0\le\frac{x}{1+e^{1/x}}\le x
    \qquad(x>0).
$$

By the squeeze theorem,

$$
\lim_{x\to0^+}\frac{x}{1+e^{1/x}}=0.
$$

For $x\to0^-$ the inequality is reversed,

$$
x\le\frac{x}{1+e^{1/x}}\le0,
$$

and similarly, by the squeeze theorem,

$$
\lim_{x\to0^-}\frac{x}{1+e^{1/x}}=0.
$$

Therefore, since

$$
\lim_{x\to0^-}\frac{x}{1+e^{1/x}}
      =\lim_{x\to0^+}\frac{x}{1+e^{1/x}}=0,
$$

$f$ is continuous at $x=0$.

For part (ii), recall that to find $f_-'(0)$ and $f_+'(0)$ we use the definitions of the left- and right-side derivatives,

$$
\begin{aligned}
      f_+'(c)&=\lim_{h\to0^+}\frac{f(c+h)-f(c)}{h},\\
      f_-'(c)&=\lim_{h\to0^-}\frac{f(c+h)-f(c)}{h}.
    \end{aligned}
$$

[Figure C.29](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw07:one-sided-slopes) shows why continuity can hold even though these two slopes differ.

[![ The graph meets the origin continuously. Its left tangent is y=x, while its right tangent is y=0. The two limiting slopes are 1 and 0.](https://xyzmaths.org/notes/maths-analysis/figures/one-sided-slopes.svg)](https://xyzmaths.org/notes/maths-analysis/figures/one-sided-slopes.svg "Open original SVG")

Figure C.29. The graph meets the origin continuously. Its left tangent is $y=x$, while its right tangent is $y=0$. The two limiting slopes are $1$ and $0$.

Starting with the left limit,

$$
\begin{aligned}
      f_-'(0)
        &=\lim_{h\to0^-}\frac{f(h)-f(0)}{h}\\
        &=\lim_{h\to0^-}
          \frac{\frac{h}{1+e^{1/h}}-f(0)}{h}\\
        &=\lim_{h\to0^-}\frac{\frac{h}{1+e^{1/h}}}{h}\\
        &=\lim_{h\to0^-}\frac1{1+e^{1/h}}.
    \end{aligned}
$$

Since $h\to0^-$ implies $e^{1/h}\to0$, we have $f_-'(0)=1$.

Similarly, $f_+'(0)=0$, since

$$
h\to0^+
      \quad\Longrightarrow\quad \frac1h\to+\infty
      \quad\Longrightarrow\quad e^{1/h}\to+\infty
      \quad\Longrightarrow\quad \frac1{1+e^{1/h}}\to0.
$$

Therefore, since $f_-'(0)\ne f_+'(0)$, $f'(0)$ is undefined. ◻

### Exercise 6.1.10

For $x>0$, find $(x^x)'$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:self-power-derivative)

*Solution.* Let $x^x=e^{\ln(x^x)}$ for $x>0$. Then

$$
\begin{aligned}
      (x^x)'&=\left(e^{\ln(x^x)}\right)'\\
        &=\left(e^{x\ln x}\right)'\\
        &=e^{\ln(x^x)}(x\ln x)'\\
        &=x^x\left(x\times\frac1x+1\times\ln x\right)\\
        &=x^x(1+\ln x).
    \end{aligned}
$$

 ◻

### Exercise 6.2.2

Let $P(x)=\sum_{k=0}^n a_kx^k$ satisfy

$$
a_0+\frac{a_1}{2}+\cdots+\frac{a_n}{n+1}=0.
$$

Show that there is a point $x\in(0,1)$ such that $P(x)=0$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:polynomial-rolle)

*Solution.* Since $P(x)$ represents a polynomial with real coefficients,

$$
P(x)=a_0+a_1x+\cdots+a_nx^n,
$$

it is differentiable and continuous. If $P(0)=P(1)$, Rolle’s theorem would give a point $x\in(0,1)$ with $P'(x)=0$. However, we are interested in $P(x)=0$, so we can construct an auxiliary polynomial $F(x)$ such that $F'(x)=P(x)$.

Since $F(x)$ is a polynomial, it is continuous on $[0,1]$ and differentiable on $(0,1)$. If we can establish that $F(0)=F(1)$, Rolle’s theorem guarantees some $x\in(0,1)$ satisfying $F'(x)=0$ and therefore $P(x)=0$.

For the derivative of $F(x)$ to be equal to $P(x)$, we can select terms by inverting the power rule $(x^n)'=nx^{n-1}$,

$$
F(x)=a_0x+\frac{a_1}{2}x^2+\cdots+
      \frac{a_n}{n+1}x^{n+1}+C,\qquad C\in\mathbb{R}.
$$

Evaluating $F(x)$ at both endpoints gives

$$
\begin{aligned}
      F(0)&=C,\\
      F(1)&=\underbrace{a_0+\frac{a_1}{2}+\cdots+
        \frac{a_n}{n+1}}_{=0}+C.
    \end{aligned}
$$

Thus $F(0)=F(1)=C$. By Rolle’s theorem, there exists $x\in(0,1)$ such that $F'(x)=0$. Since $F'(x)=P(x)$, we conclude that $P(x)=0$, as required. ◻

### Exercise 6.2.5

Let $f$ be a differentiable function over $\mathbb{R}$.

1.  **(i)** Show that if $f'(x)$ is a bounded function, then $f$ is a Lipschitz function which satisfies

    $$
    |f(x)-f(y)|\le L|x-y|,\qquad x,y\in\mathbb{R},
    $$

    where $L>0$ is a constant called the Lipschitz constant.

2.  **(ii)** If the Lipschitz constant in (i) satisfies $L<1$, the function is called “contractive”. Prove that a contractive function must have a fixed point $x^*$ such that $x^*=f(x^*)$. (Hint: Take any $x_0\in\mathbb{R}$ and consider the iterative sequence $x_n=f(x_{n-1})$ for $n=1,2,\ldots$.)

3.  **(iii)** Show that the fixed point $x^*$ found in (ii) is unique.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:contractive-fixed-point)

*Solution.* Part (i). Since $f'$ is bounded, $|f'(x)|\le M$ for some $M\ge0$ and every $x\in\mathbb{R}$. The function $f$ is differentiable over $\mathbb{R}$, so it is continuous there. Thus, we apply the mean value theorem over the interval $[y,x]$, where $x,y\in\mathbb{R}$ and $x>y$, and choose a $c\in(y,x)$ such that

$$
f'(c)=\frac{f(x)-f(y)}{x-y}.
$$

Choose $L=M+1>0$ to satisfy $L>0$. Since $|f'(c)|\le M<L$, we obtain

$$
\begin{aligned}
      |f'(c)|=\left|\frac{f(x)-f(y)}{x-y}\right|
        &\implies \left|\frac{f(x)-f(y)}{x-y}\right|\le L\\
        &\implies |f(x)-f(y)|\le L|x-y|.
    \end{aligned}
$$

If $x<y$, interchange the two inputs. If $x=y$, both sides are zero. Thus the inequality holds for every $x,y\in\mathbb{R}$.

Part (ii). Take any $x_0\in\mathbb{R}$ and define $x_{n+1}=f(x_n)$ for $n\ge0$. Consider the following, where $x_0,\ldots,x_3\in\mathbb{R}$,

$$
\begin{aligned}
      x_3&=f(x_2),\\
      x_2&=f(x_1),\\
      x_1&=f(x_0).
    \end{aligned}
$$

Assuming a Lipschitz constant satisfying $0<L<1$ exists, we can apply the inequality from part (i). For this part, $L$ denotes the constant in the contraction hypothesis.

$$
\begin{aligned}
      |f(x_2)-f(x_1)|\le L|x_2-x_1|
        &\implies |x_3-x_2|\le L|x_2-x_1|,\\
      |f(x_1)-f(x_0)|\le L|x_1-x_0|
        &\implies |x_2-x_1|\le L|x_1-x_0|\\
        &\implies |x_3-x_2|\le L^2|x_1-x_0|.
    \end{aligned}
$$

Repeated application of the contraction inequality yields

$$
|x_{n+1}-x_n|\le L^n|x_1-x_0|,
    \qquad n\ge0.
$$

Suppose $0<L<1$. Then

$$
|x_1-x_0|\ge |x_2-x_1|\ge |x_3-x_2|,
$$

which implies that each successive step is no larger than the previous one. [Figure C.30](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw07:contractive-steps) illustrates shrinking steps that alternate around a fixed point.

[![ For f(t)=1-t/2 and x\_0=0, the filled points are x\_0,x\_1,x\_2,x\_3. The open point is the fixed point x^\*=2/3. From top to bottom, the arrows show successive steps of lengths 1, 1/2, and 1/4, with alternating directions.](https://xyzmaths.org/notes/maths-analysis/figures/contractive-steps.svg)](https://xyzmaths.org/notes/maths-analysis/figures/contractive-steps.svg "Open original SVG")

Figure C.30. For $f(t)=1-t/2$ and $x_0=0$, the filled points are $x_0,x_1,x_2,x_3$. The open point is the fixed point $x^*=2/3$. From top to bottom, the arrows show successive steps of lengths $1$, $1/2$, and $1/4$, with alternating directions.

It follows that the total distance from start to finish is less than or equal to the sum of all steps,

$$
|x_3-x_0|\le |x_3-x_2|+\cdots+|x_1-x_0|.
$$

Generalizing this for arbitrary $m>n$ gives the following calculation. For tails shorter than four steps, retain only the increments with indices $n\le k<m$ in the expanded list.

$$
\begin{aligned}
      |x_m-x_n|
        &\le |x_m-x_{m-1}|+\cdots+|x_{n+3}-x_{n+2}|\\
        &\qquad+|x_{n+2}-x_{n+1}|+|x_{n+1}-x_n|\\
        &=\sum_{k=n}^{m-1}|x_{k+1}-x_k|\\
        &\le\sum_{k=n}^{m-1}L^k|x_1-x_0|\\
        &=|x_1-x_0|\sum_{k=n}^{m-1}L^k\\
        &=|x_1-x_0|\frac{L^n-L^m}{1-L}\\
        &\le |x_1-x_0|\frac{L^n}{1-L}
          \qquad(L^m>0)\\
        &=\frac{|x_1-x_0|}{1-L}L^n.
    \end{aligned}
$$

The final bound is independent of $m$. Taking the limit as $n\to\infty$, we have

$$
\lim_{n\to\infty}\frac{|x_1-x_0|}{1-L}L^n=0,
    \qquad 0<L<1.
$$

Hence, for every $\epsilon>0$, there exists $N\in\mathbb{N}$ such that

$$
\frac{|x_1-x_0|}{1-L}L^n<\epsilon
    \qquad\forall n\ge N.
$$

Consequently, for every $m>n\ge N$,

$$
|x_m-x_n|<\epsilon,
$$

establishing $(x_n)$ as a Cauchy sequence over $\mathbb{R}$. The same bound for $m<n$ follows by interchanging the indices, and $m=n$ gives zero. By the Cauchy completeness theorem in $\mathbb{R}$, there exists $x^*\in\mathbb{R}$ such that $x_n\to x^*$. Finally, since $f$ is continuous and $x_n=f(x_{n-1})$, taking $n\to\infty$ gives

$$
\begin{aligned}
      x^*&=\lim_{n\to\infty}x_n\\
        &=\lim_{n\to\infty}f(x_{n-1})\\
        &=f\left(\lim_{n\to\infty}x_{n-1}\right)\\
        &=f(x^*).
    \end{aligned}
$$

Therefore, $x^*$ is a fixed point of $f$.

For part (iii), assume there are two distinct fixed points $x^*=f(x^*)$ and $y^*=f(y^*)$. Applying the contraction inequality gives

$$
\begin{aligned}
      |f(x^*)-f(y^*)|
        &\le L|x^*-y^*|,\qquad 0<L<1\\
      \implies |x^*-y^*|
        &\le L|x^*-y^*|.
    \end{aligned}
$$

Since $x^*\ne y^*$, we have $|x^*-y^*|>0$, so we can divide both sides by $|x^*-y^*|$ to give $L\ge1$, which contradicts $L<1$. Therefore, two distinct fixed points cannot exist and the fixed point $x^*$ is unique. ◻

### Exercise 6.2.6

Let $a>1$. Show that for all $x\ge0$, we have

$$
\frac1{1+x}-\frac1{1+ax}\le\frac{\sqrt a-1}{\sqrt a+1},
$$

with equality only for $x=1/\sqrt a$.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:rational-maximum)

*Solution.* Let

$$
f(x)=\frac1{1+x}-\frac1{1+ax},
    \qquad x\ge0,\quad a>1.
$$

To find the global maximum $x^*$ such that $f(x)\le f(x^*)$, first consider $f'(x^*)=0$,

$$
\begin{aligned}
      f'(x)&=\frac{a}{(1+ax)^2}-\frac1{(1+x)^2}\\[6pt]
        &=\frac{a(1+x)^2-(1+ax)^2}{(1+ax)^2(1+x)^2}\\[6pt]
        &=\frac{(a-1)(1-ax^2)}{(1+ax)^2(1+x)^2}.
    \end{aligned}
$$

Since $a>1$ and the denominator is strictly positive for $x\ge0$, the critical points satisfy

$$
\begin{aligned}
      f'(x)=0&\iff 1-ax^2=0\\
        &\iff x^2=\frac1a\\
        &\iff x=\pm\frac1{\sqrt a}\\
        &\iff x=\frac1{\sqrt a},\qquad x\ge0.
    \end{aligned}
$$

The sign of $f'(x)$ is determined by the $(1-ax^2)$ term. For $x<1/\sqrt a$,

$$
\begin{aligned}
      0\le x<\frac1{\sqrt a}
        &\implies 0\le x^2<\frac1a\\
        &\implies ax^2<1\\
        &\implies 1-ax^2>0\\
        &\implies f'(x)>0.
    \end{aligned}
$$

Similarly, for $x>1/\sqrt a$,

$$
\begin{aligned}
      0<\frac1{\sqrt a}<x
        &\implies 0<\frac1a<x^2\\
        &\implies 1<ax^2\\
        &\implies 1-ax^2<0\\
        &\implies f'(x)<0.
    \end{aligned}
$$

Since $f'(x)>0$ for $0\le x<1/\sqrt a$ and $f'(x)<0$ for $x>1/\sqrt a$, the function $f$ is strictly increasing before $1/\sqrt a$ and strictly decreasing afterward. This follows from the mean value theorem on any closed interval on either side of $1/\sqrt a$, including intervals starting at $0$. The sign change is illustrated in [Figure C.31](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw07:rational-maximum).

[![ The case a=4. The function increases up to x^\*=1/2 and decreases afterward. Its maximum is 1/3. The sign argument in the proof applies to every a\>1.](https://xyzmaths.org/notes/maths-analysis/figures/rational-maximum.svg)](https://xyzmaths.org/notes/maths-analysis/figures/rational-maximum.svg "Open original SVG")

Figure C.31. The case $a=4$. The function increases up to $x^*=1/2$ and decreases afterward. Its maximum is $1/3$. The sign argument in the proof applies to every $a>1$.

Therefore, $f$ attains its unique global maximum at $x^*=1/\sqrt a$,

$$
\begin{aligned}
      f(x)&\le f\left(\frac1{\sqrt a}\right)\\[6pt]
        &=\frac1{1+\frac1{\sqrt a}}-
          \frac1{1+\frac{a}{\sqrt a}}\\[6pt]
        &=\frac{\sqrt a}{\sqrt a+1}-
          \frac{\sqrt a}{\sqrt a+a}\\[6pt]
        &=\frac{\sqrt a}{\sqrt a+1}-\frac1{1+\sqrt a}\\[6pt]
        &=\frac{\sqrt a-1}{\sqrt a+1}.
    \end{aligned}
$$

Equality holds if and only if $x=1/\sqrt a$. ◻

### Exercise 6.2.9

Show that the function

$$
\left(1+\frac1x\right)^{x+1}
$$

decreases and find the limit

$$
\lim_{x\to\infty}\left(1+\frac1x\right)^{x+1}.
$$

[^43]

[^43]: The source does not specify a domain. Take $x>0$ for this positive-base real-power problem.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:decreasing-euler-approximants)

*Solution.* To show the function

$$
f(x)=\left(1+\frac1x\right)^{x+1},
    \qquad x>0,
$$

decreases, we can analyze the derivative of its logarithm, since $\ln f(x)$ preserves the order and monotonicity of $f$. The base is positive, so $f(x)>0$. Set $H(x)=\ln f(x)=(x+1)\ln(1+1/x)$. Then

$$
\begin{aligned}
      H'(x)&=\ln\left(1+\frac1x\right)
        +(x+1)\frac1{1+\frac1x}\left(-\frac1{x^2}\right)\\
        &=\ln\left(1+\frac1x\right)-\frac{x+1}{x^2+x}\\
        &=\ln\left(1+\frac1x\right)-\frac1x.
    \end{aligned}
$$

Let $\varphi(u)=\ln(1+u)-u$, where $u=1/x$ and $u>0$. Since $\varphi$ is continuous on $[0,u]$ and differentiable on $(0,u)$, with $\varphi(0)=0$, we can apply the mean value theorem to find a $\xi\in(0,u)$ such that

$$
\begin{aligned}
      \frac{\varphi(u)-\varphi(0)}{u-0}&=\varphi'(\xi),\\
      \varphi(u)&=u\varphi'(\xi).
    \end{aligned}
$$

Since $\xi>0$, the derivative becomes negative,

$$
\varphi'(\xi)=\frac1{1+\xi}-1<0.
$$

A negative $\varphi'(\xi)$ implies $\varphi(u)<0$ for all $u>0$. Therefore, applying

$$
H'(x)=\varphi(u)=\varphi(1/x),\qquad
      x>0,
$$

we can conclude that $H'(x)<0$ and therefore $f$ is strictly decreasing. [Figure C.32](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw07:decreasing-approximants) shows this decrease for $x\ge1$.

[![ The actual graph for x\\ge1 descends toward e. The limit calculation establishes the dashed level. Since f is strictly decreasing on x\>0, every value remains above e.](https://xyzmaths.org/notes/maths-analysis/figures/decreasing-approximants.svg)](https://xyzmaths.org/notes/maths-analysis/figures/decreasing-approximants.svg "Open original SVG")

Figure C.32. The actual graph for $x\ge1$ descends toward $e$. The limit calculation establishes the dashed level. Since $f$ is strictly decreasing on $x>0$, every value remains above $e$.

To find the limit, put $t=1/x$. As $x\to+\infty$, we have $t\to0^+$ and

$$
H(x)
      =\frac{\ln(1+t)}{t}+\ln(1+t).
$$

The quotient is of $0/0$ form, and its denominator derivative is $1$. L’Hôpital’s rule therefore gives

$$
\lim_{t\to0^+}\frac{\ln(1+t)}{t}
      =\lim_{t\to0^+}\frac1{1+t}=1.
$$

Continuity of the logarithm also gives $\ln(1+t)\to0$. Thus $H(x)\to1$, and continuity of the exponential recovers the requested limit,

$$
\lim_{x\to+\infty}
      \left(1+\frac1x\right)^{x+1}=e^1=e.
$$

 ◻

### Exercise 6.5.4

Let $f(x)$ be differentiable twice such that $f''(x)$ is also continuous.

1.  **(i)** Prove that

    $$
    f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x-h)}{2h}.
    $$

2.  **(ii)** Prove that

    $$
    f''(x)=\lim_{h\to0}
              \frac{f(x+h)+f(x-h)-2f(x)}{h^2}.
    $$

(These formulas are very useful in numerical analysis. Hint: Are the limits of $0/0$ type?)

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:symmetric-differences)

*Solution.* Fix $x$ and take $h$ sufficiently small that $x-h$ and $x+h$ lie in the domain. We differentiate with respect to $h$, keeping $x$ fixed. Twice differentiability makes $f$ and $f'$ continuous, and $f''$ is continuous by assumption. We apply L’Hôpital’s rule on each side of $h=0$.

For part (i), since the limit is in $0/0$ form, we can apply L’Hôpital’s rule,

$$
\begin{aligned}
      \lim_{h\to0}\frac{f(x+h)-f(x-h)}{2h}
        &\overset{\mathrm{L'H}}{=}
          \lim_{h\to0}\frac{f'(x+h)+f'(x-h)}2\\[4pt]
        &=\frac{f'(x)+f'(x)}2\\
        &=f'(x).
    \end{aligned}
$$

Here the denominator derivative is $2\ne0$, and continuity of $f'$ gives the derivative-ratio limit.

Similarly, part (ii) is also in $0/0$ form,

$$
\begin{aligned}
      \lim_{h\to0}\frac{f(x+h)+f(x-h)-2f(x)}{h^2}
        &\overset{\mathrm{L'H}}{=}
          \lim_{h\to0}\frac{f'(x+h)-f'(x-h)}{2h}\\[4pt]
        &\overset{\mathrm{L'H}}{=}
          \lim_{h\to0}\frac{f''(x+h)+f''(x-h)}2\\[4pt]
        &=\frac{f''(x)+f''(x)}2\\
        &=f''(x).
    \end{aligned}
$$

For the first application, the denominator derivative $2h$ is nonzero when $h\ne0$. The intermediate quotient is again of $0/0$ form by continuity of $f'$. Its denominator derivative is $2$, and continuity of $f''$ supplies the final limit. ◻

### Exercise 6.5.5

Find the limits

$$
\lim_{x\to0}\frac{\sin ax}{x},\qquad
    \lim_{x\to0}\frac{x}{\ln(1+ax)},\qquad
    \lim_{x\to0}\frac{1-\cos2x}{\sin^2x}.
$$

The second quotient requires $a\ne0$. If $a=0$, its denominator is identically zero.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:trigonometric-logarithmic-limits)

*Solution.* All three quotients are of $0/0$ form as $x\to0$. We apply L’Hôpital’s rule on both sides of zero.

For part (i),

$$
\begin{aligned}
      \lim_{x\to0}\frac{\sin(ax)}x
        &\overset{\mathrm{L'H}}{=}
          \lim_{x\to0}\frac{a\cos(ax)}1\\
        &=a\cos(0)\\
        &=a.
    \end{aligned}
$$

For part (ii), take $a\ne0$. On a sufficiently small neighborhood of zero, $1+ax>0$ and the denominator derivative $a/(1+ax)$ is nonzero. Thus

$$
\begin{aligned}
      \lim_{x\to0}\frac{x}{\ln(1+ax)}
        &\overset{\mathrm{L'H}}{=}
          \lim_{x\to0}\frac1{\frac{a}{1+ax}}\\
        &=\lim_{x\to0}\frac{1+ax}{a}\\
        &=\frac1a.
    \end{aligned}
$$

For part (iii), applying L’Hôpital’s rule twice gives

$$
\begin{aligned}
      \lim_{x\to0}\frac{1-\cos(2x)}{\sin^2x}
        &\overset{\mathrm{L'H}}{=}
          \lim_{x\to0}\frac{2\sin(2x)}{2\sin x\cos x}\\
        &\overset{\mathrm{L'H}}{=}
          \lim_{x\to0}\frac{4\cos(2x)}
            {2(\cos^2x-\sin^2x)}\\
        &=\frac42\\
        &=2.
    \end{aligned}
$$

The intermediate quotient is again of $0/0$ form. The two denominator derivatives are $2\sin x\cos x$ and $2(\cos^2x-\sin^2x)$. They are nonzero on a sufficiently small punctured neighborhood of zero, and the final derivative ratio tends to $2$, justifying both applications. ◻

### Exercise 6.5.6

Find the limits

$$
\lim_{n\to\infty}\left(1+\frac xn\right)^n,\qquad
    \lim_{n\to\infty}\left(1+\sin\frac\pi n\right)^n.
$$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:power-sequence-limits)

*Solution.* Part (i). Fix $x\in\mathbb{R}$. For all sufficiently large $n$, $1+x/n>0$, so the logarithm below is defined. We have

$$
\begin{aligned}
      \lim_{n\to\infty}\left(1+\frac xn\right)^n
        &=\lim_{n\to\infty}
          e^{\ln\left((1+\frac xn)^n\right)}\\
        &=\lim_{n\to\infty}e^{n\ln(1+\frac xn)}.
    \end{aligned}
$$

Since the exponential function is continuous, once the exponent has a finite limit, we obtain

$$
\lim_{n\to\infty}e^{n\ln(1+\frac xn)}
      =e^{\lim_{n\to\infty}n\ln(1+\frac xn)}.
$$

Strictly, L’Hôpital’s rule is applied to the corresponding real-variable function, whose limit also determines the limit along integer $n$. Write $t$ for this real variable. The quotients below are of $0/0$ form as $t\to+\infty$. To use the finite-endpoint rule, set $s=1/t\to0^+$. The derivative ratio with respect to $s$ equals the displayed ratio with respect to $t$, because the common chain-rule factor $-1/s^2$ cancels.

Solving for the limit of the exponent gives

$$
\begin{aligned}
      \lim_{t\to+\infty}t\ln\left(1+\frac xt\right)
        &=\lim_{t\to+\infty}
          \frac{\ln(1+\frac xt)}{1/t}\\
        &\overset{\mathrm{L'H}}{=}\lim_{t\to+\infty}
          \frac{\frac{-x/t^2}{1+x/t}}{-1/t^2}\\
        &=\lim_{t\to+\infty}\frac{x}{1+x/t}\\
        &=x.
    \end{aligned}
$$

The denominator derivative $-1/t^2$ is nonzero, and the derivative ratio has the finite limit $x$. Restricting to $t=n$ therefore gives the required exponent limit. Hence

$$
e^{\lim_{n\to\infty}n\ln(1+\frac xn)}
      =\lim_{n\to\infty}\left(1+\frac xn\right)^n=e^x.
$$

For part (ii), we begin by expressing the power using the natural logarithm and exponential function. The base is positive for all sufficiently large $n$. Since the exponential function is continuous everywhere on $\mathbb{R}$, we may interchange it with the limit, provided the inner limit exists and is finite,

$$
\begin{aligned}
      \lim_{n\to\infty}\left(1+\sin\frac\pi n\right)^n
        &=\lim_{n\to\infty}
          e^{\ln\left((1+\sin\frac\pi n)^n\right)}\\
        &=\lim_{n\to\infty}e^{n\ln(1+\sin\frac\pi n)}\\
        &=e^{\lim_{n\to\infty}n\ln(1+\sin\frac\pi n)}.
    \end{aligned}
$$

We now evaluate the exponent. Rewriting the product as a quotient gives $0/0$ form, allowing us to apply L’Hôpital’s rule.

$$
\begin{aligned}
      \lim_{t\to+\infty}t\ln\left(1+\sin\frac\pi t\right)
        &=\lim_{t\to+\infty}
          \frac{\ln(1+\sin\frac\pi t)}{1/t}\\
        &\overset{\mathrm{L'H}}{=}\lim_{t\to+\infty}
          \frac{\frac1{1+\sin(\pi/t)}
            \cos(\frac\pi t)(-\frac\pi{t^2})}{-1/t^2}\\
        &=\lim_{t\to+\infty}
          \frac{\pi\cos(\pi/t)}{1+\sin(\pi/t)}\\
        &=\frac{\pi\cos(0)}{1+\sin(0)}\\
        &=\pi.
    \end{aligned}
$$

The denominator derivative is again nonzero, and the derivative ratio tends to $\pi$. Taking $t=n$ gives the same exponent limit for the sequence. Therefore, substituting this result into the original expression,

$$
\begin{aligned}
      \lim_{n\to\infty}\left(1+\sin\frac\pi n\right)^n
        &=e^{\lim_{n\to\infty}n\ln(1+\sin\frac\pi n)}\\
        &=e^\pi.
    \end{aligned}
$$

 ◻

### Exercise 6.5.7

Find

$$
\lim_{x\to0}x^x.
$$

[^48]

[^48]: For the real-power function on $x>0$, the limit at zero is taken from the right. The source writes $x\to0$ without a one-sided qualifier.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:self-power-limit)

*Solution.* We take the limit from the right because the real-power expression here is defined for $x>0$. Applying the same transformation from [Exercise 6.1.10](https://xyzmaths.org/notes/maths-analysis/analysis-i/differentiation-and-applications/#ex:hw07:self-power-derivative) gives

$$
\lim_{x\to0^+}x^x
      =\lim_{x\to0^+}e^{\ln(x^x)}
      =\lim_{x\to0^+}e^{x\ln x}.
$$

Since the exponential function is continuous everywhere on $\mathbb{R}$, we may interchange it with the limit, provided the inner limit exists and is finite,

$$
\lim_{x\to0^+}e^{x\ln x}
      =e^{\lim_{x\to0^+}x\ln x}.
$$

We now evaluate the exponent. Rewriting the product as a quotient gives the indeterminate form $-\infty/\infty$, allowing us to apply L’Hôpital’s rule. More precisely, apply the $+\infty/+\infty$ version to $(-\ln x)/(1/x)$ and then restore the minus sign. The functions are differentiable for $x>0$, the denominator derivative $-1/x^2$ is nonzero, and the derivative ratio below has a limit.

$$
\begin{aligned}
      \lim_{x\to0^+}x\ln x
        &=\lim_{x\to0^+}\frac{\ln x}{1/x}\\
        &\overset{\mathrm{L'H}}{=}
          \lim_{x\to0^+}\frac{1/x}{-1/x^2}\\
        &=\lim_{x\to0^+}(-x)\\
        &=0.
    \end{aligned}
$$

Therefore, substituting this result into the original expression,

$$
\lim_{x\to0^+}x^x
      =e^{\lim_{x\to0^+}x\ln x}=e^0=1.
$$

 ◻

## C.6 Sequences and series of functions

### Exercise 8.3.3

Consider the sequence

$$
f_n(x)=\frac{nx}{1+n^2x^2},\qquad
    x\in[0,1],\quad n=1,2,\ldots.
$$

1.  **(a)** Show that $f_n(x)\to0$ pointwise as $n\to\infty$.

2.  **(b)** Show that the convergence is not uniform.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw05:pointwise-not-uniform)

*Solution.* *(a)* First consider $x=0$. For every $n\in\mathbb{N}$,

$$
f_n(0)=0,
$$

so the limit at this input is zero. Now fix $x\in(0,1]$. Since $1+n^2x^2\ge n^2x^2>0$,

$$
0\le f_n(x)=\frac{nx}{1+n^2x^2}
      \le\frac{nx}{n^2x^2}=\frac{1}{nx}.
$$

With $x>0$ fixed, $1/(nx)\to0$. The squeeze theorem therefore gives $f_n(x)\to0$. Together with the case $x=0$, this proves pointwise convergence to the zero function on $[0,1]$.

*(b)* Pointwise convergence keeps $x$ fixed while $n$ grows. To test uniform convergence, we may instead look for a different troublesome input at each $n$. Set $x_n=1/n\in[0,1]$. Then

$$
f_n(x_n)=\frac{n(1/n)}{1+n^2(1/n)^2}=\frac12.
$$

Choose $\varepsilon_0=1/4$. For any proposed $N\in\mathbb{N}$, take $n\ge N$ and $x=x_n$. We have

$$
|f_n(x)-0|=\frac12>\varepsilon_0.
$$

Hence there is no $N$ after which all the values of $f_n$ are within $\varepsilon_0$ of zero. The convergence is not uniform.

We can also see exactly how large the largest error is. Since $(nx-1)^2\ge0$, we have $2nx\le1+n^2x^2$ and therefore

$$
0\le f_n(x)\le\frac12,\qquad x\in[0,1].
$$

Equality holds at $x=1/n$, so

$$
\sup_{x\in[0,1]}|f_n(x)-0|=\frac12
$$

for every $n$. As [Figure C.33](https://xyzmaths.org/notes/maths-analysis/appendices/exercise-solutions/#fig:hw05:moving-peaks) shows, the peak moves towards zero while its height stays fixed. This does not contradict pointwise convergence, since a fixed positive input does not follow the moving peak, and $f_n(0)$ is always zero.

[![ The graphs for n=2,4,8 have peaks at (1/n,1/2). The peaks move towards the origin without losing height. Uniform convergence to zero would require the entire graph eventually to lie in every horizontal band about the x-axis.](https://xyzmaths.org/notes/maths-analysis/figures/moving-peaks.svg)](https://xyzmaths.org/notes/maths-analysis/figures/moving-peaks.svg "Open original SVG")

Figure C.33. The graphs for $n=2,4,8$ have peaks at $(1/n,1/2)$. The peaks move towards the origin without losing height. Uniform convergence to zero would require the entire graph eventually to lie in every horizontal band about the $x$-axis.

 ◻

### Exercise 8.3.5

Let $\{f_n(x)\}$ and $\{g_n(x)\}$ be two uniformly convergent sequences whose limit are $f(x)$ and $g(x)$, respectively.

1.  **(i)** Show that $f_n(x)g_n(x)\to f(x)g(x)$ as $n\to\infty$ uniformly in $C[a,b]$ (for finite $a,b$).

2.  **(ii)** Give an example to show that (i) may fail in $C(-\infty,\infty)$.

3.  **(iii)** Show that $f_n(x)\pm g_n(x)\to f(x)\pm g(x)$ as $n\to\infty$ uniformly regardless of the underlying interval.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:uniform-algebra)

*Awaiting solution.*

### Exercise 8.3.6

Consider the sequence

$$
f_n(x)=nx(1-x)^n,\qquad n\in\mathbb{N},\quad x\in[0,1].
$$

1.  **(i)** Show that $f_n(x)\to0$ as $n\to\infty$ pointwise. (Hint: Use [Exercise 8.6.9](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:arbitrary-base-exponential) and [Exercise 8.6.12](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:exponential-dominates-powers).)

2.  **(ii)** Show that the convergence $f_n(x)\to0$ as $n\to\infty$ is not uniform. (Hint: Try $x_n=\frac1{n+1}$ or use Calculus to get where $f_n(x)$ attains its maximum.)

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:moving-peaks)

*Awaiting solution.*

### Exercise 8.3.10

Let $\{f_n(x)\}$ be sequence of equicontinuous functions over $[a,b]$.

1.  **(i)** Show that if there is a point $x_0\in[a,b]$ such that $\{f_n(x_0)\}$ is a bounded sequence, then $\{f_n(x)\}$ is uniformly bounded over $[a,b]$. That is, there is a constant $M>0$ such that

    $$
    |f_n(x)|\le M,\qquad \forall x\in[a,b],\quad n=1,2,\ldots.
    $$

2.  **(ii)** Give an example to show that an equicontinuous sequence of functions may fail to be a bounded sequence even at a point.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:equicontinuous-boundedness)

*Awaiting solution.*

### Exercise 8.6.8

Consider

$$
E(x)=\sum_{k=0}^{\infty}\frac{x^k}{k!},\qquad
    E_n(x)=\sum_{k=0}^{n}\frac{x^k}{k!},\qquad x\in\mathbb{R}.
$$

1.  **(i)** Establish the absolute and uniform convergence $E_n(x)\to E(x)$ as $n\to\infty$ over any interval $[a,b]$ $(-\infty<a<b<\infty)$.

2.  **(ii)** Use (i) to show that $E(x)$ is continuous.

3.  **(iii)** Show that $\ln x$ $(x>0)$ is continuous.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:exponential-continuity)

*Awaiting solution.*

### Exercise 8.6.9

Use the conventional notation $E(x)=e^x$. Show that for any $a>0$ there is some $b\in\mathbb{R}$ such that $a=e^b$ which allows us to define the function

$$
a^x=e^{bx},\qquad x\in\mathbb{R}.
$$

Classify the function $a^x$ in terms of $a$ when it is increasing, decreasing, or constant.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:arbitrary-base-exponential)

*Awaiting solution.*

### Exercise 8.6.10

Use the exponential addition law

$$
E(x+y)=E(x)E(y)\quad\text{or}\quad
    e^{x+y}=e^x e^y,\qquad x,y\in\mathbb{R}.
$$

1.  **(i)** Show that

    $$
    E(mx)=E(x)^m,\qquad E\left(\frac{x}{m}\right)=E(x)^{1/m},
            \qquad x\in\mathbb{R},\quad m\in\mathbb{N}.
    $$

2.  **(ii)** Show that (i) can be extended to

    $$
    E(qx)=E(x)^q,\qquad q\in\mathbb{Q},\quad x\in\mathbb{R}.
    $$

3.  **(iii)** Show that (ii) can be extended to

    $$
    E(ax)=E(x)^a,\qquad a\in\mathbb{R},\quad x\in\mathbb{R}.
    $$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:exponential-scaling)

*Awaiting solution.*

### Exercise 8.6.11

Use [Exercise 8.6.10](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:exponential-scaling)(iii) to establish the property

$$
\ln(x^a)=a\ln x,\qquad a\in\mathbb{R},\quad x>0.
$$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:logarithm-power-law)

*Awaiting solution.*

### Exercise 8.6.12

Prove that for any $p>0$ there holds

$$
\lim_{x\to\infty}x^p e^{-x}=0.
$$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:exponential-dominates-powers)

*Awaiting solution.*

### Exercise 8.6.13

Prove

$$
\lim_{x\to0^+}x^p\ln x=0,\qquad p>0.
$$

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:logarithmic-boundary-limit)

*Awaiting solution.*

### Exercise 8.6.14

For $x\in\mathbb{R}$, investigate the absolute convergence of the power series

$$
\sum_{n=1}^{\infty}\frac{x^n}{(\sqrt3)^n n^k},
$$

where $k$ is an integer using the ratio test or root test for convergence or divergence.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw04:scaled-power-series)

*Solution.* Write the power series as $\sum_{n=1}^{\infty}c_nx^n$, where

$$
c_n=\frac{1}{3^{n/2}n^k}.
$$

We use the root test. For every $n\ge1$,

$$
\left|\frac{x^n}{(\sqrt3)^n n^k}\right|^{1/n}
    =\frac{|x|}{\sqrt3\,(n^k)^{1/n}}
    =\frac{|x|}{\sqrt3\,(n^{1/n})^k}.
$$

First suppose $k\ge0$. Choose a positive integer $m\ge k$. Since $n^{1/n}\to1$, we have

$$
1\le(n^{1/n})^k\le(n^{1/n})^m\longrightarrow1.
$$

The squeeze theorem gives $(n^{1/n})^k\to1$.

If $k<0$, apply the same argument to the positive integer $-k$. Taking reciprocals gives

$$
(n^{1/n})^k=\frac{1}{(n^{1/n})^{-k}}\longrightarrow1.
$$

Thus this limit holds for every integer $k$.

It follows that

$$
\lim_{n\to\infty}
      \left|\frac{x^n}{(\sqrt3)^n n^k}\right|^{1/n}
    =\frac{|x|}{\sqrt3}.
$$

We obtain absolute convergence when

$$
\frac{|x|}{\sqrt3}<1
    \quad\Longleftrightarrow\quad
    |x|<\sqrt3
    \quad\Longleftrightarrow\quad
    -\sqrt3<x<\sqrt3.
$$

If $|x|>\sqrt3$, the series diverges because its terms do not tend to zero, by the root divergence argument. Hence the radius of convergence is $\sqrt3$. The value $|x|/\sqrt3$ above is the root-test limit rather than the radius.

At the endpoints $x=\pm\sqrt3$, the absolute-value series becomes

$$
\sum_{n=1}^{\infty}
      \left|\frac{(\pm\sqrt3)^n}{(\sqrt3)^n n^k}\right|
    =\sum_{n=1}^{\infty}\frac{1}{n^k}.
$$

This series converges if $k>1$ and diverges if $k\le1$. For $k=1$ it is the harmonic series. For $k\le0$ its terms do not tend to zero. For $k>1$ the p-series test applies. Thus both endpoints give absolute convergence exactly when $k>1$.

The set of absolute convergence is therefore

$$
\begin{cases}
      [-\sqrt3,\sqrt3],&k>1,\\
      (-\sqrt3,\sqrt3),&k\le1.
    \end{cases}
$$

Failure of absolute convergence does not always imply divergence of the original series. For example, at $x=-\sqrt3$ and $k=1$ the alternating harmonic series converges conditionally. ◻

### Exercise 8.6.15

Use the method of radius of convergence to determine the interval where the series

$$
S(x)=\sum_{n=1}^{\infty}n^2\left(\frac{x}{1-x}\right)^n
$$

converges and is continuous.

[Original exercise](https://xyzmaths.org/notes/maths-analysis/analysis-i/sequences-and-series-of-functions/#ex:hw06:composed-power-series)

*Awaiting solution.*
