Primitive of Reciprocal of Root of a x + b by Root of p x + q

Theorem
Let $a, b, p, q \in \R$ such that $a p \ne b q$.

Then:


 * $\ds \int \frac {\d x} {\sqrt {\paren {a x + b} \paren {p x + q} } } = \begin {cases}

\dfrac 2 {\sqrt {-a p} } \map \arctan {\sqrt {\dfrac {-p \paren {a x + b} } {a \paren {p x + q} } } } + C & : a p < 0 \\ \dfrac {-1} {\sqrt {-a p} } \map \arcsin {\dfrac {2 a p x + b p + a q} {a q - b p} } + C & : a > 0, p < 0 \\ \ds \dfrac 2 {\sqrt {a p} } \ln \size {\sqrt {p \paren {a x + b} } + \sqrt {a \paren {p x + q} } } + C & : a p > 0 \\ \end {cases}$

for all $x \in \R$ such that $\paren {a x + b} \paren {p x + q} > 0$.