# Calculus/Choosing delta

    This page is an addendum to Calculus/Formal Definition of the Limit.
Recall the definition of a limit:
A number $L$ is the limit of a function $f(x)$ as $x$ approaches $c$ if and only if for all numbers $\epsilon >0$ there exists a number $\delta >0$ such that
    ${\Big |}f(x)-L{\Big |}<\epsilon$
whenever
    $0<|x-c|<\delta$ .
In other words, given a number $\epsilon$ we must construct a number $\delta$ such that assuming
    $0<|x-c|<\delta$
we can prove
    ${\Big |}f(x)-L{\Big |}<\epsilon$
moreover, this proof must work for all values of :$\epsilon >0$ .
Note: this definition is not constructive -- it does not tell you how to find the limit $L$ , only how to check whether a particular value is indeed the limit. We use the informal definition of the limit, experience with similar problems, or theorems (L'Hopital's rule, for example), to determine the value, and then can prove the correctness of this value using the formal definition.
Example 1: Suppose we want to find the limit of $f(x)=x+5$ as $x$ approaches $c=9$ . We know that the limit $L$ is 9+5=14, and desire to prove this.
We choose $\delta =\epsilon$ (this will be explained later). Then, since we assume
    $|x-9|<\delta$
we can show
    ${\Big |}(x+5)-14{\Big |}$ $=|x-9|$ $<\delta$ $=\epsilon$
which is what we wanted to prove.
We chose δ by working backwards from the formula we are trying to prove: ${\Big |}f(x)-L{\Big |}<\epsilon$ . In this case, we desire to prove
    $|x-9|<\epsilon$
given
    $|x-9|<\delta$
so the easiest way to prove it is by choosing $\delta =\epsilon$ . This example, however, is too easy to adequately explain how to choose $\delta$ in general. Lets try something harder:
Example 2: Prove that the limit of $f(x)=x^{2}-9$ as $x$ approaches $2$ is $L=-5$ .
We want to prove that
    ${\Big |}f(x)-L{\Big |}=|x^{2}-4|<\epsilon$
given
    $|x-2|<\delta$ .
We choose $\delta$ by working backwards. First, we need to rewrite the equation we want to prove using $\delta$ instead of $x$:
${\begin{matrix}|x^{2}-4|&<&\epsilon \\|x-2|\cdot |x+2|&<&\epsilon \\\delta (\delta +4)&=&\epsilon \end{matrix}}$
Note: we used the fact that $|x+2|\leq \delta +4$ , which can be proven with the triangle inequality.
Word of caution: the above series of equations is not a logical series of steps, and is not part of any proof, but is an informal technique used to help write the proof. We will select a value of $\delta$ so that the last equation is true, and then use the last equation to prove the equations above it in turn (which is what was meant earlier by working backwards).
Note: in the equations above, when $\delta$ was substituted for $x$ , the sign $<$ was replaced with $=$ . This can be done (but is not necessary) because we are not told that $|x-2|=\delta$ , but rather $|x-2|<\delta$ . The justification for this becomes clear when the above equations are used in backwards order in the proof.
We can solve this last equation for $\delta$ using the quadratic formula:
    $\delta ={\frac {-4+{\sqrt {16-4(-\epsilon )}}}{2}}={\sqrt {4+\epsilon }}-2$
Note: $\delta$ is almost always in terms of $\epsilon$ . A constant value of $\delta$ (e.g., $\delta =0.5$) will not work unless the limit is of a constant function (for instance, $\lim _{x\to 3}5=5$).
Now, we have a value of $\delta$ , and we can do our proof:
given
    $|x-2|<\delta$
${\begin{matrix}{\Big |}f(x)-L{\Big |}&=&|x^{2}-4|\\\ &=&|x-2|\cdot |x+2|\\\ &<&\delta (\delta +4)\\\ &<&{\big{\sqrt {4+\epsilon }}-2{\big )}{\big{\sqrt {4+\epsilon }}+2{\big )}\\\ &<&{\big{\sqrt {4+\epsilon }}{\big )}^{2}-2^{2}\\\ &<&\epsilon \end{matrix}}$
Here a few more examples of choosing $\delta$ ; try to figure them out before reading the explanation.
Example 3: Prove that the limit of $f(x)={\frac {\sin(x)}{x}}$ as $x$ approaches $0$ is $L=1$ .
Explanation:
Example 4: Prove that $f(x)={\frac {1}{x}}$ has no limit as $x$ approaches $0$ .
Example 5:
Prove that $\lim _{x\to 2}x^{2}=4$
Solution: To do it, we'll look at two cases: $\epsilon \geq 4$ and $\epsilon <4$ . The $\epsilon \geq 4$ case is easy. First let's let $\epsilon =4$ . That means we want the values chosen in the domain to map to $(0,8)$ in the range. We want a delta such that $(2+\delta )^{2}=8$ so let's choose $\delta =2{\sqrt {2}}-2$ . The chosen $\delta$ defines the interval $(4-2{\sqrt {2}},2{\sqrt {2}})$ in our domain. This gets mapped to $(24-16{\sqrt {2}},8)$ in our range, which is contained in $(0,8)$ . Notice that $\delta$ doesn't depend on $\epsilon$ . So for $\epsilon >4$, we widen the interval in the range that we are allowed to map onto, but our interval in the domain stays fixed and always maps to the same sub-interval in the range. So $\delta =2{\sqrt {2}}-2$ works for any $\epsilon \geq 4$.
Now suppose $0<\epsilon <4$ . We want a $\delta$ such that $0<|x^{2}-4|<\epsilon$ whenever $0<|x-2|<\delta$ . So let's assume $0<|x^{2}-4|<\epsilon$ and work backwards to find a suitable $\delta$:
    $0<|x^{2}-4|<\epsilon$
    $-\epsilon <x^{2}-4<\epsilon$
    $4-\epsilon <x^{2}<4+\epsilon$
Since $0<\epsilon <4$ , we have $4-\epsilon >0$ . Since both numbers above are positive, we can take the (positive) square root of both extremes of the inequality:
    ${\sqrt {4-\epsilon }}<x<{\sqrt {4+\epsilon }}$
    ${\sqrt {4-\epsilon }}-2<x-2<{\sqrt {4+\epsilon }}-2$
The above equation represents the distance, either negative or positive, that $x$ can vary from 2 and still be within $\epsilon$ of 4. We want to choose the smaller of the two extremes to construct our interval. It turns out that ${\Big |}{\sqrt {4+\epsilon }}-2{\Big |}\leq {\Big |}{\sqrt {4-\epsilon }}-2{\Big |}$ for $0<\epsilon <4$ , so choose $\delta ={\sqrt {4+\epsilon }}-2$ . As a sanity check, let's try with $\epsilon =0.002$ .
    $\delta ={\sqrt {4+\epsilon }}-2$
    $\delta ={\sqrt {0.002+4}}-2$
which is approximately
    $\delta =0.0004999375$
At the extreme right of the domain, this gives
    $x=2.0004999375$
and
    $x^{2}=2.0004999375^{2}=4.00199999993750390625$
which is within 0.002 of 4.