Theorem: Reduction Formula for Primitive of a x + b over Power of Quadratic

Let $n \in \Z_{\ge 2}$.
Let:
:$\map {I_n} {a, b} := \ds \int \dfrac {a x + b} {\paren {x^2 + A x + B}^n} \rd x$
Then:
:$\map {I_n} {a, b} = \dfrac {b A - 2 a B + \paren {2 b - a A} x} {\paren {n - 1} \paren {4 B - A^2} \paren {x^2 + A x + B}^n} + \dfrac {\paren {2 n - 3} \paren {2 b - a A} } {\paren {n - 1} \paren {4 B - A^2} } \map {I_{n - 1} }{0, 1}$
is a reduction formula for $\ds \int \dfrac {a x + b} {\paren {x^2 + A x + B}^n} \rd x$.

Proof:
We observe that:
:$(1): \quad \map {\dfrac \d {\d x} } {x^2 + A x + B} = 2 x + A$
Hence we obtain:
{{begin-eqn}}
{{eqn | l = a x + b
      | r = \dfrac a 2 \paren {2 x + A - A} + b
      | c = 
}}
{{eqn | r = \dfrac a 2 \paren {2 x + A} + \paren {b - \frac {a A} 2}
      | c = 
}}
{{end-eqn}}
and so express:
{{begin-eqn}}
{{eqn | l = \map {I_n} {a, b}
      | r = \int \dfrac {a x + b} {\paren {x^2 + A x + B}^n} \rd x
      | c = 
}}
{{eqn | r = \int \dfrac {\frac a 2 \paren {2 x + A} + \paren {b - \frac {a A} 2} } {\paren {x^2 + A x + B}^n} \rd x
      | c = 
}}
{{eqn | n = 2
      | ll= \leadsto
      | l = \map {I_n} {a, b}
      | r = \frac a 2 \int \dfrac {2 x + A} {\paren {x^2 + A x + B}^n} \rd x + \frac {2 b - a A} 2 \int \dfrac 1 {\paren {x^2 + A x + B}^n} \rd x
      | c = 
}}
{{end-eqn}}
Let $z = x^2 + A x + B$.
Then:
{{begin-eqn}}
{{eqn | l = \int \dfrac {2 x + A} {\paren {x^2 + A x + B}^n} \rd x
      | r = \int \dfrac 1 {z^n} \rd z
      | c = Integration by Substitution using $(1)$
}}
{{eqn | r = \dfrac 1 {-\paren {n - 1} z^{n - 1} }
      | c = Primitive of Power, which is valid, as $n \ge 2$ {{hypothesis}}
}}
{{eqn | r = \dfrac 1 {-\paren {n - 1} \paren {x^2 + A x + B}^{n - 1} }
      | c = simplifying
}}
{{end-eqn}}
Hence we have:
{{begin-eqn}}
{{eqn | l = \map {I_n} {a, b}
      | r = \frac {2 b - a A} 2 \int \dfrac 1 {\paren {x^2 + A x + B}^n} \rd x - \dfrac a {2 \paren {n - 1} \paren {x^2 + A x + B}^{n - 1} }
      | c = 
}}
{{eqn | r = \frac {2 b - a A} 2 \map {I_n} {0, 1} - \dfrac a {2 \paren {n - 1} \paren {x^2 + A x + B}^{n - 1} }
      | c = 
}}
{{eqn | n = 3
      | ll= \leadsto
      | l = \map {I_n} {0, 1}
      | r = \frac 2 {2 b - a A} \map {I_n} {a, b} + \dfrac a {\paren {2 b - a A} \paren {n - 1} \paren {x^2 + A x + B}^{n - 1} }
      | c = rearranging 
}}
{{end-eqn}}
Now let $h$ be the real function defined as:
:$\forall x \in \R: \map h x = x^2 + A x + B$
Thus we have:
:$\map {I_n} {a, b}  := \ds \int \dfrac {a x + b} {\paren {\map h x}^n} \rd x$
Using Power Rule for Derivatives:
:$\map {\dfrac \d {\d x} } {\map h x} = 2 x + A$
and so:
{{begin-eqn}}
{{eqn | l = \map {\dfrac \d {\d x} } {\dfrac {2 x + A} {\paren {\map h x}^{n - 1} } }
      | r = \paren {2 x + A} \map {\dfrac \d {\d x} } {\dfrac 1 {\paren {\map h x}^{n - 1} } } + \dfrac 1 {\paren {\map h x}^{n - 1} } \dfrac \d {\d x} \paren {2 x + A}
      | c = Product Rule for Derivatives
}}
{{eqn | r = \paren {2 x + A} \dfrac {-\paren {n - 1} } {\paren {\map h x}^n} \map {\dfrac \d {\d x} } {\map h x} + \dfrac 2 {\paren {\map h x}^{n - 1} }
      | c = Power Rule for Derivatives, Chain Rule for Derivatives
}}
{{eqn | r = \paren {2 x + A} \dfrac {-\paren {n - 1} } {\paren {\map h x}^n} \paren {2 x + A} + \dfrac 2 {\paren {\map h x}^{n - 1} }
      | c = Power Rule for Derivatives
}}
{{eqn | r = -\paren {n - 1} \dfrac {4 x^2 + 4 A x + A^2} {\paren {\map h x}^n} + \dfrac 2 {\paren {\map h x}^{n - 1} }
      | c = multiplying out and grouping
}}
{{eqn | r = -\paren {n - 1} \dfrac {4 \paren {x^2 + A x + B} - 4 B + A^2} {\paren {\map h x}^n} + \dfrac 2 {\paren {\map h x}^{n - 1} }
      | c = adding and subtracting $4 B$ to numerator of integrand
}}
{{eqn | r = -\paren {n - 1} \dfrac {4 \paren {x^2 + A x + B} } {\paren {\map h x}^n} - \paren {n - 1} \dfrac {-4 B + A^2} {\paren {\map h x}^n} + \dfrac 2 {\paren {\map h x}^{n - 1} }
      | c = regrouping
}}
{{eqn | r = -\paren {n - 1} \dfrac {4 \map h x} {\paren {\map h x}^n} - \paren {n - 1} \dfrac {-4 B + A^2} {\paren {\map h x}^n} + \dfrac 2 {\paren {\map h x}^{n - 1} }
      | c = Definition of $\map h x$
}}
{{eqn | r = \dfrac {4 - 4 n} {\paren {\map h x}^{n - 1} } + \dfrac {\paren {n - 1} \paren {4 B - A^2} } {\paren {\map h x}^n} + \dfrac 2 {\paren {\map h x}^{n - 1} }
      | c = separating terms and simplifying
}}
{{eqn | r = \dfrac {4 - 4 n + 2} {\paren {\map h x}^{n - 1} } + \dfrac {\paren {n - 1} \paren {4 B - A^2} } {\paren {\map h x}^n}
      | c = grouping
}}
{{eqn | r = \dfrac {2 \paren {3 - 2 n} } {\paren {\map h x}^{n - 1} } + \dfrac {\paren {n - 1} \paren {4 B - A^2} } {\paren {\map h x}^n}
      | c = simplifying
}}
{{eqn | ll= \leadsto
      | l = \dfrac {2 x + A} {\paren {\map h x}^{n - 1} }
      | r = \int \paren {\dfrac {2 \paren {3 - 2 n} } {\paren {\map h x}^{n - 1} } + \dfrac {\paren {n - 1} \paren {4 B - A^2} } {\paren {\map h x}^n} } \rd x
      | c = integrating both sides {{WRT|Integration}} $x$
}}
{{eqn | r = 2 \paren {3 - 2 n} \int \dfrac {\d x} {\paren {\map h x}^{n - 1} } + \paren {n - 1} \paren {4 B - A^2} \int \dfrac {\d x} {\paren {\map h x}^n}
      | c = Linear Combination of Primitives
}}
{{eqn | r = 2 \paren {3 - 2 n} \map {I_{n - 1} } {0, 1} + \paren {n - 1} \paren {4 B - A^2} \map {I_n} {0, 1}
      | c = Definition of $\map {I_n} {a, b}$
}}
{{eqn | ll= \leadsto
      | l = \dfrac {2 x + A} {\paren {x^2 + A x + B}^{n - 1} }
      | r = 2 \paren {3 - 2 n} \map {I_{n - 1} } {0, 1} + \paren {n - 1} \paren {4 B - A^2} \paren {\frac 2 {2 b - a A} \map {I_n} {a, b} + \dfrac a {\paren {2 b - a A} \paren {n - 1} \paren {x^2 + A x + B}^{n - 1} } }
      | c = substituting for $\map {I_n} {0, 1}$ from $(3)$
}}
{{end-eqn}}
The result follows after algebra.
{{Proofread}}
{{qed}}