Note: This may not be correct mathematical term, so in case of confusion, I mean what division is to multiplication. If not, just poke me in the comments.
I was given this the other day:
$2^x=8$
Which I solved as follows:
$2^x=2^3 \implies x=3$
What did I actually do to solve the equation?
Does this apply for other numbers and is there a general rule? I.e. $n^x$
The property you employed to conclude $x=3$ from $2^x = 2^3$ is called the injective property of the function $f(x)=2^x$.
A function is said to be injective (or 1-1) if $$f(a)=f(b) \implies a=b.$$
In the case of $f(x) = n^x$ for a fixed positive $n$ (except for $n=1$), the function is injective, so you can make the same conclusion. Thus $3^x = 27 \implies x=3$, $2^{x} = 1024 \implies x=10$ etc.
Functions that are injective, are invertible. This means that there is another function, $g$, whose domain is the range of the original function, $f$, for which $$g(f(x)) = x$$ for all $x$ in the domain of $f$.
The inverse function for the function $f(x) = n^x$ is called the logarithm of base $n$, $log_n(x)$. Note that $n$ does not have to be an integer, and a special base $e$ is associated with the natural logarithm: $\ln(x) = \log_e(x)$.
Thus $\log_2(2^x) = x$. We can use this to "solve" for $x$ in $2^x=8$:
$$2^x = 8$$ $$\log_2(2^x) = \log_2(8)$$ $$x = \log_2(2^3) = 3.$$
However, this is no different from using the injective property of $2^x$.