# Solve for $x : A^x- B ^x= C$ How to approach this kind of equation

Solve for $x$in the below equation. I have an equation in the below format
$A^x- B^x= C$ How to approach this kind of equation and solve for $x$. I took log on both sides and it doesn't work out for me .. Any suggestions

• Welcome to Math.SE! Can you include your own trial: what didn't work out when you took the log? – Hrodelbert Jul 23 '15 at 11:17
• log(A-B)=log A+log(1-B/A) is the expression I used... so log(A^x-B^x) becomes x log A+ log(1 - B^x / A^x) again the expression log (1-B^x /A^ x ) will be again an log(A-B) formula .. which continues on... . – rkhds Jul 23 '15 at 11:29
• In general you can't do this explicitly with elementary functions, unless there is a simple relationship between $A$ and $B$ (e.g. $A=B^2$). – Ian Jul 23 '15 at 11:35
• Though I don't think that you can get closed form solution for this equation, you can get numerical solution by using different numerical methods, for example, Newton's method – Samrat Mukhopadhyay Jul 23 '15 at 11:39
• I agree, numerically you could give newton's method (or any other root finder) a try. sometimes one also can see a solution - but the on the other hand, how many solutions are there? BTW you can also edit your question and add your comment to the question body – user190080 Jul 23 '15 at 11:42

In the most general case, the root of equations such $$f(x)= A^x- B ^x- C=0$$ cannot be expressed explicitly and numerical methods (such as Newton) should be required.

Let us admit that $A,B,C$ are real and positive numbers and $A\gt B$. Function $f(x)$ can be very stiff but $$g(x)=x\log(A)-\log(C+B^x)$$ can be almost a straight line which is good for the solver.

For illustration purposes, let us use $A=7, B=5, C=123456789$. If you plot the function, for sure you will notice that the root is somewhere close to $x_0=10$. So, let us try Newton method with function $f(x)$; this will generate the following iterates $$x_1=9.720476380$$ $$x_2=9.609545440$$ $$x_3=9.595611384$$ $$x_4=9.595417884$$ $$x_5=9.595417847$$ which is the solution for ten significant figures.

Let us do the same using function $g(x)$; this will generate the following iterates $$x_1=9.588841160$$ $$x_2=9.595416723$$ $$x_3=9.595417847$$ which is incredibly must faster.

What could be amazing to you is that, being very lazy and starting at $x_0=0$, the first iterate of Newton method would have been $x_1=9.57465$ already quite close to the solution.

For the general case, you could safely start iterating at $$x_1=\frac{(C+1) \log (C+1)}{(C+1) \log (A)-\log (B)}$$ which is the first iterate of Newton method applied to function $g(x)$ starting at $x_0=0$.

• Hi Claude ,I tried with my A and B values .The solution was very helpful.Thanks a lot – rkhds Jul 24 '15 at 10:56
• @rkhds. You are very welcome ! Simple, isn't it ? – Claude Leibovici Jul 24 '15 at 11:14

If we set $y = A^x$, we can rewrite this as $$y - y^{\log_A(B)} = C$$ So solving your equation (i.e. getting an exact result) is equivalent to solving this one.

Of course, if $C = 0$, then we can always solve this.

Otherwise: If $\log_A(B)$ is an integer, then this is a polynomial, which may not always be "solvable" in a satisfying sense. Otherwise, we have even less of a chance of getting an exact solution.

So, for arbitrary $A,B,$ and $C$: if you want to solve this, you're better off with some kind of numerical approximation method.

• There is at least one case where you can get a solution even if $\log_AB$ is not an integer, viz., when it's $1/2$. – Gerry Myerson Jul 23 '15 at 12:51