1

Given constants $c_i > 0$ and $K > 0$, find $b > 0$ numerically such that $b^{c_1} + b^{c_2} + \dots + b^{c_n} = K$. I'd like to solve this with a non-iterative method if possible.

My attempt at isolating b (applying the identity $\log(x + y) = \log x + \log(1 + y/x)$):

$$K = b^{c_1} + b^{c_2} + \dots$$ $$\log(K) = \log(b^{c_1} + b^{c_2} + \dots)$$ $$\log(K) = c_1 \log(b) + \log(1 + b^{c_2-c_1} + b^{c_3-c_1} + \dots)$$ $$\log(K) = c_1 \log(b) + \log(1 + b^{c_2-c_1}) + \log(1 + \frac{b^{c_3-c_1}}{(1 + b^{c_2-c_1})} + \dots)$$ $$\log(K) = c_1 \log(b) + \log(1 + b^{c_2-c_1}) + \log(1 + \frac{b^{c_3-c_1}}{(1 + b^{c_2-c_1})}) + \log(1 + \dots)$$

It doesn't appear to lead anywhere clean where I can isolate $b$ and use the log1p function. Any ideas?

1 Answers1

1

I shall admit that the $c_i$ are sorted by increasing order.

For the most general case, you will need an iterative method to find the zero of the equation $$f(b)=\sum_{i=1}^n b^{c_i} -K$$ Since $f(b)$ may vary very fast, it is better (as you did) to consider instead the function $$g(b)=\log\left(\sum_{i=1}^n b^{c_i} \right)-\log(K)$$ for which $$g'(b)=\frac{\sum_{i=1}^n c_i\,b^{c_i-1} } {\sum_{i=1}^n b^{c_i} }$$

In comments, @Ivan Kaznacheyeu gave bounds for the variable. So, take the midpoint and start Newton method or, if you are as lazy as I am, start with $b_0=1$.

For illustration, take $n=10$, let $c_i$ be the first prime numbers and $K=10^{15}$. So, the iterates will be $$\left( \begin{array}{cc} n & b_n \\ 0 & 1.00000 \\ 1 & 3.49893 \\ 2 & 3.28378 \\ 3 & 3.29025 \end{array} \right)$$