It is known that solution of the equation $e^x=c$ is $x=\ln(c)+2\pi i n$. I want to use above fact to solve the equation $a^x=b$. So, $$a^x=b$$ $$x=\frac{\ln(b)}{\ln(a)}$$ $$e^x=e^{\frac{\ln(b)}{\ln(a)}}$$ $$x=\ln\left(e^{\frac{\ln(b)}{\ln(a)}}\right)+2\pi i n$$ $$x=\frac{\ln(b)}{\ln(a)}+2\pi i n$$ But correct formula is $$x=\frac{\ln(b)+2\pi i n}{\ln(a)}$$
Where am I wrong?
At first you say that $x = \frac{\ln(b)}{\ln(a)}$ and assume it's the only solution, then you use that value in an exponential equation. Essentially you have two different things that you both call $x$.
In general, when you apply transformations to both sides of an equation, the next step is implied by the previous, because $x=y \implies f(x) = f(y)$. However, the opposite is not guaranteed to be true. That's why you need to check your solutions.
The correct solution to your equation would be $$ a^x = b\\ e^{x \ln(a)} = b\\ e^{x \ln(a)} = e^{\ln(b)}\\ x \ln(a) = \ln(b) + 2\pi i n\\ x = \frac{\ln(b) + 2\pi i n}{\ln(a)} $$