Solving 2^x + 3^x = 13 for x (needing method for software)

zeroes00

New member
Joined
Sep 20, 2008
Messages
8
I have no idea how to solve x from the equation:
\(\displaystyle 2^x+3^x = 13\)

I'm writing a software that should be able solve x in a similar but more complex situation:
\(\displaystyle as^1^/^x+bt^1^/^x+cu^1^/^x = p(a+b+c)\)

...where a, b, c, s, t, u and p are known positive real numbers

I could make the software guess the x value until it gets close enough, but since speed is essential for this software, I'd rather not. If teaching this stuff is too complex, then pointing me to any learning material on this issue would be also appreciated.
 
Re: Solving exponent

Just looking at it, I can tell the answer is x=2.

\(\displaystyle 2^{2}+3^{2}=4+9=13\)

But.....if this were not so obvious, then Newton's method is an old standby.

Newton's method is \(\displaystyle x_{n+1}=x_{n}-\frac{f(x_{n})}{f'(x_{n})}\)

Say we had \(\displaystyle 2^{x}+5^{x}=13\)

This is gong to have some non-integer solution.

We know the answer is going to be between 1 and 2, so make an initial guess of, say, 1.5

Then perform the iterations. Newton's method is easy to write a program for because it is iterative and you can simply put in a loop that terminates when you want it to.

\(\displaystyle f(x)=2^{x}+5^{x}-13\)

\(\displaystyle f'(x)=ln(5)5^{x}+ln(2)2^{x}\)

\(\displaystyle 1.5-\frac{2^{1.5}+5^{1.5}}{ln(5)5^{1.5}+ln(2)2^{1.5}}=1.44944684108\)

Do it again using that value and get 1.44740481909

Again and get 1.4474016528, which is the answer within more than enough decimal points.
 
Re: Solving exponent

Thanks a lot, this is great. The method I had thought for guessing the values would have been much slower. By the way there's \(\displaystyle -13\) missing above the division line.
 
Top