Exponent of two integers

86 Views Asked by At

Uhm I'm having trouble solving for x in these type of equations: $a^x + b^x = c^x$ (where x is the only unknown)

I saw an instance by Presh Talwalkar in MindYourDecisions. I tried solving for x and used an example with a known answer. $3^x + 4^x = 5^x$

We all know that x = 2 but I don't know the correct approach. I tried $ln(3^x + 4^x) = xln(5)$ and got stuck.

2

There are 2 best solutions below

0
On

Actually for you

$$ 3^x + 4^x =5^x $$

You have already remark that (Pythagorician triplet) :

$$ 3^2 + 4^2 =5^2 $$


Now let

$$f : x \to 3^x + 4^x - 5^x $$

$$ f(x>2)<0 $$

So your solution is unique you can further look at https://www.wolframalpha.com/input/?i=3%5Ex%2B4%5Ex+-5%5Ex

In general cases, it is hard, look at Weil work or here at that pdf https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwiNnNW-5_vpAhVJyoUKHRoeDO4QFjAAegQIBBAB&url=http%3A%2F%2Fsites.williams.edu%2FMorgan%2Ffiles%2F2016%2F04%2Ffermat-irrational-exponents.pdf&usg=AOvVaw0hXYf0N0R4LT0-7wNT7SNA

0
On

For the most general case, assuming $a>0$ and $b>0$ to be smaller than $c$, you will not find analytical solutions and numerical methods should be used and, as usual, an initial estimate will be required.

So, as you did, instead of considering that we look for the zero of function $$f(x)=c^x-(a^x+b^x)$$ it is much better to consider $$g(x)=x \log(c)-\log(a^x+b^x)$$ which is "almost" the problem of the intersection of two straight lines.

Building Taylor expansion around $x=0$ gives $$g(x)=-\log (2)+x \left(\log(c)-\frac{\log (a)}{2}-\frac{\log (b)}{2}\right)+O\left(x^2\right)$$ Ignoring the higher order terms, an estimate is then $$x_0=\frac{2 \log (2)}{\log \left(\frac{c^2}{a b}\right)}$$ Using it, Newton method would converge very fast.

Just for illustration purposes, let us try for $a=5$, $b=7$, $c=11$. The iterates will be $$\left( \begin{array}{cc} n & x_n \\ 0 & 1.117580524 \\ 1 & 1.147416475 \\ 2 & 1.147437142 \end{array} \right)$$ which is quite fast.

As in your example, the case where $a,b,c$ are consecutive integers is interesting to look at. I made a table showing the values of $x_0$, $x_1$ and the exact solution.

$$\left( \begin{array}{cccc} a & x_0 & x_1 & \text{exact} \\ 1 & 0.92169 & 0.99949 & 1.00000 \\ 2 & 1.41339 & 1.50674 & 1.50713 \\ 3 & 1.88876 & 1.99964 & 2.00000 \\ 4 & 2.35850 & 2.48757 & 2.48794 \\ 5 & 2.82558 & 2.97317 & 2.97355 \\ 6 & 3.29119 & 3.45746 & 3.45787 \\ 7 & 3.75590 & 3.94096 & 3.94139 \\ 8 & 4.22002 & 4.42394 & 4.42439 \\ 9 & 4.68373 & 4.90655 & 4.90703 \\ 10 & 5.14714 & 5.38890 & 5.38941 \\ 11 & 5.61033 & 5.87105 & 5.87159 \\ 12 & 6.07335 & 6.35305 & 6.35362 \\ 13 & 6.53623 & 6.83493 & 6.83553 \\ 14 & 6.99902 & 7.31672 & 7.31735 \\ 15 & 7.46171 & 7.79843 & 7.79909 \end{array} \right)$$

Just for the fun of it, notice that, for this particular situation of consecutive numbers, $$x_0=\frac{2\log (2)}{\log \left(\frac{(n+2)^2}{n (n+1)}\right)}\sim \frac{ \log (2)}{9} (6 n+7)\sim \frac{n+1}2$$

Edit

There is another case which is of interest : $c>a+b$. Now the solution of $g(x)=0$ will be smaller that $1$. Expanding again as a Taylor series around $x=1$, we have $$x_0=1-\frac{(a+b) (\log (a+b)-\log (c)) } {a \log (a)+b \log (b) -(a+b) \log (c)}$$ For example, using $a=3$, $b=5$ and $c=9$ gives $x_0=0.848869$ while the exact solution is $0.849760$.