TITLE: How do I solve for $x$ in $ab^x-cd^x=e$?
QUESTION [5 upvotes]: For example: I know that $5*1.2^{13}-8*1.1^{13}\approx26$. How do I find the exponential value (13 in the previous example) that would equate to 26 exactly? The answer should be something close to 13.017, but I cannot figure out the precise formula that solves for the exponential value.

REPLY [2 votes]: For the most general case, you will not get any analytical solution for the equation
$$ab^x-cd^x=e$$ and some numerical method (Newton would be the simplest) would be required. For the exercise, let us assume that all coefficients $a,b,c,d$ are positive and consider that you look for the zero of function
$$f(x)=ab^x-cd^x-e$$ It is not very well consitioned since each term can vary very fast. So, instead, consider the function
$$g(x)=\log(a b^x)-\log(cd^x+e)=\log(a)+x \log(b)-\log(cd^x+e)$$ which will look like a straight line.
Because ot that, we can start Newton using $x_0=0$ and get as a first estimate
$$x_1=-\frac{\log (a)-\log (c+e)}{\log (b)-\frac{c }{c+e}\log (d)}$$
Using your numbers,  the first iterate would be $11.9886$ and the successive iterates would be (with a ridiculous number of figures)
$$\left(
\begin{array}{cc}
n & x_n \\
 0 & 0 \\
 1 & 11.988586471043999070 \\
 2 & 13.008178802782428286 \\
 3 & 13.017039083216507506 \\
 4 & 13.017039751873577944 \\
 5 & 13.017039751873581752
\end{array}
\right)$$
Just to make it more funny, let us keep all your numbers but change $e=26$ to $e=123456789$. Doing the same,
$$\left(
\begin{array}{cc}
n & x_n \\
 0 & 0 \\
 1 & 93.362325303012764401 \\
 2 & 93.364923494763192368 \\
 3 & 93.364923494842914130
\end{array}
\right)$$