Primitive of Reciprocal of p by Exponential of a x plus q by Exponential of -a x

Theorem

 * $\ds \int \frac {\d x} {p e^{a x} + q e^{-a x} } = \begin{cases}

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

Proof
Let $\dfrac q p > 0$.

Then:

Let $\dfrac q p < 0$.

Then let $d^2 = -\dfrac q p$ and so: