# How to prove if $f(x)$ is $O(\log_b (x))$, then $f(x)$ is $O(\log_a (x))$?

I was reading a book on discrete mathematics where they asked for a proof of "Show that for all real numbers $a$ and $b$ with $a > 1$ and $b > 1$, if $f(x)$ is $O(\log_b (x))$, then $f(x)$ is $O(\log_a (x))$". I searched Google where I found this,

$$\log_b(x) = \frac{\ln(x)}{\ln(b)}$$ $$\log_a(x) = \frac{\ln(x)}{\ln(a)}$$ $$\log_b(x) = \log_a(x)\cdot \frac{\ln(a)}{\ln(b)} = \log_a(x) \cdot \text{constant}$$

But I couldn't find the meaning of the last line. Is there another way to prove it?

The last line is simply the application of the first two: $$\log_b(x) = \frac{\ln(x)}{\ln(b)}= \ln(x) \cdot \frac{1}{\ln(b)} = \frac{\ln(x)}{\ln(a)} \cdot \ln(a) \cdot \frac{1}{\ln(b)} = \frac{\ln(x)}{\ln(a)} \cdot \frac{\ln(a) }{\ln(b)} = \log_a(x) \cdot \frac{\ln(a) }{\ln(b)}$$
Since $a$ and $b$ are constants, $\frac{\ln(a) }{\ln(b)}$ is constant as well.
Let $y = \log_b(x)$
Then, by definition of the logarithm, $$b^y=x$$ and taking $\log_a$ of both sides gives $$\log_ab^y=log_ax\implies y\log_ab = log_ax\implies y=\frac{\log_ax}{\log_ab}\implies \log_bx=\frac{\log_ax}{\log_ab}$$
Finally, since $\frac{1}{\log_ab}$ is a constant, $\log_bx = k\log_ax$