Find all the varieties of abelian groups (in the sense of universal algebra) This is Exercise 2.3.6 of Robinson's "A Course in the Theory of Groups (Second Edition)". According to Approach0, it is new to MSE.
(Note: Here "abelian variety" is not, at least a priori, in the sense given in this Wikipedia article. See below for details.)
The Details:
These are essentially the same as in the previous exercise of Robinson's book.
Since definitions vary, on page 15, ibid., paraphrased, it states that

A subgroup $N$ of $G$ is normal in $G$ if one of the following equivalent statements is satisfied:
(i) $xN=Nx$ for all $x\in G$.
(ii) $x^{-1}Nx=N$ for all $x\in G$.
(iii) $x^{-1}nx\in N$ for all $x\in G, n\in N$.

On page 56, ibid.,

Let $F$ be a free group on a countably infinite set $\{x_1,x_2,\dots\}$ and let $W$ be a nonempty subset of $F$. If $w=x_{i_1}^{l_1}\dots x_{i_r}^{l_r}\in W$ and $g_1,\dots, g_r$ are elements of a group $G$, we define the value of the word $w$ at $(g_1,\dots,g_r)$ to be $w(g_1,\dots,g_r)=g_1^{l_1}\dots g_{r}^{l_r}$. The subgroup of $G$ generated by all values in $G$ of words in $W$ is called the verbal subgroup of $G$ determined by $W$,
$$W(G)=\langle w(g_1,g_2,\dots) \mid g_i\in G, w\in W\rangle.$$

On page 57, ibid.,

If $W$ is a set of words in $x_1, x_2, \dots$ and $G$ is any group, a normal subgroup $N$ is said to be $W$-marginal in $G$ if
$$w(g_1,\dots, g_{i-1}, g_ia, g_{i+1},\dots, g_r)=w(g_1,\dots, g_{i-1}, g_i, g_{i+1},\dots, g_r)$$
for all $g_i\in G, a\in N$ and all $w(x_1,x_2,\dots,x_r)$ in $W$. This is equivalent to the requirement: $g_i\equiv h_i \mod N, (1\le i\le r)$, always implies that $w(g_1,\dots, g_r)=w(h_1,\dots, h_r)$.
[The] $W$-marginal subgroups of $G$ generate a normal subgroup which is also $W$-marginal. This is called the $W$-marginal of $G$ and is written $$W^*(G).$$

On page 58, ibid.,

If $W$ is a set of words in $x_1, x_2, \dots $, the class of all groups $G$ such that $W(G)=1$, or equivalently $W^*(G)=G$, is called the variety $\mathfrak{B}(W)$ determined by $W$.

The Question:

A variety is said to be abelian if all its members are abelian. Find all the abelian varieties.

Thoughts:
It occurred to me to consider two extremes first: where the variety $\mathfrak{W}$ is just the class containing only (the isomorphic copies of) the trivial group and where the variety $\mathfrak{W}$ is the class of all abelian groups. I guess I could get at least one of these extremes by considering
$$\mathfrak{W}=\mathfrak{B}(\{\varepsilon\}),\tag{1}$$
where $\varepsilon$ is the empty word; but something tells me that $(1)$ includes any & all groups, not just abelian ones; I don't know - I'm not particularly confident in calculating it.
Another thought I have is whether an abelian variety might correspond to
$$\mathfrak{W}=\mathfrak{B}(\{ [x_1, x_2]\}),\tag{2}$$
where $[x_1,x_2]=x_1^{-1}x_2^{-1}x_1x_2$ is the commutator of the abstract symbols $x_1,x_2$. Again, I don't know.
Please help :)
 A: A group is abelian if and only if satisfies the identity $[x_1,x_2]$; that is, if the verbal subgroup determined by $[x_1,x_2]$ (the commutator subgroup) is trivial. So if a set of words $W$ determines a variety all of whose elements are abelian groups, then the set $W'=W\cup\{[x_1,x_2]\}$ determines the same variety: all groups $G$ for which $W(G)=1$ also satisfy $W'(G)=1$, and conversely. Thus, every variety of abelian groups is determined by a set of words $W$ such that $[x_1,x_2]\in W$.
