Theorem: Primitive of Reciprocal of p squared plus Square of q by Hyperbolic Sine of a x

:$\ds \int \frac {\d x} {p^2 + q^2 \sinh^2 a x} = \begin {cases}
\dfrac 1 {a p \sqrt{q^2 - p^2} } \arctan \dfrac {\sqrt {q^2 - p^2} \tanh a x} p + C & : p^2 < q^2 \\
\dfrac 1 {2 a p \sqrt{p^2 - q^2} } \ln \size {\dfrac {p + \sqrt {p^2 - q^2} \tanh a x} {p - \sqrt {p^2 - q^2} \tanh a x} } + C & : p^2 > q^2 \\
\end {cases}$

Proof:
{{begin-eqn}}
{{eqn | l = \int \frac {\d x} {p^2 + q^2 \sinh^2 a x}
      | r = \int \frac {\sech^2 a x \rd x} {p^2 \sech^2 a x + q^2 \tanh^2 a x}
      | c = multiplying numerator and denominator by $\sech^2 a x$
}}
{{eqn | r = \int \frac {\sech^2 a x \rd x} {p^2 \paren {1 - \tanh^2 a x} + q^2 \tanh^2 a x}
      | c = Sum of Squares of Hyperbolic Secant and Tangent
}}
{{eqn | r = \int \frac {\sech^2 a x \rd x} {p^2 + \paren {q^2 - p^2} \tanh^2 a x}
      | c = 
}}
{{end-eqn}}
Then:
{{begin-eqn}}
{{eqn | l = u
      | r = \tanh a x
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \d u
      | r = a \sech^2 a x \rd x
      | c = Derivative of Hyperbolic Tangent Function
}}
{{eqn | ll= \leadsto
      | l = \int \frac {\sech^2 a x \rd x} {p^2 + \paren {q^2 - p^2} \tanh^2 a x}
      | r = \int \frac {\d u} {a p^2 + a \paren {q^2 - p^2} u^2}
      | c = Integration by Substitution: $u = \tanh a x$
}}
{{eqn | r = \frac 1 {a \paren {q^2 - p^2} } \int \frac {\d u} {u^2 + \paren {\frac {p^2} {q^2 - p^2} } }
      | c = 
}}
{{end-eqn}}
There are two cases to address: $q^2 - p^2 > 0$ and $q^2 - p^2 < 0$.
First suppose that $q^2 - p^2 > 0$.
Then:
{{begin-eqn}}
{{eqn | l = \frac 1 {a \paren {q^2 - p^2} } \int \frac {\d u} {u^2 + \paren {\frac {p^2} {q^2 - p^2} } }
      | r = \frac 1 {a \paren {q^2 - p^2} } \int \frac {\d u} {u^2 + \paren {\frac p {\sqrt {q^2 - p^2} } }^2 }
      | c = 
}}
{{eqn | r = \frac 1 {a \paren {q^2 - p^2} } \frac {\sqrt {q^2 - p^2} } p \arctan \frac u {\frac p {\sqrt {q^2 - p^2} } } + C
      | c = Primitive of $\dfrac 1 {x^2 + a^2}$
}}
{{eqn | r = \frac 1 {a p \sqrt {q^2 - p^2} } \arctan \frac {\sqrt {q^2 - p^2} u} p + C
      | c = 
}}
{{eqn | r = \frac 1 {a p \sqrt {q^2 - p^2} } \arctan \frac {\sqrt {q^2 - p^2} \tanh a x} p + C
      | c = substituting $u = \tanh a x$
}}
{{end-eqn}}
Now suppose that $q^2 - p^2 < 0$.
Then:
{{begin-eqn}}
{{eqn | l = \frac 1 {a \paren {q^2 - p^2} } \int \frac {\d u} {u^2 + \paren {\frac {p^2} {q^2 - p^2} } }
      | r = \frac 1 {a \paren {q^2 - p^2} } \int \frac {\d u} {u^2 - \paren {\frac {p^2} {p^2 - q^2} } }
      | c = 
}}
{{eqn | r = \frac {-1} {a \paren {p^2 - q^2} } \int \frac {\d u} {u^2 - \paren {\frac p {\sqrt {p^2 - q^2} } }^2 }
      | c = 
}}
{{eqn | r = \frac {-1} {a \paren {p^2 - q^2} } \frac {\sqrt {p^2 - q^2} } {2 p} \ln \size {\frac {u - \frac p {\sqrt {p^2 - q^2} } } {u + \frac p {\sqrt {p^2 - q^2} } } } + C
      | c = Primitive of $\dfrac 1 {x^2 - a^2}$
}}
{{eqn | r = \frac {-1} {2 a p \sqrt {p^2 - q^2} } \ln \size {\frac {\sqrt {p^2 - q^2} u - p} {\sqrt {p^2 - q^2} u + p} } + C
      | c = 
}}
{{eqn | r = \frac 1 {2 a p \sqrt {p^2 - q^2} } \ln \size {\frac {\sqrt {p^2 - q^2} u + p} {\sqrt {p^2 - q^2} u - p} } + C
      | c = Logarithm of Reciprocal
}}
{{eqn | r = \frac 1 {2 a p \sqrt {p^2 - q^2} } \ln \size {\frac {\sqrt {p^2 - q^2} \tanh a x + p} {\sqrt {p^2 - q^2} \tanh a x - p} } + C
      | c = substituting $u = \tanh a x$
}}
{{eqn | r = \frac 1 {2 a p \sqrt {p^2 - q^2} } \ln \size {\frac {p + \sqrt {p^2 - q^2} \tanh a x} {p - \sqrt {p^2 - q^2} \tanh a x} } + C
      | c = as $\size {a - b} - \size {b - a}$
}}
{{end-eqn}}
{{qed}}