Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Sometimes I have very long and complicated equations, when I evaulate the equations for example taking derivative or integral there will be several conditions with the answer. My question is that; is there any way that I enter the conditions at the begining of the program so that so that it will not appear in the evaluation result?

I will give a simple example:

pdf = x^(L-1)/( γ^L Gamma[L]) Exp[(-x)/γ];
Re[L] > 0;

Integrate[ pdf, {x, 0, γ}]
ConditionalExpression[ (Gamma[L]-Gamma[L,1])/(Gamma[L]),  Re[L] > 0 ]

in the above example even if I write the condition which is Re[L] > 0, it will appear again at the result of evaluation.

share|improve this question

marked as duplicate by Artes, m_goldberg, István Zachar, Sjoerd C. de Vries, Mr.Wizard Sep 11 '13 at 0:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Most likely you are looking for ways of imposing assumptions. This question is closely related: How to specify assumptions before evaluation? or simply a duplicate. – Artes Sep 10 '13 at 10:38
thanks for the answers. my question is is specifically that; is there anyway to write conditions at the begining of the program so that you don't need every time repeat them with your equations. – sky-light Sep 10 '13 at 11:25
Have you read answers to the linked question? Namely you need $Assumptions = Re[L] > 0 and appropriately writing your integral. – Artes Sep 10 '13 at 11:50
Hi Artes, that was the answer of my question. $Assumptions = Re[L] > 0 you can write all your conditions at the begining of the program like this: $Assumptions = Re[b] > 0 && Re[Sqrt[b]] > 0; by putting && between your conditions. Thanks – sky-light Sep 10 '13 at 15:30
up vote 2 down vote accepted

Yes, you can use Assuming, eg. for your particular example:

Assuming[{Re[L] > 0}, 
 Integrate[x^(L - 1)/(\[Gamma]^L Gamma[L]) Exp[(-x)/\[Gamma]], {x, 0, \[Gamma]}]]

This gives:

1 - Gamma[L, 1]/Gamma[L]

share|improve this answer
cdf = Integrate[pdf, {x, 0, \[Gamma]}, GenerateConditions -> False]
share|improve this answer

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