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

158 Views Asked by At

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$.

1

There are 1 best solutions below

0
On BEST ANSWER

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.