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

Theorem
For $a > 0$ and for $x \ne 0$:
 * $\ds \int \frac {\d x} {x \sqrt {a x + b} } = \begin {cases}

\dfrac 1 {\sqrt b} \ln \size {\dfrac {\sqrt {a x + b} - \sqrt b} {\sqrt {a x + b} + \sqrt b} } + C & : b > 0 \\ \dfrac 2 {\sqrt {-b} } \arctan \sqrt {\dfrac {a x + b} {-b} } + C & : b < 0 \end {cases}$ where $a x + b > 0$.

Proof
Let:

Thus:

Then:

Let $b > 0$.

Let $d = \sqrt b$.

Then:

Let $b < 0$.

Let $d = \sqrt {-b}$.

Then: