I need define the function with parameter so I could directly generate a power series expansion. The problem is that in some cases ConditionalExpression appears in output. Here is my code:
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}])*
x^(l - 1)*E^(-2 Sum[x^i/i, {i, 1, l - 1}])/(1 - x)^2;
Table[S[x, i], {i, 2, 3}] // TableForm
CoefficientList[Series[S[x, 2] , {x, 0, 3}], x]
CoefficientList[Series[S[x, 3] , {x, 0, 3}], x]
CoefficientList[Series[S[x, 3][[1]] , {x, 0, 3}], x]
True
ness of your conditional)rule = ConditionalExpression[a_, b__] -> a
and apply it to the output? i.e.CoefficientList[Series[S[x, 3], {x, 0, 3}], x] /. rule
$\endgroup$