$\epsilon$-$\delta$ proof of $\lim_{x \to 3} x^2 = 9$ I've been learning about $\epsilon$-$\delta$ proofs and attempted to come up with my own proof that
$$
\lim_{x \to 3} x^2 = 9
$$
exists (I did use some help from some textbooks). Is my proof valid and free of redundancies? My proof:
Scratch work:
Written formally, this is:
$$
\forall \epsilon > 0, \exists \delta > 0 \text{ s.t. } 0 < |x - 3| < \delta \implies |x^2 - 9| < \epsilon
$$
We start off by simplifying the conclusion of the implication:
$$
|x^2 - 9| = |x + 3|\cdot  |x - 3|
$$
Now we have $|x + 3| \cdot |x - 3| < \epsilon$. Because $|x - 3| < \delta$, we have $|x - 3| \cdot |x + 3|  < \delta |x + 3|$. In an attempt to find a suitable $\delta$, we let $\delta|x + 3| < \epsilon$. Solving for $\delta$, we get $\delta < \frac{\epsilon}{|x + 3|}$. There is a problem though: $\delta$ is defined in terms of $\epsilon$ and the randomly chose point $x$. The definition of $\delta$ can only depend on $\epsilon$. To get around this problem, we will have to estimate the size of $|x + 3|$.
We start of by assuming that $\delta < 1$, which implies that $|x - 3| < 1$. Solving for $x + 3$, we get $5 < x + 3 < 7$. We now know that $|x + 3| < 7$ when $\delta < 1$.  Since $|x^2 - 9| < \delta|x + 3|$ and $|x + 3| < 7$ (if $\delta < 1$), we have $|x^2 - 9| < 7 \delta$. In an attempt to find a suitable $\delta$, we let $7 \delta < \epsilon$. Solving for $\delta$, we get $\delta < \frac{\epsilon}{7}$ when $\delta < 1$. So we have now deduced two restrictions: $\delta < 1$ and $\delta < \frac{\epsilon}{7}$. To satisfy both restrictions, we let $\delta < \min \left\{ 1, \frac{\epsilon}{7} \right\}$. When $\epsilon > 7$, then $\delta < 1$ and when $\epsilon < 7$, we have $\delta < \frac{\epsilon}{7}$. We can now write up the proof.
Proof:
For every $\epsilon > 0$ there exists a $0 < \delta < \min \left\{ 1, \frac{\epsilon}{7} \right\}$ such that $0 < |x - 3| < \delta \implies |x^2 - 9| < \epsilon$. There are two things that can happen: $\delta < 1$ and $\delta < \frac{\epsilon}{7}$.
Case 1 - $\delta < 1$:
The implication's hypothesis is $0 < |x - 3| < \delta$. Multiply both sides by $|x + 3|$ to get $0 < |x^2 - 9| < |x + 3| \delta$. Because $\delta < 1$, we know (from our scratchwork) that $|x + 3| < 7$ and $\delta$ is also less that $\frac{\epsilon}{7}$. This means that $0 < |x^2 - 9| < |x + 3| \delta < 7 \delta < [7 \frac{\epsilon}{7} = \epsilon]$.
Case 2 - $\delta < \frac{\epsilon}{7}$:
For $\delta$ to be less that $\frac{\epsilon}{7}$, we must have that $\frac{\epsilon}{7} < 1$ (as per the definition of $\min$). Because $\delta < \frac{\epsilon}{7}$ and $\frac{\epsilon}{7} < 1$ we have $\delta < 1$. Look to Case 1 for what follows after.
$\square{}$
 A: There is no need to consider several cases. Define $\delta=\min\left\{\frac\varepsilon7,1\right\}$. Then, if $|x-3|<\delta$, it follows from your computations that$$\left|x^2-9\right|=|x-3||x+3|<\frac\varepsilon7\times7=\varepsilon.$$
A: Congratulations, your proof is valid! Here are a few minor improvements you could make:

*

*It is simpler to set $\delta=\min\left\{1,\frac{\varepsilon}{7}\right\}$ than to require that $\delta<\min\left\{1,\frac{\varepsilon}{7}\right\}$.

*If $\delta=\min\left\{1,\frac{\varepsilon}{7}\right\}$, then it is automatically true that $|x-3|<1$ and $|x-3|<\frac{\varepsilon}{7}$. Therefore, there is no need to split your proof into cases. You can write it up as follows:


If $\delta=\min\left\{1,\frac{\varepsilon}{7}\right\}$, then $|x-3|<1$ and so $|x+3|<7$. Since $|x-3|<\frac{\varepsilon}{7}$,
$$
|x^2-9|=|x-3||x+3|<\frac{\varepsilon}{7} \cdot 7=\varepsilon
 \, .$$


*

*The final tip is by far the most important. Please use \varepsilon instead of \epsilon: it will make the users at TeX.SE eternally grateful.

Exercise: can you generalise your proof to show that the function $x\mapsto x^2$ is continuous, i.e. for every real number $a$, $\lim_{x \to a}x^2=a^2$? The basic idea is the same: start by requiring that $|x-a|<1$ and use this to come up with an upper bound for $|x+a|$. Note that while $\delta$ cannot depend on $x$, it can depend on $a$.
A: The scratch work looks good, but in the final proof there is no need to split into cases. You can just write

Given $\epsilon>0,$ take $\delta$ such that $0<\delta<\min\{1,\frac\epsilon7\}.$ Then, when $|x-3|<\delta,$ one has
$$
|x^2-9| = |x+3||x-3| = |(x-3)+6| |x-3| < (\delta+6)\delta < (1+6)\frac\epsilon7=\epsilon.
$$

