# How to remove ConditionalExpression from output

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]

-
Why not make up a rule (if you are sure of the Trueness 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 – gpap Nov 11 '13 at 10:14

You can use GenerateConditions->False to eliminate conditions (assuming they do not affect your planned use):

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;
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]

-

A more general way, which can be used for other functions like Solve, is to use Normal.

Integrate[1/x^s, {x, 1, Infinity}]

(* ConditionalExpression[1/(-1 + s), Re[s] > 1] *)

Normal[%, ConditionalExpression]

(* 1/(-1 + s) *)


## Edit

It looks like as of version 10, one can just use the one argument Normal:

Integrate[1/x^s, {x, 1, Infinity}]

(* ConditionalExpression[1/(-1 + s), Re[s] > 1] *)

Normal[%]

(* 1/(-1 + s) *)

-

It might be late to answer this, but I think it's important to add my approach.

I came to the same problem of having ConditionalExpressions in my outputs.

After googling I came about this solution, by using the Assuming[] function.

An example:

Assuming[Re[s] > 1, Integrate[1/x^s,{x,1,Infinity}]


Which gives:

1/(-1+s)

-
What are cases where Normal didn't work? – Chip Hurst Jul 1 '15 at 12:43
Normal[] worked after all too. – milia Jul 2 '15 at 13:51