TITLE: $\int^{\infty}_{0}x^{r +s- 1}(1 + x)^{-s}(1 + x^2)^{-\frac{rm}{2}}dx$
QUESTION [11 upvotes]: I'm trying to solve the integral 
$\int^{\infty}_{0}x^{r +s- 1}(1 + x)^{-s}(1 + x^2)^{-\frac{rm}{2}}dx$, 
where $s$, $r$ and $m$>1 are positive integers.
My question is whether a closed form solution for this integral exists. By closed form here I mean an expression in terms of a finite number of special functions. There is some hope for a closed form solution I think given the output below from symbolic software, but I have been unable to find a formula yet.
To give a bit of context the integral is the $s$-th moment of the real random variable $x/(1+x)$, $x>0$, when the probability density function of $x$ is, up to a constant that I have omitted for simplicity, is $x^{r - 1}(1 + x^2)^{-\frac{rm}{2}}$. All these moments exist. I am trying to understand whether they are expressible in terms of a finite number of special functions.
I was not able to get help from Mathematica or Maple. Both Mathematica and Maple give me a solution containing a $\Gamma$ function evaluated at negative integers. More precisely, if I input in Mathematica:
Integrate[
 x^(r + s - 1) (1 + x)^-s (1 + x^2)^(-r m/2), {x, 0, \[Infinity]}, 
 Assumptions -> {r \[Element] Integers, s \[Element] Integers, 
   m \[Element] Integers, r > 0, s > 0, m > 1}]
I obtain:
(1/Gamma[s])
 Gamma[(-1 + m) r] Gamma[
   r - m r + s] HypergeometricPFQ[{(m r)/2, -(r/2) + (m r)/2, 
    1/2 - r/2 + (m r)/2}, {1/2 - r/2 + (m r)/2 - s/2, 
    1 - r/2 + (m r)/2 - s/2}, -1] + (1/(
 2 Gamma[(m r)/
   2]))(-s Gamma[1/2 (-1 + (-1 + m) r - s)] Gamma[
     1/2 (1 + r + s)] HypergeometricPFQ[{1/2 + s/2, 1 + s/2, 
      1/2 + r/2 + s/2}, {3/2, 3/2 + r/2 - (m r)/2 + s/2}, -1] + 
   Gamma[1/2 ((-1 + m) r - s)] Gamma[(r + s)/
     2] HypergeometricPFQ[{1/2 + s/2, r/2 + s/2, s/2}, {1/2, 
      1 + r/2 - (m r)/2 + s/2}, -1])
which is:
$\frac{\Gamma(r(m-1))\Gamma(s-r(m-1))}{\Gamma(s)}{}_3 F_2\left(  \frac
{mr}{2},\frac{r(m-1)}{2},\frac{1+r(m-1)}{2};\frac{1-s+r(m-1)}{2},1+\frac
{s-r(m+1)}{2};-1\right)$
$ -\frac{s\Gamma\left(\frac{r(m-1)-1-s}{2}\right)\Gamma\left(  \frac{1+r+s}{2}\right)  }
{2\Gamma(\frac{mr}{2})}{}_3 F_2\left(  \frac{1+s}{2},1+\frac{s}{2}
,\frac{1+r+s}{2};\frac{3}{2},\frac{3+s-r(m-1)}{2};-1\right)$
$   +\Gamma\left(  \frac{r(m-1)-s}{2}\right)  \Gamma\left(  \frac{r+s}
{2}\right){}_3 F_2\left(  \frac{1+s}{2},\frac{r+s}{2},\frac{s}{2}
;\frac{1}{2},1+\frac{s-r(m-1)}{2};-1\right)$
(same solution for Maple) As you can see, there is a $\Gamma$ function evaluated at $s-r(m-1)$ which can be a negative integer, so it seems to me that Mathematica and Maple are giving a solution that holds for most real values of $(r,m,s)$ but not necessarily for the values I'm interested in ($r,m,s$ are positive integers in my problem)
I'm not too sure my question is suitable here, but I did not have any luck at math.stackexchange (https://math.stackexchange.com/questions/234989/int-infty-0xr-s-11-x-s1-x2-fracrm2dx) so I thought I'd try and see if I can get some help here.

