Primitive of x squared over a x + b squared by p x + q/Partial Fraction Expansion

Lemma for Primitive of $\dfrac {x^2} {\paren {a x + b}^2 \paren {p x + q} }$

 * $\dfrac {x^2} {\paren {a x + b}^2 \paren {p x + q} } \equiv \dfrac {b \paren {b p - 2 a q} } {a \paren {b p - a q}^2 \paren {a x + b} } + \dfrac {-b^2} {a \paren {b p - a q} \paren {a x + b}^2} + \dfrac {q^2} {\paren {b p - a q}^2 \paren {p x + q} }$

Proof
Setting $a x + b = 0$ in $(1)$:

Setting $p x + q = 0$ in $(1)$:

Equating $2$nd powers of $x$ in $(1)$:

Summarising:

Hence the result.