0
$\begingroup$

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.

$\endgroup$
4
  • 1
    $\begingroup$ 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. $\endgroup$
    – Artes
    Sep 10, 2013 at 10:38
  • $\begingroup$ 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. $\endgroup$
    – sky-light
    Sep 10, 2013 at 11:25
  • 1
    $\begingroup$ Have you read answers to the linked question? Namely you need $Assumptions = Re[L] > 0 and appropriately writing your integral. $\endgroup$
    – Artes
    Sep 10, 2013 at 11:50
  • $\begingroup$ 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 $\endgroup$
    – sky-light
    Sep 10, 2013 at 15:30

2 Answers 2

2
$\begingroup$

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]

$\endgroup$
3
$\begingroup$
cdf = Integrate[pdf, {x, 0, \[Gamma]}, GenerateConditions -> False]
$\endgroup$

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