I'm trying to find the function $\phi(x)$ in a physics problem, during which I have obtained the following implicit expression for $\phi$:
$$\bigg|\dfrac{\phi-a}{\phi+a}\bigg|=b(x)+c$$
where $c$ is a constant and I know the explicit expression of $b(x)$, but since it doesn't seem relevant, I'll omit it here. I tried substituting the absolute value by a $\pm$ and with this I found that
$$\phi(x)=\dfrac{\mp 1-(b(x)+c)}{\mp 1+(b(x)+c)}$$
where I should pick the $+$ sign when $\phi<-a$ or $\phi\geq a$, and the $-$ sign when $\phi\in(-a,a)$. But how can I turn these conditions into ones that involve $x$ instead of $\phi$? The problem I see is that, for example, in order to check which values of $x$ allow for $\phi\in(-a,a)$, I need to previously choose the minus or the plus sign in the expression of $\phi(x)$. How should I do this?
In cases where $b(x)+c$ is negative, there is no solution $\phi(x)$, of course. The absolute value can never be negative.
In most cases were $b(x)+c$ is nonnegative, there are two solutions.
The assumption we make at the beginning of each case is guaranteed to be correct! For example, when we set $\phi(x) = a \left(\frac{1-b(x)-c}{1+b(x)+c}\right)$, it will always be the case algebraically that $-\frac{\phi(x)-a}{\phi(x)+a} = b(x) + c$, and since we must have $b(x) + c \ge 0$, we conclude that $-\frac{\phi(x)-a}{\phi(x)+a} \ge 0$.
Another way to state the final answer is that the function $\phi_1(x) = a \left(\frac{1-b(x)-c}{1+b(x)+c}\right)$ always works, and in cases where $\phi_1(x) \ne 0$, the function $\phi_2(x) = \frac{a^2}{\phi_1(x)}$ also works.