# Calculus/Choosing delta

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 ε > 0 there exists a number δ > 0 such that

$\left| f(x) - L \right| < \epsilon$
whenever
$0 < \left| x - c \right| < \delta$.

In other words, given a number ε we must construct a number δ such that assuming
$0 < \left| x - c \right| < \delta$
we can prove
$\left| f(x) - L \right| < \epsilon$;
moreover, this proof must work for all values of ε > 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 δ = ε (this will be explained later). Then, since we assume
$\left| x - 9 \right| < \delta$
we can show
$\begin{matrix} \left| (x + 5) - 14 \right| & = & \left| x - 9 \right| \\ \ & < & \delta \\ \ & = & \epsilon \end{matrix}$,
which is what we wanted to prove.

We chose δ by working backwards from the formula we are trying to prove:
$\left| f(x) - L \right| < \epsilon$.
In this case, we desire to prove
$\left| x - 9 \right| < \epsilon$,
given
$\left| x - 9 \right| < \delta$,
so the easiest way to prove it is by choosing δ = ε. This example, however, is too easy to adequately explain how to choose δ in general. Lets try something harder:

Example 2: Prove that the limit of f(x) = x² - 9 as x approaches 2 is L = -5.

We want to prove that
$\left| f(x) - L \right| = \left| x^2 - 4 \right| < \epsilon$
given
$\left| x - 2 \right| < \delta$.

We choose δ by working backwards. First, we need to rewrite the equation we want to prove using δ instead of x:

$\begin{matrix} \left| x^2 - 4 \right| & < & \epsilon \\ \left| x - 2 \right| \cdot \left| x + 2 \right| & < & \epsilon \\ (\delta) \cdot (\delta + 4) & = & \epsilon \end{matrix}$

Note: we used the fact that |x + 2| < δ + 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 δ 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 δ 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| = δ, but rather |x-2| < δ. 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 δ using the quadratic formula:

$\delta = \frac{-4 + \sqrt{16 - 4 \cdot 1 \cdot (- \epsilon) }}{2 \cdot 1} = -2 + \sqrt{4 + \epsilon}$

Note: δ is almost always in terms of ε. A constant value of δ (e.g., δ = 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 δ, and we can do our proof:

given
$\left| x - 2 \right| < \delta$,
$\begin{matrix} \left| f(x) - L \right| & = & \left| x^2 - 4 \right| \\ \ & = & \left| x - 2 \right| \cdot \left| x + 2 \right| \\ \ & < & (\delta) \cdot (\delta + 4) \\ \ & < & (\sqrt{4 + \epsilon} - 2) \cdot (\sqrt{4 + \epsilon} + 2) \\ \ & < & (\sqrt{4 + \epsilon})^2 - (2)^2 \\ \ & < & \epsilon \end{matrix}$.

Here a few more examples of choosing δ; try to figure them out before reading the explanation.

Example 3: Prove that the limit of f(x) = sin(x)/x as x approaches 0 is L = 1.

Explanation:

Example 4: Prove that f(x) = 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\geq4$ and $\epsilon<4$. The $\epsilon\geq4$ 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\sqrt2-2$. The chosen $\delta$ defines the interval $(4-2\sqrt2,2\sqrt2)\approxeq(1.1716,2.8284)$ in our domain. This gets mapped to $(24-16\sqrt2,8)\approxeq(1.3726,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\sqrt2-2$ works for any $\epsilon\geq4$.

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
$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)
$\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 $|\sqrt(\epsilon+4)-2|\leq|\sqrt(4-\epsilon)-2|$ for $0<\epsilon<4$, so choose $\delta=\sqrt(\epsilon+4)-2$. As a sanity check, let's try with $\epsilon=0.002$.

$\delta=\sqrt(\epsilon+4)-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.