This is the point of the complexity measure. If the machine speed doubles, you can afford twice as many operations. If you have a process of complexity $n^2$ , you ask what $m$ will give twice as many operations. So we want $m^2=2n^2$ and solve it to get $m=\sqrt 2 n$. Similarly for a process with complexity $\log_2 n$, we ask what $m$ would give us $\log_2m = 2 \log_2 n$ By the laws of logarithms, this is solved by $m=n^2$