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
add comment

2 Answers

up vote 2 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
add comment

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

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.