The differential equation $$\frac{dy}{dx}\,=\,\frac{A}{x}$$ has the general solution: $$y\,=\,\begin{cases} \begin{array}{c} A\log(x)+B\\ A\log(-x)+C \end{array} & \begin{array}{c} x>0\\ x<0, \end{array}\end{cases}$$ which can be written as $y(x)\,=\,A\log|x|+(B-C)\,\Theta(x)+C$.
Now, I would like to reproduce the same result by analyzing the $\epsilon\rightarrow0$ limit of the more general differential equation $$\frac{dy}{dx}\,=\,\frac{A}{x+i\epsilon}.$$ The solution now is simply $y=A\ln(x+i\epsilon)$. How do I show that this reduce to the above solution when $\epsilon\rightarrow0$ ?
In complex analysis we learn that $$ \ln(x+i\epsilon) = \ln\sqrt{x^2+\epsilon^2} + i\arctan\frac{\epsilon}{x} + i2\pi n, $$ where $n\in\mathbb Z.$
When $\epsilon\to 0^+$ we have $$ \ln(x+i\epsilon) \to \ln|x| + i\pi H(-x) + i2\pi n, $$ where $H$ is the Heaviside step function.
When $\epsilon\to 0^-$ we instead have $$ \ln(x+i\epsilon) \to \ln|x| - i\pi H(-x) + i2\pi n, $$ i.e. with a minus sign instead of a plus sign in front of $i\pi H(-x).$