Why do these two presentations present the same group?

Note that $(ab)(ab)(ab) = (aba)(bab) = (aba)^2$; so there is a homomorphism from $H=\langle x,y\ :\ x^2=y^3\rangle$ to $G=\langle a,b\ :\ aba=bab\rangle$ that maps $x$ to $aba$ and $y$ to $ab$. However, the subgroup of $G$ generated by $aba$ and $ab$ is all of $G$, since $a = (ab)^{-1}(aba)$, and if the subgroup contains $a$ and $ab$, then it contains $b$. So the induced map $H\to G$ is onto.

Now notice that $y^{-1}x$ and $x^{-1}y^2$ satisfy the given relations for $a$ and $b$: $$\begin{align*} (y^{-1}x)(x^{-1}y^2)(y^{-1}x) &= x\\ (x^{-1}y^2)(y^{-1}x)(x^{-1}y^2) &= x^{-1}yy^2 = x^{-1}y^3 = x^{-1}x^2 = x. \end{align*}$$ So there is a homomorphism from $G$ to $H$ that maps $a$ to $y^{-1}x$ and $b$ to $x^{-1}y^2$. But the subgroup generated by $y^{-1}x$ and $x^{-1}y^2$ is all of $H$, since it contains $y^{-1}xx^{-1}y^2 = y$, and hence also $x$. So the induced map $G\to H$ is onto.

Finally, what about the composite maps? $G\to H\to G$ gives $$\begin{align*} a&\longmapsto y^{-1}x &&\longmapsto b^{-1}a^{-1}aba = a\\ b&\longmapsto x^{-1}y^2 &&\longmapsto a^{-1}b^{-1}a^{-1}abab = b. \end{align*}$$ Since the composition is the identity, the first map is one-to-one. Since it was already onto, it is an isomorphism, as desired. (Or check that the other composition is also the identity.)


Map the second group to the first by $x \longrightarrow aba$, $y \longrightarrow ba$. You can check that the relations in the second presentation are satisfied by $aba$ and $ba$, so you get a homomorphism.

Now define a map from the first to the second by $a \mapsto xy^{-1}$ and $b \mapsto y^2 x^{-1}$. Again, these elements of the second group satisfy the relations in the first, so you have a homomorphism.

Now these homomorphisms are mutually inverse, e.g $x \mapsto aba \mapsto xy^{-1} y^2 x^{-1} xy^{-1} = xyy^{-1}=x$. Therefore the groups are isomorphic.