Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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]
share|improve this question
    
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

3 Answers 3

up vote 4 down vote accepted

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]
share|improve this answer

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) *)
share|improve this answer

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. Normal[] didn't work much for me.

An example:

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

Which gives:

1/(-1+s) 
share|improve this answer
    
What are cases where Normal didn't work? –  Chip Hurst 12 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.