$$\lim_{x \to -2} \frac{2-|x|}{2+x}$$
If I calculate the left and right-hand limit I get different results.
Left hand side: $$\lim_{x \to -2^-}\frac{2+x}{2+x}=1$$
Right hand side: $$\lim_{x \to -2^+} \frac{2-x}{2+x}=\text{undefined}$$
My question is that my procedure is right or wrong?
When $x$ is near $-2$ approaching it from the left, $2+x$ is equivalent to $2-|x|$ (if $x<0$, then $x=-|x|$):
$$ \lim_{x\to-2^-}\frac{2-|x|}{2+x}=\lim_{x\to-2^-}\frac{2-|x|}{2-|x|}=\lim_{x\to-2^-}1=1. $$
When $x$ is near $-2$ approaching it from the right, $2+x$ also seems to be equivalent to $2-|x|$:
$$ \lim_{x\to-2^+}\frac{2-|x|}{2+x}=\lim_{x\to-2^+}\frac{2-|x|}{2-|x|}=\lim_{x\to-2^+}1=1. $$
Since both one-sided limits are equal to the same number, the limit exists and is equal to $1$:
$$\lim_{x\to-2}\frac{2-|x|}{2+x}=1.$$
Even though the function itself is undefined at $x=-2$ because the denominator at that point is zero ($f(-2)=\frac{2-|-2|}{2-2}=\frac{0}{0}$), the limit of this function at $x=-2$ does exist and is equal to $1$.