Solve $e^{k_1/x}+e^{k_2/x}+\cdots+e^{k_N/x}=1$ for $x$ How can I solve $e^{k_1/x}+e^{k_2/x}+\cdots+e^{k_N/x}=1$ for $x$,
where $N\geq 1, k_1,\ldots,k_N \in \mathbb{R}, k_1,\ldots,k_N < 0, x\in \mathbb{R}$ and $x >0$.
I looked at the basic rules of exponentiation and logarithms and they do not seem to help simplify the equation in this particular case.
As a side comment: the values of $N$ I am working with are $N\approx 10^6$. 
 A: Let
$f(x)
= e^{k_1/x}+e^{k_2/x}+\cdots+e^{k_N/x}-1
=\sum_{i=1}^N e^{k_i/x}-1
$,
and let
$K = \sum_{i=1}^N k_i
$.
The restrictions that
$x > 0$
and
$k_i < 0$
are important in what follows.
$f'(x)
=\sum -\frac{k_i}{x^2}e^{k_i/x}
=-\frac1{x^2}\sum k_ie^{k_i/x}
=\frac1{x^2}\sum |k_i|e^{k_i/x}
$,
so
$f'(x) > 0$.
This means that
your function has
at most one root.
Since $f(x) < 0$
for small $x$
and
$f(x) > 0$
for large $x$,
$f$ has exactly one positive root.
To get simple bounds
on the root of
$f(x) = 0$,
let
$k_{min} = \min(k_i)$
and
$k_{max} = \max(k_i)$.
Note that,
since the $k_i < 0$,
$|k_{min}|
>|k_{max}|
$.
Then
$e^{k_{min}/x}
\le e^{k_i/x}
\le e^{k_{max}/x}
$
so
$e^{k_{min}/x}
\le \dfrac{\sum_{i=1}^N e^{k_i/x}}{N}
\le e^{k_{max}/x}
$.
If
$f(x) = 0
$, then
$e^{k_{min}/x}
\le \dfrac{1}{N}
\le e^{k_{max}/x}
$
or
$k_{min}/x
\le -\ln(N)
\le k_{max}/x
$
or,
since $k_i < 0$,
$|k_{min}|/x
\ge \ln(N)
\ge |k_{max}|/x
$
or
$\frac{|k_{max}|}{\ln(N)}
\le x
\le \frac{|k_{min}|}{\ln(N)}
$.
Another bound can be gotten using
$e^z \ge 1+z$.
$f(x)
\ge \sum (1+k_i/x) - 1
= N+\frac1{x}\sum k_i - 1
= N+\frac{K}{x} - 1
$.
If
$f(x) = 0$,
then
$1-N 
\ge \frac{K}{x}
= -\frac{|K|}{x}
$
or
$N-1 
\le \frac{|K|}{x}
$
or
$x \le \frac{|K|}{N-1}
$.
This can be improved
by using the inequality
between the arithmetic and geometric means.
$\begin{array}\\
\dfrac{\sum_{i=1}^N e^{k_i/x}}{N}
&\ge \left(\prod_{i=1}^N e^{k_i/x}\right)^{1/N}\\
&= e^{\sum_{i=1}^N k_i/(Nx)}\\
&= e^{K/(Nx)}\\
\end{array}
$
Therefore,
if $f(x) = 0$,
$\dfrac1{N}
\ge e^{K/(Nx)}
$
or
$-\ln(N)
\ge K/(Nx)
$
or
$\ln(N) \le |K|/(Nx)
$
or
$x \le \dfrac{|K|}{N\ln(N)}
$.
So an initial $x$
could be
$x_0
=\frac{|K|}{N\ln(N)}
$.
We can then apply
Newton's iteration,
$x_{n+1}
=x_n - \frac{f(x_n)}{f'(x_n)}
$
a few times
and see what happens.
It should be OK.
A: This is equivalent to finding roots of the polynomial
$$y^{-k_1}+\cdots +y^{-k_N}-1=0$$
(by making $y:= e^{-\frac{1}{x}}$) so your problem is as difficult as finding roots of polynomials. It depends on the degree of that polynomial, in this case, it depends on the max of the $-k_i$.
A: Write an algorithm to solve the problem...
Let

$$
Q = \left( \sum_{m=1}^{n} \exp(k_m y) - 1 \right)^2.
$$

In case we have the solution, we have
$$
Q = 0
$$.
For changes in $Q$ we have

$$
\delta Q = 2 Q \left( \sum_{m=1}^{n} k_m \exp(k_m y) \right) \delta y.
$$

For each step use

$$
\delta y = - 2 Q \left( \sum_{m=1}^{n} k_m \exp(k_m y) \right),
$$

whence

$$
\delta Q \le 0,
$$

so we get closer to the solution.
Once you have found $y$, the solution for $x$ is given by

$$
x = \frac{1}{y}.
$$

This would do the trick.
