I have a function in 1D given by $f(x) = \tanh(x-x_1) + \tanh(x-x_2)$. I want to generalize this to two dimensions, such that it describes a circle. The function $f(x,y)$ has to have a form such that it will reduce to $f(x)$ for $y\rightarrow 0$.
How can I create such a function?
It is not clear what you mean by that it should describe a circle, can you elaborate that?
If you want a rotational symmetry you can use use the radius $r=\sqrt{x^2+y^2}$ as an argument:
$F(x,y) := f(\sqrt{x^2+y^2})$ but in this of course only uses the part of $f$ with a positive argument, that means that $f(x,0) = f(|x|)$.
EDIT: $f(x) = \tanh(x-x_1)-\tanh(x+x_1)$, this means that the function is symmetrical $f(x) = f(-x)$ and you can just use the idea above:
Define: $$F(x,y) = f(r) = f\left(\sqrt{x^2+y^2}\right)= \tanh(x\sqrt{x^2+y^2}-x_1)-\tanh(\sqrt{x^2+y^2}+x_1)$$
Therefore
$$F(x,0) = f(|x|) = f(x)$$
since $f(-x) = \tanh(-x-x_1)-\tanh(-x+x_1) = -\tanh(x+x_1)+\tanh(x-x_1) = f(x)$.