# Integrating a function forcing parameters to be real and positive

I'd like to integrate the function $f(x)=x^{a-1}e^{-b x}$ over the interval $[0,\infty)$.

f[x_] := x^(a - 1)*Exp[-b*x]


Then:

Integrate[f[x], {x, 0, \[Infinity]}]


But I get:

ConditionalExpression[b^-a Gamma[a], Re[b] > 0 && Re[a] > 0]


How can I force both a and b to be real, positive parameters, then try the integration again?

-
Assuming[Re[b] > 0 && Re[a] > 0, Integrate[f[x], {x, 0, Infinity}]] Just copied what Integrate gave back into the Assuming part. – Nasser Jun 22 '14 at 5:31
@Nasser looks like an answer... – Yves Klett Jun 22 '14 at 5:48
It looks like a question asked instead of looking into documentation, does not it? – Alexei Boulbitch Jun 23 '14 at 9:35

In addition to @Nasser´s solution you can also use the Assumptions option:

Integrate[f[x], {x, 0, ∞}, Assumptions -> {Element[{a, b}, Reals], a > 0, b > 0}]

b^-a Gamma[a]


As pointed out by @m_goldberg, the assumption of a > 0 and b > 0 is sufficient, because this already implies real values.

-
Nice answers. Thanks. – David Jun 22 '14 at 6:10
Actually, Integrate[f[x], {x, 0, ∞}, Assumptions -> {a > 0, b > 0}] is sufficient, since {a > 0, b > 0} implies a and b are real. – m_goldberg Jun 22 '14 at 8:44
Another very nice answer. – David Jun 22 '14 at 16:26