To find the locus of a point 
A point moves such that the sum of its distances from the coordinate axes is equal to its distance from the circle $x^2+y^2=4$.

I tried and got this equation for the locus:
$$x+y=\sqrt{x^2+y^2}-2$$
Should I replace $x+y$ with $|x|+|y|$ because distances are absolute? In that case, how will I represent $y$ as an explicit function of $x$?
Thanks in advance.
 A: Not only should you replace $x$ and $y$ with $|x|$ and $|y|$, you should also take the absolute value of the right-hand side because it represents a distance too:
$$|x|+|y|=\left\vert\sqrt{x^2+y^2}-2\right\vert$$
To solve this for $y$, we can first restrict ourselves to non-negative $x$ and $y$, since substituting $x\to-x$ or $y\to-y$ in a valid solution yields another valid solution. With this restriction we can remove the modulus signs around $x$ and $y$. The triangle inequality implies that $x+y>\sqrt{x^2+y^2}-2$, so when removing the modulus signs in the RHS we must have
$$x+y=2-\sqrt{x^2+y^2}$$
which leads to
$$2-(x+y)=\sqrt{x^2+y^2}$$
$$4-4(x+y)+x^2+2xy+y^2=x^2+y^2$$
$$4-4(x+y)+2xy=0$$
$$2-2(x+y)+xy=0$$
$$(x-2)y+2(1-x)=0$$
$$y=\frac{2(x-1)}{x-2},x\le1$$
Mirroring this across the $x$- and $y$-axes we get the final equation for $y$ in terms of $x$:
$$y=\pm\frac{2(|x|-1)}{|x|-2},|x|\le1$$
Here is a plot of the locus asked for by the question, with $x^2+y^2=4$ added as a reference.

A: Let the point of the locus be $(a,b)$.
It's equivalent to two circles are touching
$$
\left \{
  \begin{array}{rcl}
   (x-a)^2+(y-b)^2 &=& (|a|+|b|)^2 \\
   x^2+y^2 &=& 4
  \end{array} \right.$$
$$
\left \{
  \begin{array}{rcl}
   x^2+y^2-2ax-2by &=& 2|a b| \\
   x^2+y^2 &=& 4
  \end{array} \right.$$
Eliminating quadratic terms:
\begin{align*}
  ax+by &=2-|ab| \\
  y &= \frac{2-|ab|-ax}{b} \\
  x^2+\left( \frac{2-|ab|-ax}{b} \right)^2 &=4 \\
  b^2x^2+[a^2x^2-2a(2-|ab|)x+(2-|ab|)^2] &= 4b^2 \\
  (a^2+b^2)x^2-2a(2-|ab|)x+(2-|ab|)^2-4b^2 &=0 \\
  \Delta &= 0 \\
  a^2(2-|ab|)^2-(a^2+b^2)[(2-|ab|)^2-4b^2] &= 0 \\
  4b^2(a^2+b^2)-b^2(2-|ab|)^2 &= 0 \\
  4(a^2+b^2)-(2-|ab|)^2 &= 0 \\
  4(a^2+b^2)-a^2b^2+4|ab|-4 &= 0 \\
\end{align*}

Note that distance from circle is either maximum or minimum.

Considering the minimal distance only:

If maximal distance is also included:

