Lower central series of a free group Consider the element $w=x^2yx^{-1}y^{-1}x^{-1}yxy^{-1}x^{-1}$ of the free group $F_2=\langle x,y\rangle$. By considering the image of this element under the abelianization map (equivalently, by adding exponents), we know that $w$ is in the commutator subgroup $(F_2)_2 = [F_2,F_2]$. In fact I can algorithmically decompose $w$ into a product of commutators. Doing so, I come up with $w = [x^2,y][y,x]^2$.
But in fact even more is true: $w=[x,[x,y]]$, so in fact $w\in(F_2)_3 = [[F_2,F_2],F_2]$. How could I have determined this algorithmically?
In general, given $w\in F_2$, how can I determine how far down the lower central series $w$ is?
References are appreciated, especially online references on the surrounding theory.
 A: Not long after I posted my question I found the standard answer to my question. I'll include it here for the benefit of anybody else with a similar question. A key search-word is "basic commutators", and the following can be found in full detail in the classic group theory text of M. Hall, who first defined basic commutators.
Herein I use the convention $[x,y]=x^{-1}y^{-1}xy$, so that $xy = yx[x,y]$.
Let $F$ be a free group, say on generators $x_1,\dots,x_n$. Suppose we have a word $w\in F$, and suppose for simplicity that no inverse $x_1^{-1},\dots,x_n^{-1}$ occurs as a letter in $w$. Then one can "collect" the $x_1$ terms as follows: Whenever you see $yx_1$, where $y\in\{x_2,\dots,x_n\}$, replace it with $x_1y[y,x_1]$. Promote the symbols $[x_i,x_1]$ to the status of letter, and then collect $x_2$ terms similarly. That is, whenever you see $yx_2$, where $y\in\{x_3,\dots,x_n,[x_2,x_1],\dots,[x_n,x_1]\}$, replace it with $x_2y[y,x_2]$. Keep going. After you collect $x_n$ terms, start collecting $[x_2,x_1]$ terms, and so on.
Here is an example, with $x=x_1$,$y=x_2$,$z=x_3$. Take $w=zyx$. After collecting $x$ we have $w=xz[z,x]y[y,x]$. After collecting $y$, $w=xyz[z,y][z,x][[z,x],y][y,x]$. No $z$ collection is needed, so now we collect $[y,x]$, getting
$$w=xyz\,[y,x]\,[z,y]\,[[z,y],[y,x]]\,[z,x]\,[[z,x],[y,x]]\,[[z,x],y]\,[[[z,x],y],[y,x]],$$
and so on. This process need not terminate, but it will certainly terminate modulo any fixed term of the lower central series (because eventually all commutators are trivial).
What is a basic commutator? A basic commutator is anything that gets "promoted to letter" in the above process. Formally, we inductively define the ordered set of basic commutators as follows. The basic commuators of weight 1 are the letters $x_1,\dots,x_n$, ordered arbitrarily (ignore the fact that these are not actually commutators). A basic commutator of weight $n>1$ is a word of the form $[a,b]$, where $a$ and $b$ are basic commutators of weight $<n$ such that


*

*$\text{weight}(a)+\text{weight}(b)=n$,

*$b<a$,

*if $a=[c,d]$ then $d\leq b$.


(Points 2 and 3 may seem strange at first, but one can see that any commutator not satisfying those two properties will not appear in the above collection process.) The ordering is defined arbitrarily subject to the requirement that all basic commutators of weight $<n$ precede all basic commutators of weight $n$, though the usual convention is $[a,b]<[c,d]$ if $b<d$ or if $b=d$ and $a<c$.
Here is the point of all this:

Theorem: Let $k$ be a positive integer, and let $(F)_k$ denote the $k$th entry of the lower central series of $F$. Let $a_1,\dots,a_r$ be the basic commutators of weight $<k$, in order. Then every $w\in F$ has a unique expression of the form
  $$w = a_{1}^{n_1}\cdots a_r^{n_r} w',$$
  where $n_1,\dots,n_r\in\mathbf{Z}$ and $w'\in(F)_k$.

There is one surprise here: I am no longer assuming that $w$ does not contain inverse letters. It turns out that collection is possible even when inverse letters are present.
The answer to my original question is now clear: To find how deep a word $w$ is in the lower central series, collect as described above until you find an expression
$$ w = a_{1}^{n_1}\cdots a_r^{n_r} w' $$
as in the theorem with at least one $n_i$ nonzero. Then $w$ is in $(F)_{k-1}$ but not $(F)_k$.
A: This calculation can be done with the  nilpotent quotient algorithm, which can be applied to any group defined by a finite presentation. See http://www.mathematik.tu-darmstadt.de/~nickel/software/. There is a GAP implementation, which I just tried with your example, and it worked fine.
