# How to solve what base a logarithm should be in to make an equation true.

I have an equation of the form:

$$\log_a(c) = a^b$$

I know how to solve for b and how to solve for c, but how do I solve for a?

Well,

$$a = e^{(\operatorname{ProductLog}(\log_e(c)\cdot b)/b)}$$

I've pieced together this solution^ using a combination of wolfram alpha and clever reverse-queries... but I don't know what ProductLog is (I can google and see it's Lambert W Function and that approximating that is very computationally expensive [note: I'm a programmer so I need fast stuff]).

I'm wondering if there is a simple way to get a by itself in that equation just using known log identities rather than this convoluted productLog answer I came up with, but I don't know much about log identities and seem to have a very hard time getting a by itself. I can get b and c by themselves fairly easily to solve for them in a general form, but I don't know how to solve for a in a general form.

Any insights?

• No, there isn't a way to do it without something ultimately equivalent to the W function. That said you should be able to find reasonably fast implementations of the W function out there, or you can just try to solve the equation using Newton's method or a similar algorithm. Initializing it with $[\ln(bc)]^{1/b}$ should converge fairly quickly, particularly if $c$ is not too big.
– Ian
Dec 12, 2019 at 21:58

The simplest form of the solution is $$a=\left(\frac{t}{W(t)}\right)^{\frac{1}{b}}\qquad \text{where} \qquad t=b\, \log(c)$$
If I had to solve the equation for $$a$$, I should let $$x=a^b$$ and solve for $$x$$ $$x=\frac{t}{W(t)}$$ the right hand side being very linear and easy to approximate for small and large values of $$t$$.