Why does limit $\lim_{(x,y) \to (0,0)}\frac{2x}{x^2+x+y^2}$ not exist?

The limit doesn't exist. Fix $y=0$; then the limit expression is $$\lim_{x \to 0} \frac{2}{x+1} = 2$$

Fix $x=0$; then the limit expression is identically $$\lim_{y \to 0} \frac{0}{y^2} = 0$$


The other answers give excellent reasons as to why the "limit does not exist" but here is more of a reason "why" your logic breaks down at the last line (which answers your question "How does that work?"):

In the last line we should really write

$$\lim_{r\to0}\dfrac{2\cos\theta}{r+\cos\theta}=\dfrac{2\cos\theta}{\cos\theta}=2 \text{, if }\cos\theta\neq0.$$

Because in that last step, by 'cancelling' $\cos\theta$ from the numerator and denominator, you want to make sure that you're not dividing by zero. Since $\cos\theta=0$ is a definite possibility, then we need to consider it as a separate case.

As suggested by @Patrick, we can get this scenario by setting $\theta=\tfrac{\pi}2$, yielding the sub-case

$$\left.\lim_{r\to0}\dfrac{2\cos\theta}{r+\cos\theta}\right|_{\theta=\tfrac{\pi}2}=\lim_{r\to0}\dfrac{0}{r+0}=0,$$

hence showing that we can get a different answer to the limit, hence it does not exist.


You neglected to control $\theta$ too.