However, the verbal subgroup determined by any word $w$ is equivalent to the verbal subgroup determined by a pair of words, one of which is a commutator word (an element of $[F_{\omega},F_{\omega}]$, where $F_{\omega}$ is the free group on countably many variables), and the other is a power word (a word of the form $x^a$ for some $a\geq 0$). A sketch of this fact can be found in this answer. Thus, we can replace every element of $W$ with a commutator word and a power word. Note that this process does not replace $[x_1,x_2]$ (well, technically it does, but it replaces it with $x^0$ and $[x_1,x_2]$, which is equivalent to $[x_1,x_2]$, since $x^0$ evaluates to $e$ in any group, so it does not contribute to the verbal subgroup).
Since the value of a commutator word in a group $G$ is necessarily contained in $[G,G]$, if $W$ is a set of group words that includes $[x_1,x_2]$, then we can replace $W$ with a new set, $W'$, which consists of $[x_1,x_2]$ and power words; and then $W(G)=W'(G)$ for every group $G$.
Moreover, in any group, the subgroup generated by all $n$th powers and all $m$th powers is equal to the subgroup generated by all $\gcd(n,m)$th powers: clearly the latter contains the former, since very $n$th power is also a $\gcd(n,m)$th power; and if $\gcd(m,n) = \alpha n + \beta m$ with $\alpha,\beta$ integers, then $x^{\gcd(m,n)} = x^{\alpha n + \beta m} = (x^n)^{\alpha}(x^m)^{\beta}$, so $x^{\gcd(m,n)}$ lies in the subgroup generated by all $n$th and $m$th powers.
Thus, if $W$ is a set of words that consists of $[x_1,x_2]$ and a collection of power words, then we can replace $W$ with a set $W'$ that contains only $[x_1,x_2]$ and a single power word $x^a$ for some $a\geq 0$; and then for any group $G$, we have $W(G)=W'(G)$.
Thus, any set of words $W$ that determines a variety of abelian groups is equivalent to a set $W'$ of the form $W'=\{[x_1,x_2],x^n\}$ for some $n\geq 0$; in the sense that for every group $G$, $W(G)=W'(G)$.
Since a variety of groups corresponds to a set of words $W$, and is determined as "all groups for which $W(G)$ is trivial", we conclude that a variety of abelian groups corresponds to a nonnegative integer $n\geq 0$, and is determined as "all abelian groups $G$ for which $g^n = e$ for all $g\in G$." That is, the abelian groups of exponent $n$. Denote this variety by $\mathcal{Ab}_n$. Note that the variety of all abelian groups is $\mathcal{Ab}_0$.
So the varieties of abelian groups are precisely the varieties $\mathcal{Ab}_n$, for some fixed $n\geq 0$.
A: The following argument is basically the same as Arturo's above, but somewhat streamlined in presentation.
Suppose I have some word $$p=x_1^{z_1}x_2^{z_2}...x_n^{z_n}$$ with $z_i\in\mathbb{Z}$; I claim that there is some $k$ such that the abelian groups in which $p$ evaluates to $1$ on all inputs are exactly those groups where every element has order dividing $k$.
First, since we're only looking at abelian groups we can assume WLOG that $x_i\not=x_j$ whenever $1\le i<j\le n$. Let $k=gcd\{\vert z_1\vert ,...,\vert z_n\vert\}$. Clearly if $G$ is an abelian group where every element has order dividing $k$ we get $p(g_1,...,g_n)=1_G$ for all $g_1,...,g_n\in G$. In the opposite direction, let $g\in G$; I claim that $g^{\vert z_i\vert}=1_G$ for each $1\le i\le n$.
To see this, fix such an $i$ and consider the variable assignment $\nu$ defined by $$x_u=\begin{cases}
g & \mbox{if $u=i$,}\\
1_G & \mbox{otherwise.}
\end{cases}$$ If $p$ always evaluates to $1_G$ in $G$, we must have $p[\nu]=1_G$. But $p[\nu]=g$.

Strictly speaking we're not done; the above classifies the varieties determined by a single word. But each variety is an intersection of such single-word varieties, and any intersection of "$\mathcal{Ab}_m$-classes" is again an "$\mathcal{Ab}_m$-class," using Arturo's notation here. (Note that this latter fact is just a rephrasing of the Noetherianness of $\mathbb{Z}$!)
