# Generating a power series expansion of the function with parameter

I'm trying to generate a power series expansion of the following function:

 S[x_, l_] :=
(C[1] + Integrate[E^(2 Sum[t^i/i, {i, 1, l - 1}]) (1 - t)^2
Sum[(l - i*2) t^i, {i, 1, l - 1}]/((t - 1) t^l), {t, 1, x},
GenerateConditions -> False])*x^(l - 1)*E^(-2 Sum[x^i/i, {i, 1, l - 1}])/(1 - x)^2;


For l=2 and l=3 it works perfectly, but not in case of l=4:

Table[CoefficientList[Series[S[x, i], {x, 0, 4}], x], {i, 2, 4}]


Is it possible to solve this problem?

-

The first error says it all. Your S[x,l] does not converge in $x=0$ for $l \ge 3$. Note that evaluating the function in $x=0$ is the first step in computing its series about this point.
If you remove the GenerateConditions -> False option, you will notice that the integration produces some result invalid for $x=0$. By forcing Mathematica to forget this restriction, you can manually insert $x=0$ in the formula but the result can be anything unexpected then. This workaround seems to fix the problem temporarily at $l=3$ but fails at $l=4$.