# How to solve $a^x + b^x = c \exp(d/e) - f$ for $x$

Is it possible to solve the following equation for $x$?

$$a^x + b^x = c \exp(\frac{d}{e}) - f$$

Here, $a, b, c, d, e, f$ is real values and $a, b, e \neq 0$.

• I doubt that the general case is solvable, but it can be done trivially if $a=b$, using the quadratic formula if $a=b^2$ or $a=1/b$, or using the cubic formula if $a=b^3$ or $a=1/b^2$. Commented Jun 19, 2018 at 23:16
• "Is it possible to solve" depends on what you require. Stripped to its basics you have an equation $a^x + b^x = K$, Hopefully $a,b \gt 0$. If $a$ happens to be an exact power of $b$ (or conversely), then we have a polynomial type problem (but it might not be solvable in radicals). Still it is easy enough to show (assuming $a,b \gt 0$ and $K \gt a+b$) that a real solution $x$ exists. Commented Jun 19, 2018 at 23:19
• You may try Lagrange inversion theorem... Commented Jun 19, 2018 at 23:20
• @hardmath - is there a better lower bound than $K>a+b$? Certainly if $a,b > 1$ then there is a solution for every $K > 0$. Additionally, if $a=b=1$, then only $K=2$ has a solution Commented Jun 19, 2018 at 23:28
• @AlexReinking: Right, if we know something about $a,b$ we can give better lower bounds on $K$. $f(x) = a^x + b^x$ is unbounded (above) when $a,b \gt 0$, and if both $a,b \gt 1$ or both $a,b \in (0.1)$, then any $K\gt 0$ is feasible. The interesting case is when $a\gt 1 \gt b$ or $a\lt 1 \lt b$, and the minimum value of $f(x)$ can be computed for $K$. Commented Jun 20, 2018 at 0:07

As already said in comments, except if a few cases where the equation reduces to a polynomial, a numerical method would be required. I shall assume that both $a$ and $b$ are positive.
Consider that you look for the zero(s) of function $$f(x)=a^x+b^x-k$$ It varies very fast as soon as $a$ or $b$ is $>1$ and without loss of generality that $a<b$. Assuming $k>0$, it is better to consider that you look for the zero(s) of function $$g(x)=\log(a^x+b^x)-\log(k)$$ for which $$g'(x)=\frac{a^x \log (a)+b^x \log (b)}{a^x+b^x}$$ $$g''(x)=\frac{a^x b^x (\log (a)-\log (b))^2}{\left(a^x+b^x\right)^2}>0$$ The first derivative may cancel at a point $x_*$ such that $$x_*=-\frac{\log \left(-\frac{\log (a)}{\log (b)}\right)}{\log (a)-\log (b)}$$ which can only exist if $a < 1$. If, this is the case, compute $g(x_*)$. If it is $g(x_*> \log(k)$, there is no solution. If $g(x_*)= \log(k)$ , $x_*$ is the solution and If $g(x_*)< \log(k)$, there two solutions such that $x_1 < x_*$ and $x_2 > x_*$. To estimate these solutions, you can develop $g(x)$ as a Taylor series around $x_*$ and get, as very rough estimates $$x_1^{est}=x_*-\sqrt{2} \frac{\sqrt{g''(x_*)\, (\log (k)-g(x_*))}}{g''(x_*)}$$ $$x_2^{est}=x_*+\sqrt{2} \frac{ \sqrt{g''(x_*)\, (\log (k)-g(x_*))}}{g''(x_*)}$$ which would be the starting points for Newton method.
If $x_*$ does not exist, there is only one solution and you could start Newton even at $x=0$ since function $g(x)$ is almost a straight line.
For illustration purposes, let us consider $a=\frac 12$ and $b=3$. We have $$x_*=-\frac{\log \left(\frac{\log (3)}{\log (2)}\right)}{\log (6)}\approx -0.257044\implies g(x_*)\approx 0.667319-\log(k)$$ Now, assuming $k=123.456$, we have as estimates $x_1^{est}\approx -3.55792$ and $x_2^{est}\approx 3.04383$. Newton iterates will then be $$\left( \begin{array}{cc} n & x_1^{(n)} \\ 0 & -3.55792 \\ 1 & -6.96036 \\ 2 & -6.94785 \\ 3 & -6.94785 \end{array} \right)$$ $$\left( \begin{array}{cc} n & x_2^{(n)} \\ 0 & 3.04383 \\ 1 & 4.38907 \\ 2 & 4.38325 \end{array} \right)$$ which are the solutions for six significant figures.
Using the same numbers, except $a=2$, we should have $$\left( \begin{array}{cc} n & x^{(n)} \\ 0 & 0.00000 \\ 1 & 4.60189 \\ 2 & 4.23446 \\ 3 & 4.23317 \end{array} \right)$$ I hope and wish that you could percieve that, numerically, the problem is not very difficult.