How to solve the polynomial equation $\sum_{i=1}^{i=m} \frac{l_i}{l_i - x} = n$? Let m and n be strictly positive integers, and a set of m real positive numbers $$l_{i, i \in \{ 1, m \}}.$$
I want to solve numerically: $$\sum_{i=1}^{i=m} \frac{l_i}{l_i - x} = n$$
finding the m solutions x to this equation.
I look for an effective algorithm to do it for values of m like 50, 100, 1000, or more.
Any idea?
Thanks a lot
 A: Given
$$
\sum_{i=1}^{i=m} \frac{\ell_i}{\ell_i-x} = n.
$$
Due to the symmetry we consider $\ell_i$ to be ordered, such that $\ell_i < \ell_{i+1}$.
Let us write
$$
f(x) = \sum_{i=1}^{i=m} \frac{\ell_i}{\ell_i-x}.
$$

We see that
$$
f'(x) = \sum_{i=1}^{i=m} \frac{\ell_i}{(\ell_i-x)^2},
$$
whence $f'(x)>0$.
We also note that
$$
f(\ell_k - \epsilon) < 0,
$$
and
$$
f(\ell_k + \epsilon) > 0,
$$
So there is always a solution for
$$
\ell_i < x < \ell_{i+1}.
$$

As
$$
f(x) < 0\ \textrm{for}\ x > \ell_m,
$$
we find the last solution for
$$
x < \ell_i
$$

We can start with
$$
x_i = \frac{\ell_{i-1} + \ell_i}{2},
$$
where we use $\ell_0=0$. We then repeat
$$
x_i \mapsto x_i - \frac{f(x_i)}{f'(x_i)}
$$
to optimize the solutions.
A: $\Sigma \frac{l_i}{l_i-x} = n$
$\Sigma (1 + \frac{x}{l_i-x}) = n$
$m + x\Sigma\frac{1}{l_i-x} = n$
$x \Sigma\frac{1}{l_i-x} = n - m $ 
I don't think, you may get further with optimalization of this equation.
Regardless on what you do, you'll have to apply Newton or other iterative algorithm.
A: The solution I was drawn to and found to work very well is simply to work by dichotomy. Indeed, there are m solutions to this equation and each solution lies in ]l_i, l_{i+1}[.
It is very straitforward to implement and very efficient.
