# Help with Integrals (and conditional expectations) of the Beta distribution: Integrate[e^(az) z^a (1-z)^b, {z, 0, 1}]

I have a Beta distribution, and am interested in calculating expectations and conditional expectations. The domain on the distribution is $z \in [0,1]$ Ignoring constants of proportionality, the expectation of an exponential function is:

$Assumptions = z >= 0 && z <= 1 && a > 0 && b > 0 && c > 0 && d > 0 && d < 1; Print["*******Different parameters, {a,b}"]; Integrate[Exp[c z] z^(a - 1) (1 - z)^(b - 1), {z, 0, 1}] Print["********Symmetric parameter, a"]; Integrate[Exp[c z] z^(a - 1) (1 - z)^(b - 1) /. {b -> a}, {z, 0, 1}]  The output from this is: Gamma[a] Gamma[b] Hypergeometric1F1Regularized[a, a + b, c] (-c)^(1/2 - a) E^(c/2) Sqrt[\[Pi]] BesselI[-(1/2) + a, -(c/2)] Gamma[a]  These are solid. The problem I am having is when calculating conditional expectations, which is effectively integration over a subset of the domain. Again ignoring constants of proportionality, Print["********Truncated Integral on [d, 1], symmetric for simplicity"]; Integrate[Exp[c z] z^(a - 1) (1 - z)^(b - 1) /. {b -> a}, {z, d, 1}]  This is unable to solve it. Any idea on this? Are there any tricks in mathematica, in math that I am missing? - {z, d, 1} are you sure it is appropriate ? – Rorschach Oct 8 '13 at 17:25 for some fixed$0 \leq d < 1\$, why wouldn't it be? –  jlperla Oct 8 '13 at 17:28
Integrate of a function is not from range of R to constant.It is from constant to constant or function to function. –  Rorschach Oct 8 '13 at 17:37
I am very confused. Isn't the following legitimate for example? Integrate[z, {z, d, 1}] --> 1/2 - d^2/2 –  jlperla Oct 8 '13 at 17:43
you shall try integration by parts, it shall help.d in assumption doesn't play any role and is considered a symbol if you place it in range part. –  Rorschach Oct 8 '13 at 17:53