Primitive of Root of a x + b over p x + q

Theorem

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

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

Proof
From Primitive of Power of $a x + b$ over Power of $p x + q$: Formulation 2:


 * $\ds \int \frac {\paren {a x + b}^m} {\paren {p x + q}^n} \rd x = \frac {-1} {\paren {n - m - 1} p} \paren {\frac {\paren {a x + b}^m} {\paren {p x + q}^{n - 1} } + m \paren {b p - a q} \int \frac {\paren {a x + b}^{m - 1} } {\paren {p x + q}^n} \rd x}$

Setting $m := \dfrac 1 2$ and $n = 1$:

From Primitive of Reciprocal of $p x + q$ by Root of $a x + b$:
 * $\ds \int \frac {\d x} {\paren {p x + q} \sqrt{a x + b} } = \begin{cases}

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

The result follows by substitution.