Integration of Gauss ${}_{2}F_{1}$ hypergeometric function The indefinite integral representation of Gauss hypergeometric function is
$$\int {{}_2{F_1}\left( {a,b;c;z} \right)dz = \frac{{c - 1}}{{\left( {a - 1} \right)\left( {b - 1} \right)}}} {}_2{F_1}\left( {a - 1,b - 1;c - 1;z} \right)$$
However I don't understand how to find the following definite integral:
$$\int\limits_{ - \infty }^\infty  {\left( {1 + \frac{{{z^2}}}{{{n_2}{{\cos }^2}\left( \theta  \right)}}} \right){}_2{F_1}\left( {a,b;\frac{1}{2};\frac{{{\gamma ^2}}}{{4{\alpha _1}{\alpha _2}}}} \right)dz}$$
where;
$$\gamma  = \frac{{2yz\sin \left( \theta  \right)}}{{\sqrt {{n_1}{n_2}} {{\cos }^2}\left( \theta  \right)}},\quad {\alpha _1} = 1 + \frac{{y^2}}{{{n_1}{{\cos }^2}\left( \theta  \right)}},\quad {\alpha _2} = 1 + \frac{{z^2}}{{{n_2}{{\cos }^2}\left( \theta  \right)}}$$
I would appreciate it if anyone had a solution to this problem. Thank you in advance.

Consider the integral in the form
$$ I = \int_{-\infty}^{\infty} (1 + p \, t^2) \, {}_{2}F_{1}\left(a, b; c; \frac{q^2 \, t^2}{4 \, \alpha \, (1 + p \, t^2)} \right) \, dt. $$
Converting the ${}_{2}F_{1}$ into its series form then
$$ I = \sum_{n=0}^{\infty} \frac{(a)_{n} \, (b)_{n}}{n! \, (c)_{n}} \, \left(\frac{q^2}{4 \, \alpha}\right)^n \, J_{n} $$
where $J_{n}$ is the integral
$$ J_{n} = \int_{-\infty}^{\infty} \frac{t^{2 n} \, dt}{(1 + p \, t^2)^{n-1}}. $$
Since
\begin{align}
\int_{-\infty}^{\infty} f(t^2) \, dt &= \int_{-\infty}^{0} f(t^2) \, dt + \int_{0}^{\infty} f(t^2) \, dt \\
&= 2 \, \int_{0}^{\infty} f(t^2) \, dt \hspace{5mm} \text{let} \, t = -u \, \text{in the first integral} \\
&= \int_{0}^{\infty} f(u) \, u^{-1/2} \, du \hspace{5mm} \text{where} \, t = \sqrt{u} \, \text{was used}.
\end{align}
With this then $J_{n}$ becomes
$$ J_{n} = \int_{0}^{\infty} u^{n-1/2} \, (1 + p \, u)^{1-n} \, du.$$
Comparing this to the hypergeometric function ${}_{2}F_{1}$ integral form, namely,
$$ \int_{0}^{\infty} t^{c-b-1} \, (1+t)^{c-a} \, (1-z+t)^{-a} \, dt = \frac{\Gamma(b) \, \Gamma(c-b)}{\Gamma(c)} \, {}_{2}F_{1}(a, b; c; z).$$
In the case $c = a$ this reduces to
\begin{align} 
\int_{0}^{\infty} t^{a-b-1} \, (1-z+t)^{-a} \, dt &= \frac{\Gamma(b) \, \Gamma(a-b)}{\Gamma(a)} \, {}_{2}F_{1}(a, b; a; z) \\
&= \frac{\Gamma(b) \, \Gamma(a-b)}{\Gamma(a)} \, (1-z)^{-a}.
\end{align}
Now,
\begin{align}
J_{n} &= \int_{0}^{\infty} u^{n-1/2} \, (1 + p \, u)^{1-n} \, du \\
&= p^{1-n} \, \int_{0}^{\infty} u^{n-1/2} \, \left(\frac{1}{p} + t\right)^{-(n-1)} \, du \\
&= p^{1-n} \, \frac{\Gamma\left(- \frac{3}{2}\right) \, \Gamma\left(n + \frac{1}{2}\right)}{\Gamma(n-1)} \, \left(\frac{1}{p}\right)^{3/2} \\
&= \frac{\Gamma\left(- \frac{3}{2}\right) \, \Gamma\left(\frac{1}{2}\right)}{\sqrt{p}} \, \frac{\left(\frac{1}{2}\right)_{n}}{(n-2)! \, p^{n}}.
\end{align}
Returning to $I$:
\begin{align}
I &= \sum_{n=0}^{\infty} \frac{(a)_{n} \, (b)_{n}}{n! \, (c)_{n}} \, \left(\frac{q^2}{4 \, \alpha}\right)^n \, J_{n} \\
&= \frac{\Gamma\left(- \frac{3}{2}\right) \, \Gamma\left(\frac{1}{2}\right)}{\sqrt{p}} \, \sum_{n=0}^{\infty} \frac{\left(\frac{1}{2}\right)_{n} \, (a)_{n} \, (b)_{n}}{(n-2)! \, (1)_{n} \, (c)_{n}} \, \left(\frac{q^2}{4 \, \alpha \, p}\right)^n \\
&= \frac{\Gamma\left(- \frac{3}{2}\right) \, \Gamma\left(\frac{1}{2}\right)}{\sqrt{p}} \, \sum_{n=2}^{\infty} \frac{\left(\frac{1}{2}\right)_{n} \, (a)_{n} \, (b)_{n}}{(n-2)! \, (1)_{n} \, (c)_{n}} \, \left(\frac{q^2}{4 \, \alpha \, p}\right)^n \\
&= \frac{\Gamma\left(- \frac{3}{2}\right) \, \Gamma\left(\frac{1}{2}\right)}{\sqrt{p}} \, \frac{\left(\frac{1}{2}\right)_{2} \, (a)_{2} \, (b)_{2}}{(1)_{2} \, (c)_{2}} \, \sum_{n=0}^{\infty} \frac{\left(\frac{5}{2}\right)_{n} \, (a+2)_{n} \, (b+2)_{n}}{n! \, (3)_{n} \, (c+2)_{n}} \, \left(\frac{q^2}{4 \, \alpha \, p}\right)^{n+2} \\
I &= \frac{\pi \, (a)_{2} \, (b)_{2}}{2 \, (c)_{2}} \, \left(\frac{q^2}{4 \, \alpha \, p} \right)^{2} \, {}_{3}F_{2}\left(\frac{5}{2}, a+2, b+2; 3, c+2; \frac{q^2}{4 \, \alpha \, p} \right).
\end{align}
Associating the constants will lead to the desired result.
For the case of $c = \frac{1}{2}$ the given result has a nice reduction as seen by
\begin{align}
I_{c = 1/2} &= \int_{-\infty}^{\infty} (1 + p \, t^2) \, {}_{2}F_{1}\left(a, b; \frac{1}{2}; \frac{q^2 \, t^2}{4 \, \alpha \, (1 + p \, t^2)} \right) \, dt \\
&= \frac{\pi \, (a)_{2} \, (b)_{2} \, q^4}{24 \, (\alpha \, p)^2} \, {}_{2}F_{1}\left(a+2, b+2; 3; \frac{q^2}{4 \, \alpha \, p} \right).
\end{align}