REPLY [3 votes]: Let $I(a,b,m) = \displaystyle \int_0^{\infty} \dfrac{x^{a+b-1} dx}{(1+x)^{b}(1+x^2)^{am/2}}$.
Setting $x = \tan(\theta)$. We then get that
$$I(a,b,m) = \int_0^{\pi/2} \dfrac{\tan^{a+b-1}(\theta) \sec^2(\theta) d \theta}{(1+\tan(\theta))^b \left(1+\tan^2(\theta) \right)^{am/2}}$$
$$I(a,b,m) = \int_0^{\pi/2} \dfrac{\tan^{a+b-1}(\theta) \sec^2(\theta) d \theta}{(1+\tan(\theta))^b \sec^{am}(\theta)}$$
$$I(a,b,m) = \int_0^{\pi/2} \dfrac{\tan^{a+b-1}(\theta) \cos^{am-2}(\theta) d \theta}{(1+\tan(\theta))^b}$$
Let us use the following short hand notation. $c = \cos(\theta)$ and $s = \sin(\theta)$. We then get that
$$I(a,b,m) = \int_0^{\pi/2} \dfrac{s^{a+b-1} c^{am-a-1} d \theta}{(s+c)^b}$$
Hence, we are interested in evaluating integral of the form
$$J(p,q,r) = \int_0^{\pi/2} \dfrac{s^p c^q d \theta}{(s+c)^r}$$
First some observations:
$$J(p,q,r) = J(q,p,r) \,\,\,\,\,\,\,\,\,\,\,\,\,\,\, (\star)$$
$$J(p,q,0) = \dfrac{\beta((p+1)/2,(q+1)/2)}2$$
$$J(p,q,-1) = \int_0^{\pi/2} s^p c^q (s+c) d \theta = J(p+1,q,0) + J(p,q+1,0)$$
Further
$$J(p,q,r+2) = \int_0^{\pi/2} \dfrac{s^p c^q d \theta}{(s+c)^r (1+2sc)}$$
$$J(p,q,r+2) = \sum_{k=0}^{\infty} \int_0^{\pi/2} \dfrac{s^p c^q (-2sc)^k d \theta}{(s+c)^r}$$
$$J(p,q,r+2) = \sum_{k=0}^{\infty}(-2)^k J(p+k,q+k,r)$$
Hence, you can use this to compute $J(p,q,r)$ for all $r$ since these can be obtained as we know the values for $J(p,q,0)$ and $J(p,q,-1)$. (For even $r$, $J(p,q,r)$ will eventually depend on $J(p,q,0)$ and for odd $r$, $J(p,q,r)$ will eventually depend on $J(p,q,-1)$)

Few other relations, which might be of use.
We have $$\lim_{p \to \infty} J(p,q,r) = \lim_{q \to \infty} J(p,q,r) = \lim_{r \to \infty} J(p,q,r) = 0$$
Note that
$$J(p+2,q,r) = \int_0^{\pi/2} \dfrac{s^p c^q (1-c^2) d \theta}{(s+c)^r}$$
Hence, we get that
$$J(p+2,q,r) + J(p,q+2,r) = J(p,q,r)$$
Setting $p=q$, and making use of $(\star)$, we get that
$$J(p+2,p,r) = \dfrac{J(p,p,r)}2$$
Note that $$J(0,0,r) = \int_0^{\pi/2} \dfrac{d \theta}{(s+c)^r} = \int_0^{\pi/2} \dfrac1{2^{r/2}} \dfrac{d \theta}{\sin^r(\theta + \pi/4)}$$