I was trying to find an answer to my question. In fact I want to show that in the group $G = \{a,b | a^{2n},b^4,(ab)^2,(ab^-1)^2\}$ the elements $a$ and $b^2$ commute. Therefore I tried the following:
F := FreeGroup("a", "b");;
AssignGeneratorVariables(F);;
#I Assigned the global variables [ a, b ]
rel := [a^12, b^4, (a*b)^2, (a*b^-1)^2];;
G := F/rel;;
hom := EpimorphismFromFreeGroup(G:names:=["x","y"]);;
K := Kernel(hom);;
gK := GeneratorsOfGroup(K);
[ (y*x)^2, (y*x^-1)^2, (y^-1*x)^2, (y^-1*x^-1)^2, y^-4,
x*(y*x^-1)^2*x^-1, x*(y^-1*x^-1)^2*x^-1, x*y^-4*x^-1,
x^-1*(y*x)^2*x, x^-1*(y^-1*x)^2*x, x^-1*y^-4*x, y^2*x*y^-2*x^-1,
y^2*x^-1*y^-2*x, x^2*(y*x^-1)^2*x^-2, x^2*(y^-1*x^-1)^2*x^-2,
x^2*y^-4*x^-2, x*y^2*x*y^-2*x^-2, x^-2*(y*x)^2*x^2,
x^-2*(y^-1*x)^2*x^2, x^-2*y^-4*x^2, x^-1*y^2*x^-1*y^-2*x^2,
x^3*(y*x^-1)^2*x^-3, x^3*(y^-1*x^-1)^2*x^-3, x^3*y^-4*x^-3,
x^2*y^2*x*y^-2*x^-3, x^-3*(y*x)^2*x^3, x^-3*(y^-1*x)^2*x^3,
x^-3*y^-4*x^3, x^-2*y^2*x^-1*y^-2*x^3, x^4*(y*x^-1)^2*x^-4,
x^4*(y^-1*x^-1)^2*x^-4, x^4*y^-4*x^-4, x^3*y^2*x*y^-2*x^-4, x^-12,
x^-4*(y*x)^2*x^4, x^-4*(y^-1*x)^2*x^4, x^-4*y^-4*x^4,
x^-3*y^2*x^-1*y^-2*x^4, x^5*(y*x^-1)^2*x^-5, x^5*(y^-1*x^-1)^2*x^-5,
x^5*y^-4*x^-5, x^4*y^2*x*y^-2*x^-5, x^-5*y*x*y*x^-6,
x^-5*y^-1*x*y^-1*x^-6, x^-5*y^-4*x^5, x^-4*y^2*x^-1*y^-2*x^5,
x^6*y^-4*x^-6, x^5*y^2*x*y^-2*x^-6, x^-5*y^2*x^-1*y^-2*x^-6 ]
I see that the relators and some of their conjugates are generators of $K$ but why is $y^2xy^{-2}x^{-1}$, the commutator of $x$ with $y^2$, also a generator?
off topic this curiousity:
Image(hom, gK);
[ (b^-1*a^-1)^2 ]