2.1 Problem number 30

\[ \int \frac {(c+d x)^n \left (A+B x+C x^2+D x^3\right )}{(a+b x)^2} \, dx \]

Optimal antiderivative \[ \frac {\left (b C d -2 D a d -D b c \right ) \left (d x +c \right )^{1+n}}{b^{3} d^{2} \left (1+n \right )}-\frac {\left (A -\frac {a \left (B \,b^{2}-C a b +D a^{2}\right )}{b^{3}}\right ) \left (d x +c \right )^{1+n}}{\left (-a d +b c \right ) \left (b x +a \right )}+\frac {D \left (d x +c \right )^{2+n}}{b^{2} d^{2} \left (2+n \right )}+\frac {\left (a^{3} d D \left (3+n \right )-b^{3} \left (A d n +B c \right )+a \,b^{2} \left (2 c C +B d \left (1+n \right )\right )-a^{2} b \left (3 c D+C d \left (2+n \right )\right )\right ) \left (d x +c \right )^{1+n} \hypergeom \! \left (\left [1, 1+n \right ], \left [2+n \right ], \frac {b \left (d x +c \right )}{-a d +b c}\right )}{b^{3} \left (-a d +b c \right )^{2} \left (1+n \right )} \]

command

Integrate[((c + d*x)^n*(A + B*x + C*x^2 + D*x^3))/(a + b*x)^2,x]

Mathematica 13.1 output

\[ \int \frac {(c+d x)^n \left (A+B x+C x^2+D x^3\right )}{(a+b x)^2} \, dx \]

Mathematica 12.3 output

\[ \frac {(c+d x)^{n+1} \left (\frac {d \left (A b^3-a \left (a^2 D-a b C+b^2 B\right )\right ) \, _2F_1\left (2,n+1;n+2;\frac {b (c+d x)}{b c-a d}\right )}{(n+1) (b c-a d)^2}-\frac {\left (3 a^2 D-2 a b C+b^2 B\right ) \, _2F_1\left (1,n+1;n+2;\frac {b (c+d x)}{b c-a d}\right )}{(n+1) (b c-a d)}+\frac {-2 a d D-b c D+b C d}{d^2 (n+1)}+\frac {b D (c+d x)}{d^2 (n+2)}\right )}{b^3} \]