If I go onto Wolfram alpha and type 2 **x == 56 I see that x is around 5.8. What is a formula I can use to find the exact number (given use of a calculator)?
For example I have the following two times which are runtimes of a computation:
a = 0.005689493999852857
b = 151.89659522200054
I want to find the value of x such that a^x = b
So tried log a (b) which gave me -0.9717681977154843
My hunch is that since a is less than one, it needs to be given a negative exponent. However I'm not sure how to use this negative value, as opposed to a positive one. Should I just add one to both a and b before doing the logarithm, to ensure it's a positive exponent?
Taking logarithms of both sides will convert this to a linear equation which is easily solved: $$2^x=56$$ $$\log(2^x)= \log 56 \tag{take $\log$ of both sides}$$ $$x\log 2 = \log 56\tag{property of logarithms}$$ $$x=\frac{\log 56}{\log 2}\tag{solve linear equation}$$
This works for any base of the logarithm. Calculators typically have $\log_{10}$ or $\log_e$ (often denoted "LOG" and "LN", respectively). Using the latter, I get the approximation
$$x \approx \frac{4.02434}{0.69315}\approx \boxed{5.80735}$$
The property of logarithms we used in the third line was $\log a^b=b\log a$.