# Integration result with incomplete beta function

I'm doing some calculations (double integration) which results in the incomplete beta function occurring as an end result. My input is:

Assuming[N1 > 1 && N2 > 1 && dt1 > 0 && dt2 > 0 && k > 1,
Integrate[
dt1*(dt1*l1)^N1*Exp[-l1*dt1]/Gamma[N1 + 1]*
Integrate[
dt2*(dt2*l2)^N2*Exp[-l2*dt2]/Gamma[N2 + 1], {l2, k*l1,
Infinity}], {l1, 0, Infinity}]]


which results in

((-1)^(1 - N1) Beta[-(dt1/(dt2 k)), 1 + N1, -1 - N1 - N2] Gamma[2 + N1 + N2])/
(Gamma[1 + N1] Gamma[1 + N2])


My concern is that I'm trying to persuade Mathematica to consider my inputs as positive constants (dt1, dt2, N1, N2, k), however the incomplete Beta function that is derived ends up having a negative z parameter (that is, -(dt1/(dt2 k))) and the b parameter (-1 - N1 - N2) is negative. Is there a way to get to a normalized representation (perhaps using Beta function identities) to have positive z, positive a, positive b?

• Why do you expect that all arguments of Beta should be positive, and why is it bad that they are not? The answer provided in the question above is well behaved as a function of {N1, N2, dt1/(dt2 k)}, – bbgodfrey Oct 5 '15 at 3:24
• Hi bbgodfrey, my primary concern is about z, which I expect to be between 0 and 1 as per the 'complete' beta function being integration between 0 and 1. – Ernest Oct 5 '15 at 20:54
• Beta[z, a, b] appears well behaved for all real arguments except z -> 1. Please see my answer below, which shows in a specific case that your symbolic solution agrees with the corresponding numerical integral. – bbgodfrey Oct 5 '15 at 22:29

Is it what you are looking for:

    int = Assuming[N1 > 1 && N2 > 1 && dt1 > 0 && dt2 > 0 && k > 1,
Integrate[
dt1*(dt1*l1)^N1*Exp[-l1*dt1]/Gamma[N1 + 1]*
Integrate[
dt2*(dt2*l2)^N2*Exp[-l2*dt2]/Gamma[N2 + 1], {l2, k*l1,
Infinity}], {l1, 0, Infinity}]]

(*  ((-1)^(1 - N1)
Beta[-(dt1/(dt2 k)), 1 + N1, -1 - N1 - N2] Gamma[2 + N1 + N2])/(
Gamma[1 + N1] Gamma[1 + N2])  *)


Then

 int2 = int /. {dt1/(dt2 k) -> z, -1 - N1 - N2 -> b}

(*   ((-1)^(1 - N1) Beta[-z, 1 + N1, b] Gamma[2 + N1 + N2])/(
Gamma[1 + N1] Gamma[1 + N2])   *)


and

    FullSimplify[int2, {z > 0, b < 0}]

(*  (z^(1 + N1)
Gamma[2 + N1 + N2] Hypergeometric2F1Regularized[1 - b, 1 + N1,
2 + N1, -z])/Gamma[1 + N2]  *)


?? Have fun!

As I commented above, there is nothing wrong with the result obtained in the Question. To make this point more clearly, consider a specific case,

ans /. {N1 -> 2, N2 -> 2, dt1/(dt2 k) -> x}
(* -30 Beta[-x, 3, -5] *)


Now, compare this function with the integral in the Question, performed numerically.

lst = Table[With[{N1 = 2, N2 = 2, dt2 = 1, k = 1},
NIntegrate[dt1*(dt1*l1)^N1*Exp[-l1*dt1]/Gamma[N1 + 1]*dt2*(dt2*l2)^N2*
Exp[-l2*dt2]/Gamma[N2 + 1], {l1, 0, Infinity}, {l2, k*l1, Infinity}]], {dt1, 0, 5, .5}]
(* {0., 0.209876, 0.5, 0.68256, 0.790123, 0.855298, 0.896484, 0.923589,
0.94208, 0.955095, 0.964506} *)

Show[
Plot[ans /. {N1 -> 2, N2 -> 2, dt1/(dt2 k) -> x}, {x, 0, 5}, AxesLabel -> {"x", "ans"}],
ListPlot[lst, DataRange -> {0, 5}, PlotStyle -> Red]]


The symbolic integration obtained in the question agrees well with the numerical integration for negative first argument. In fact, it appears that Beta[z, a, b] is well behaved for all real arguments except z -> 1.