# How can I calculate this integral?

I would like to calculate the integral in equation pol[x] if the quantity is positive or negative.

a = 2; l = 1; p = 0.5; r = 0.5;

f[x_, a_, l_] := (l^a*x^(a - 1)*Exp[-l*x])/Gamma[a];

F[x_] := Integrate[f[y, a, l], {y, -Infinity, x}];

psi[x_] := InverseFunction[F[x]];

tailF[y_, a_, l_] := Integrate[f[y, a, l], {y, x, Infinity}];

pol[u_] :=
Integrate[((1 - u)^r/(1 - p)^(r + 1) + (1 - u)/(1 - p)^2)*(1/
f[psi[u], a, l]), {u, p, 1}]


This is an extended comment.

Clear["Global*"]


Since you know that you are dealing with the GammaDistribution, you should make use of the built-in functions rather than doing multiple integrals.

dist = GammaDistribution[a, 1/l];


To be a valid distribution requires

\$Assumptions = DistributionParameterAssumptions[dist]

(* a > 0 && 1/l > 0 *)


f is the PDF

f[x_, a_, l_] = PDF[dist, x] // Simplify[#, x > 0] &

(* (E^(-l x) l^a x^(-1 + a))/Gamma[a] *)


F is the CDF

F[x_, a_, l_] = CDF[dist, x] // Simplify[#, x > 0] &

(* GammaRegularized[a, 0, l x] *)


psi is the InverseCDF

psi[q_, a_, l_] = InverseCDF[dist, q] // Simplify[#, 0 < q < 1] &

(* InverseGammaRegularized[a, 0, q]/l *)


Your t is the same as psi

Assuming[0 < q < 1, psi[q, a, l] == Quantile[dist, q] // Simplify]

(* True *)


tailF is the complement of the CDF

tailF[y_, a_, l_] = 1 - CDF[dist, y] // Simplify[#, y > 0] &

(* 1 - GammaRegularized[a, 0, l y] *)


{f[x, a, l], F[x, a, l], psi[q, a, l]} /.

It is not clear what you are trying to do with pol. u cannot be an argument to pol unless it is restricted to being a Symbol since u is used as the variable of integration. Also, it is unusual to see the PDF as a divisor. If you are trying to do an expectation, you would multiply by the PDF rather than divide. Further, if doing an expectation, you should use the built-in function Expectation`.