I'll work out the x^2 example:
you want to show that for any epsilon ( e ) > 0 you can find a delta ( d ) > 0 such that for all x satisfying 0 < | x - a | < d , we get | x^2 - a^2 |< epsilon. ( we are assuming that we know that a^2 is the limit of x^2 as x -> a ).
we want to find a bound of | x - a | so that | x^2 - a^2 | < e is always ensured.
|x^2 - a^2 | = |x+a| |x-a|. back in the line example, we saw that similar computations showed us that if, for example, we wanted to ensure 5|x-a| < e, we could just take delta to be epsilon/5. So it seems like we should be able to take e/|x+a| as delta and be done with it, but as pointed out before, it doesn't work like this. However, if we could find an upper bound (which is we will find to be a constant ) to what |x+a| can ever be, then we would see this:
|x+a| | x- a| < |upperbound| | x-a |. Then picking any e, we can ensure |upperbound| | x-a| < e by setting delta to be e/|upperbound|, similar to the line example. But, once delta = e/|upperbound|, we see that |x^2 - a^2| = |x-a||x+a| < |upperbound| | x-a| < e and we should be done, since for any e, we have found a way (a delta ) to ensure |x^2 - a^2| < e.
So all that's required to do now is to find an upper bound for |x+a|.
Suppose we consider all x such that | x - a | < 1. I could have considered any constant c, ( for example, 1 , 5 , 10 .. or whatever ) . Then, if all x satisfying | x - a | < 1 also satisfies | x^2 - a^2 | < e then we are done, since we could just pick delta to be 1 ( or whatever c I picked ) . But we are not always this lucky, it might be the case that not all x satisfying |x-a| < 1 also satisfies |x^2 - a^2 | < e. So it might be the case that we will need a delta smaller than 1 ( note that if we could find a delta bigger than 1, then 1 certainly works too, since ( a -1 , a+1) would be a sub interval of (a- d , a + d ) ). But, things are still looking good, since we can now easily find an upper bound for | x + a|. We know that |x -a | < 1, so | x | - | a | <= |x - a | < 1 and we see that |x| < 1 + | a | . Then, |x + a| <= |x | + |a| < ( 1 + |a | ) + | a | = 1 + 2|a |. ( These follow from the triangle inequalities, you don't need to use them, but it is neater )
So now we have found an upper bound for | x + a | , we have that | x + a | < 1 + 2|a |. So as described before, we can now find our appropriate delta, since:
|x + a | | x- a | < (1 + 2|a |)|x-a| , so for any x so that | x - a| < e/(1 + 2|a |), we can ensure that (1 + 2|a |)|x-a| < e,
in particular, |x + a | | x- a | < (1 + 2|a |)|x-a| < e , ensuring that |x + a | | x- a | = |x^2 - a^2 | < e.
But, remembering that we initially ensured ourselves that | x - a| < 1, we of course must always have | x - a | < 1 hold. So we pick delta = min ( 1, e/(1 + 2|a |) ) , so that for any epsilon e > 0 | x - a | < min ( 1, e/(1 + 2|a |) ) implies | x^2 - a^2 | < e.
Picking the minimum between 1 and e/(1 + 2|a |) ensures that both |x - a| < 1 and |x -a | < e/(1 + 2|a |) are always held.