<s>[INST] Antiderivative of a product of a rational function and a square root. Let $0<x<1$ and $p$ be a non-negative integer.
Consider a following definite integral:
\begin{equation}
{\mathbb I}_p(x):=\int\limits_1^x \frac{(1-v^2)^p}{v^{2p+2}} \cdot \sqrt{\frac{1-v}{1+v}} dv
\end{equation}
We have computed it in a following way. Firstly we substituted for the square root and reduced the problem to integrating a rational function. Then we decomposed the resulting rational function into simple fractions and by integrating terms by term we completed the computation. The result reads:
\begin{equation}
{\mathbb I}_p(x) = (-1)^p 2 \binom{p-\frac{1}{2}}{-\frac{1}{2}} \text{arctanh}(\sqrt{\frac{1-x}{1+x}})+\frac{\sqrt{1-x^2}}{x^{2 p+1}} \cdot\sum\limits_{l=0}^{2 p} {\mathcal C}_{l,p} x^l
\end{equation}
where the coefficients read:
\begin{eqnarray}
&&{\mathcal C}_{l,p} := \sum _{q=0}^{\left\lfloor \frac{l}{2}\right\rfloor } 
\frac{\sqrt{\pi } 2^{-l+2 q+1} (-l+2 p+q)! \binom{4 p+2}{l-2 q} \binom{-l+2 p+2 q+1}{2 q+1} }
{\left(-q-\frac{3}{2}\right)! (-l+2 p+2 q+1) (-l+2 p+2 q+1)!}
\, _3F_2\left(-p-1,l-4 p-2 q-2,2 q-l;-2 p-1,-2 p-\frac{1}{2};1\right)\\
&&=
\left(
\begin{array}{c}
 \{-1\} \\
 \left\{-\frac{1}{3},\frac{1}{2},\frac{1}{3}\right\} \\
 \left\{-\frac{1}{5},\frac{1}{4},\frac{2}{5},-\frac{5}{8},-\frac{1}{5}\right\} \\
 \left\{-\frac{1}{7},\frac{1}{6},\frac{3}{7},-\frac{13}{24},-\frac{3}{7},\frac{11}{16},\frac{1}{7}\right\} \\
 \left\{-\frac{1}{9},\frac{1}{8},\frac{4}{9},-\frac{25}{48},-\frac{2}{3},\frac{163}{192},\frac{4}{9},-\frac{93}{128},-\frac{1}{9}\right\} \\
 \left\{-\frac{1}{11},\frac{1}{10},\frac{5}{11},-\frac{41}{80},-\frac{10}{11},\frac{171}{160},\frac{10}{11},-\frac{149}{128},-\frac{5}{11},\frac{193}{256},\frac{1}{11}\right\} \\
\end{array}
\right)
\end{eqnarray}
Above we have given numerical values of those coefficients for $p=0,\dots,5$ (rows) and $l=0,\dots,2 p$ (columns). Now the question is can we come up with some closed form solution for the coefficients. Note that even at the first glance we see that in case $l=0$ and $l=p$ there is a closed form. What about other values of $l$?
 [/INST] $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

With
  $\ds{t \equiv {1 - v \over 1 + v} \implies
v = {1 - t \over 1 + t}}$:

\begin{align}
{\mathbb I}_{p}\pars{x} & = \int_{1}^{x}{\pars{1 -v^{2}}^p \over v^{2p + 2}} \,\root{1 - v \over 1 + v}\,\dd v =
\stackrel{t^{2}\ \mapsto\ t}{=}\,\,\,
-\,2^{\,2p + 1}\int_{0}^{\pars{1 - x}/\pars{1 + x}}
t^{p + 1/2}\pars{1 - t}^{-2p - 2}\,\dd t
\\[5mm] & =
\bbx{\ds{-2^{2p + 1}\,
\mrm{B}\pars{{1 - x \over 1 + x},p + {3 \over 2},-2p - 1}}}
\end{align}
where $\ds{\,\mrm{B}}$ is the Incomplete Beta Function. Note that
$\ds{\Re\pars{p + {1 \over 2}} > - 1 \implies \Re\pars{p} > -\,{3 \over 2}}$.
</s>