I am working in a group $G$ with 8 elements such that $a, b\in G$ and $ba=a^3b$. Moreover, I am given that both $b$ and $a$ have order 4 and $\langle a \rangle \neq \langle b \rangle$. I understand this group is isomorphic to Quaternion group, but this is not given and I am trying to prove this. I want to show $a^2=b^2$, but I am stuck. Here is what I have done so far:
$$(ab)^2=abab=a(ba)b=aa^3bb=a^4b^2=b^2$$
Also from the equality $ba=a^3b$ I can derive many other equalities, but they do not seem to give me anything useful. For instance
$$aba=b \text{ or } a^3ba^3=b$$
Another observation I have made is that both $b^2$ and $a^2$ have order 2. But I am not sure if that is enough to conclude $a^2=b^2$. Please guide me in the right direction.
The main relation can be written as $ba=a^{-1}b$, which implies $ba^2=a^{-2}b$. Since $a$ has order 4, this means $ba^2=a^2b$, so $a^2$ is central. The main relation also says $bab^{-1}=a^{-1}$; inverting this yields $ba^{-1}b^{-1}=a$. This in turn implies $b^2ab^{-2}=a$, so $b^2$ is also central. If $a^2\ne b^2$, then the center has at least 4 elements, and as no center can have index $2$, the group would have to be Abelian. Since this isn't the case, we see $b^2=a^2$ is the only non-identity element of the center. The OP already showed $(ab)^2$ is this same central element, so we have the quaternion group.