TITLE: Solving for a variable that's an exponent
QUESTION [5 upvotes]: How would you figure out this?
$x^y = z$
How do you find out $y$ if you know $x$ and $z$ ?

REPLY [7 votes]: This section on wikipedia explains how.
You take the logarithm of both sides, 
$$
\begin{align*}
x^y=z &\implies \log{x^y}=\log{z}\\
&\implies y\log{x}=\log{z}\\
&\implies y=\frac{\log{z}}{\log{x}}=\log_x{z}.
\end{align*}
$$
The second and third implications follow by standard rules for logarithms.

REPLY [5 votes]: Integers
Divide $z$ by $x$ until you get 1, how many times did it take?: $y$ times.
I'll give an example, $343 = 7^{something}$, but what value is "something"?

$\frac{343}{7} = 49$, 
$\frac{49}7 = 7$,
$\frac77 = 1$ 

...so it's 3. Three separate divisions by 7 lead to one, so 7 x 7 x 7 = 343. 
therefore $7^3 = 343$.
Polynomials
If you suspect $q = p^k$ but don't know $k$ or $q$ you can easily find it out by taking the greatest common divisor of the derivative of $q$ with $q$.
Reals and complex numbers
The logarithm function is defined by this equation