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

Theorem

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

\displaystyle \frac 1 {a \sqrt {p q} } \arctan \left({\sqrt {\frac p q} e^{a x} }\right) & : \sqrt {p q} > 0 \\ \displaystyle \frac 1 {2 a \sqrt {-p q} } \ln \left\vert{\frac {e^{a x} - \sqrt {-\frac q p} } {e^{a x} + \sqrt {-\frac q p} } }\right\vert & : \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: