For a long time, I wanted Mathematica to show intermediate steps, especially when solving integrals. Rule-based Integration (Rubi) is a Mathematica plugin which seems to do exactly that, but I need some help understanding one of its rules.
Considering the integral
$$\int(a+bx)^m\,(c+dx)^n\,(e+fx)^p\,dx $$
Rubi applies the below transformation if $\quad m+n+p+1=0 \quad\land \quad p \in \mathbb{Z}^-$:
$$(a+bx)^m\,(c+dx)^n\,(e+fx)^p = \frac{b\,d^{m+n}\,f^p(a+bx)^{m-1}}{(c+dx)^m} + \frac{(a+bx)^{m-1}(e+fx)^p}{(c+dx)^m}\left((a+bx)(c+dx)^{-p-1}-\frac{b\,d^{-p-1}\,f^p}{(e+fx)^p}\right) $$
So the original integral becomes
$$ b\,d^{m+n}\,f^p\int\frac{(a+bx)^{m-1}}{(c+dx)^m}dx + \int\frac{(a+bx)^{m-1}(e+fx)^p}{(c+dx)^m}\left((a+bx)(c+dx)^{-p-1}-\frac{b\,d^{-p-1}\,f^p}{(e+fx)^p}\right)dx$$
That transformation looks like partial fraction decomposition, but I am not even sure it really is. What is going on here?
Ref.: Rubi documentation, linear binomials, sec. 1.1.1.3, page 46 (Link)
It seems Rubi uses something akin to "Completing the Square" to split up the integrand:
$$ \color{blue}{(a+bx)^m(c+dx)^n(e+fx)^p} \tag{1}\label{eq1} $$
Add and subtract some suitably chosen term from expression \eqref{eq1}:
$$ \begin{gather} b\,d^{m+n}\,f^p\,(a+bx)^{m-1}(c+dx)^{-m} \\[8pt] +\color{blue}{(a+bx)^m(c+dx)^n(e+fx)^p} \\[8pt] -b\,d^{m+n}\,f^p\,(a+bx)^{m-1}(c+dx)^{-m} \end{gather} $$
Factor out $(a+bx)^{m-1}(e+fx)^p(c+dx)^{-m}$ from the second and last term: $$ \begin{gather} \frac{b\,d^{m+n}\,f^p\,(a+bx)^{m-1}}{(c+dx)^m} \\[8pt] +\frac{(a+bx)^{m-1}(e+fx)^p}{(c+dx)^m}\left((a+bx)(c+dx)^{-p-1}-\frac{b\,d^{-p-1}\,f^p}{(e+fx)^p}\right) \end{gather} $$
For certain kinds of $\eqref{eq1}$ this technique may simplify the integral in order to proceed.