GAP can tell you if a word on a finite alphabet is expressible as a product of conjugates of a given list of words. In the example below, it tells us that the word $x^3yx^3y$ is expressible as a product of conjugates of the words $x^4$, $y^2$, $xyxy$:
gap> H := FreeGroup("x", "y");
<free group on the generators [ x, y ]>
gap> x := H.1;
x
gap> y := H.2;
y
gap> G := H / [ y^2, x^4, x*y*x*y ];
<fp group on the generators [ x, y ]>
gap> x := G.1;
x
gap> y := G.2;
y
gap> x^3*y*x^3*y = x^0;
true
However, telling us that such a product exists does not tell us what it is. For instance, in the example above, we have:
$x^3yx^3y = (x^3 \color{red}{y^2} x^{-3}) \cdot \color{red}{x^4} \cdot (y(\color{red}{xyxy})^{-1}y^{-1}) \cdot (y\color{red}{x^4}y^{-1}) \cdot \color{red}{y^2}$
Is there any way we can ask GAP (or any other computer algebra package) to actually compute such a product rather than merely telling us that it exists?
As long as the quotient group $G$ is small (the reason for small is related to Derek Holt's observatiuon that this is a hard problem), you could form suitable generators of the kernel (as conjugates of relators) and use the general rewriting mechanism to express elements (that is their
UnderlyingElementin the free group) as word in the conjugate relators. In your example:so the expression is $(x^4)\cdot (y^2)^x /(xyxy)\cdot (y^2)\cdot (x^4)^y$, by looking at the
relsof indices 3,2,5,1,9.