# Calculating logarithms to any base

In the previous part, we showed that y = ax, can be written in logarithmic form as logay = x.

Note that the number a, called the base, is always positive, that is, a > 0.

Sometimes we need to calculate logarithms to bases other than 10 or e, therefore we have to use the following two formulae:

\begin{align*} log_ax &= \frac{log_{10}x}{log_{10}a} \cr log_ax &= \frac{lnx}{ln a} \end{align*}

Let's take a look at how we would evaluate log6 19.

Step 1: Use the formula $$log_ax = \frac{log_{10}x}{log_{10}a}$$

Step 2: Compare log6 19 with the above formula, we see that x = 19 and a = 6.

Step 3: Substituting into the formula from Step 1: \begin{align*} log_6{19} &= \frac{log_{10}19}{log_{10} 6} \cr &= \frac{1.2788}{0.7782} \cr &= 1.6433 \end{align*}

Note: to calculate log1019 using the calculator, you just press 19 then 'log'

Alternatively, we might sometimes be asked questions such as to what power must 10 be raised to equal the number 5? We can reason that the number 5 is between 1 and 10 so the log of 5 must be greater than the log of 1 (which is 0) and less than the log of 10 (which is 1).

The same is true for the numbers 2, 3, 4, 6, 7, 8 and 9; that is, their logs are decimals between 0 and 1.

There is no intuitive way to know the exact log of 5, although we know it is between 0 and 1. Rather, it is necessary to look up the log in a table of logarithms, or to find it using a scientific calculator.

Let's take a look at how we can work this out:

5 = 10x

Take the log of both sides:

Log 5 = X

Therefore, using a calculator we simply press 5 then "log", which will give us 0.699 (rounded to the nearest 3 decimal places)

Therefore, 5 approximately equals 100.699