Representation of nullhomologous loop on compact surface as a product of commutators. Why this sentence is true?:
Assume that $M$ is compact surface and $f: S^1 \to M$ is nullhomologous and without selfintersections. Letting $g$ be the genus and $b$ the number of boundary components of $M$, it follows that there is a generating set $S=\{\alpha_1, \beta_1, ..., \alpha_g, \beta_g, x_1, ..., x_b\}$ such that:
$$ \pi_1(M, *) = \langle a_1, b_1, \ldots , a_g, b_g, x_1, \ldots , x_b \mid [a_1, b_1]\cdots [a_g, b_g]= x_1\cdots x_b \rangle . $$ 
and such that:
$f$ is homotopic to $[\alpha_1, \beta_1] \cdots [\alpha_{g'}, \beta_{g'}]$ for some $g'<g$.
I know Hurewicz teorem, so I know that $f$ belongs to comutant of fundamental group, but why representation of $f$ is such as above? In particular why in this representation doesn't $x_i$ appear?
Could anybody help me or show me the book,where I can read about it in a algebraic topology way (I'm not familiar with differential topology)?
[Edit]: I forgot to write, that $f$ is without selfintersections 
 A: Updated after OP's edit:
Here's the idea: A simple closed curve $\gamma$ in an orientable genus $g$ surface $M$ is nullhomologous if and only if $M \setminus \gamma$ consists of two connected components, one of which is a surface $N$ with $\partial N = \gamma$. Since $\gamma$ is the one and only boundary component of $N$, all of the boundary components corresponding to $x_1,\ldots,x_b$ lie in the second connected component (which has a total of $b+1$ boundary components, when you include its copy of $\gamma$). Since $N$ is an orientable surface of genus $g'\leq g$, we can choose standard generators $\alpha_1,\beta_1,\ldots,\alpha_{g'},\beta_{g'}$ of $\pi_1(N)$ such that $\gamma$, the boundary of $N$, has homotopy class $[\alpha_1,\beta_1]\cdots[\alpha_{g'},\beta_{g'}]$. Then $\alpha_i,\beta_i$ are also generators in $\pi_1(M)$. The other generators $\alpha_{g'+1},\beta_{g'+1},\ldots,\alpha_g,\beta_g,x_1,\ldots,x_b$ come from the second connected component.
Remark. Note that we must allow $g'\leq g$, not "$g'<g$". Suppose $M$ has $b$ punctures and $\gamma$ is a small loop around these punctures. On one side, $\gamma$ bounds a disk with $b$ punctures. On the other side, $\gamma$ bounds a genus $g$ surface with a disk removed. Thus $\gamma$ is nullhomologous, but in terms of the standard generators its homotopy class is $[\alpha_1,\beta_1]\cdots[\alpha_g,\beta_g]$.
A: What you are trying to prove is false: The least number of products of commutators needed to represent the given element x of the derived subgroup is called the "commutator length" of x. The theorem is that in any torsion free noncyclic hyperbolic group (like surface group of genus at least 2) there are elements of arbitrary high (finite) commutator length. In fact, take any nontrivial element y of the derived subgroup, then the commutator length of $y^n$ will diverge linearly to infinity. You can find a proof and much more in the book by D.Calegari "scl" (which is an acronym for "stable commutator length").
