\(\int \frac {(a+b x+c x^2)^m (d+e x+f x^2+g x^3)^n (-2 a d+(-b d-a e+b d m+a e n) x+(2 c d m+b e m+b e n+2 a f n) x^2+(c e+b f+a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(2 c f+2 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (3+2 m+3 n) x^5)}{x^3} \, dx\) [100]

Optimal result
Mathematica [A] (verified)
Rubi [F]
Maple [A] (verified)
Fricas [F(-1)]
Sympy [F(-1)]
Maxima [B] (verification not implemented)
Giac [F(-1)]
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 163, antiderivative size = 37 \[ \int \frac {\left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n \left (-2 a d+(-b d-a e+b d m+a e n) x+(2 c d m+b e m+b e n+2 a f n) x^2+(c e+b f+a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(2 c f+2 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (3+2 m+3 n) x^5\right )}{x^3} \, dx=\frac {\left (a+b x+c x^2\right )^{1+m} \left (d+e x+f x^2+g x^3\right )^{1+n}}{x^2} \] Output:

(c*x^2+b*x+a)^(1+m)*(g*x^3+f*x^2+e*x+d)^(1+n)/x^2
                                                                                    
                                                                                    
 

Mathematica [A] (verified)

Time = 11.07 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.92 \[ \int \frac {\left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n \left (-2 a d+(-b d-a e+b d m+a e n) x+(2 c d m+b e m+b e n+2 a f n) x^2+(c e+b f+a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(2 c f+2 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (3+2 m+3 n) x^5\right )}{x^3} \, dx=\frac {(a+x (b+c x))^{1+m} (d+x (e+x (f+g x)))^{1+n}}{x^2} \] Input:

Integrate[((a + b*x + c*x^2)^m*(d + e*x + f*x^2 + g*x^3)^n*(-2*a*d + (-(b* 
d) - a*e + b*d*m + a*e*n)*x + (2*c*d*m + b*e*m + b*e*n + 2*a*f*n)*x^2 + (c 
*e + b*f + a*g + 2*c*e*m + b*f*m + c*e*n + 2*b*f*n + 3*a*g*n)*x^3 + (2*c*f 
 + 2*b*g + 2*c*f*m + b*g*m + 2*c*f*n + 3*b*g*n)*x^4 + c*g*(3 + 2*m + 3*n)* 
x^5))/x^3,x]
 

Output:

((a + x*(b + c*x))^(1 + m)*(d + x*(e + x*(f + g*x)))^(1 + n))/x^2
 

Rubi [F]

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n \left (x^2 (2 a f n+b e m+b e n+2 c d m)+x^3 (3 a g n+a g+b f m+2 b f n+b f+2 c e m+c e n+c e)+x (a e n-a e+b d m-b d)-2 a d+x^4 (b g m+3 b g n+2 b g+2 c f m+2 c f n+2 c f)+c g x^5 (2 m+3 n+3)\right )}{x^3} \, dx\)

\(\Big \downarrow \) 7293

\(\displaystyle \int \left (c g x^2 (2 m+3 n+3) \left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n+c e \left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n \left (\frac {a (3 g n+g)+b f (m+2 n+1)+c e (2 m+n)}{c e}+1\right )+x \left (a+b x+c x^2\right )^m (b g (m+3 n+2)+2 c f (m+n+1)) \left (d+e x+f x^2+g x^3\right )^n+\frac {\left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n (2 a f n+b e (m+n)+2 c d m)}{x}+\frac {\left (a+b x+c x^2\right )^m (-a e (1-n)-b d (1-m)) \left (d+e x+f x^2+g x^3\right )^n}{x^2}-\frac {2 a d \left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n}{x^3}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle (a g (3 n+1)+b f (m+2 n+1)+c e (2 m+n+1)) \int \left (c x^2+b x+a\right )^m \left (g x^3+f x^2+e x+d\right )^ndx-2 a d \int \frac {\left (c x^2+b x+a\right )^m \left (g x^3+f x^2+e x+d\right )^n}{x^3}dx-(a e (1-n)+b d (1-m)) \int \frac {\left (c x^2+b x+a\right )^m \left (g x^3+f x^2+e x+d\right )^n}{x^2}dx+(2 a f n+b e (m+n)+2 c d m) \int \frac {\left (c x^2+b x+a\right )^m \left (g x^3+f x^2+e x+d\right )^n}{x}dx+(b g (m+3 n+2)+2 c f (m+n+1)) \int x \left (c x^2+b x+a\right )^m \left (g x^3+f x^2+e x+d\right )^ndx+c g (2 m+3 n+3) \int x^2 \left (c x^2+b x+a\right )^m \left (g x^3+f x^2+e x+d\right )^ndx\)

Input:

Int[((a + b*x + c*x^2)^m*(d + e*x + f*x^2 + g*x^3)^n*(-2*a*d + (-(b*d) - a 
*e + b*d*m + a*e*n)*x + (2*c*d*m + b*e*m + b*e*n + 2*a*f*n)*x^2 + (c*e + b 
*f + a*g + 2*c*e*m + b*f*m + c*e*n + 2*b*f*n + 3*a*g*n)*x^3 + (2*c*f + 2*b 
*g + 2*c*f*m + b*g*m + 2*c*f*n + 3*b*g*n)*x^4 + c*g*(3 + 2*m + 3*n)*x^5))/ 
x^3,x]
 

Output:

$Aborted
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 7293
Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v] 
]
 
Maple [A] (verified)

Time = 49.30 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.03

method result size
gosper \(\frac {\left (c \,x^{2}+b x +a \right )^{1+m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{1+n}}{x^{2}}\) \(38\)
risch \(\frac {\left (c g \,x^{5}+b g \,x^{4}+c f \,x^{4}+a g \,x^{3}+b f \,x^{3}+c e \,x^{3}+a f \,x^{2}+b e \,x^{2}+c d \,x^{2}+a e x +b d x +a d \right ) \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n}}{x^{2}}\) \(100\)
orering \(-\frac {\left (g \,x^{3}+f \,x^{2}+e x +d \right ) \left (c \,x^{2}+b x +a \right ) \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} \left (-2 a d +\left (a e n +b d m -a e -b d \right ) x +\left (2 a f n +b e m +b e n +2 c d m \right ) x^{2}+\left (3 a g n +b f m +2 b f n +2 c e m +c e n +a g +b f +c e \right ) x^{3}+\left (b g m +3 b g n +2 c f m +2 c f n +2 b g +2 c f \right ) x^{4}+c g \left (3+2 m +3 n \right ) x^{5}\right )}{x^{2} \left (-2 c g m \,x^{5}-3 c g n \,x^{5}-b g m \,x^{4}-3 b g n \,x^{4}-2 c f m \,x^{4}-2 c f n \,x^{4}-3 c g \,x^{5}-3 a g n \,x^{3}-b f m \,x^{3}-2 b f n \,x^{3}-2 b g \,x^{4}-2 c e m \,x^{3}-c e n \,x^{3}-2 c f \,x^{4}-2 a f n \,x^{2}-a g \,x^{3}-b e m \,x^{2}-b e n \,x^{2}-b f \,x^{3}-2 c d m \,x^{2}-c e \,x^{3}-a e n x -b d m x +a e x +b d x +2 a d \right )}\) \(379\)
parallelrisch \(\frac {x^{5} \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} c^{2} g^{2}+x^{4} \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} b c \,g^{2}+x^{4} \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} c^{2} f g +x^{3} \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} a c \,g^{2}+x^{3} \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} b c f g +x^{3} \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} c^{2} e g +x^{2} \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} a c f g +x^{2} \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} b c e g +x^{2} \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} c^{2} d g +x \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} a c e g +x \left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} b c d g +\left (c \,x^{2}+b x +a \right )^{m} \left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} a c d g}{x^{2} c g}\) \(456\)

Input:

int((c*x^2+b*x+a)^m*(g*x^3+f*x^2+e*x+d)^n*(-2*a*d+(a*e*n+b*d*m-a*e-b*d)*x+ 
(2*a*f*n+b*e*m+b*e*n+2*c*d*m)*x^2+(3*a*g*n+b*f*m+2*b*f*n+2*c*e*m+c*e*n+a*g 
+b*f+c*e)*x^3+(b*g*m+3*b*g*n+2*c*f*m+2*c*f*n+2*b*g+2*c*f)*x^4+c*g*(3+2*m+3 
*n)*x^5)/x^3,x,method=_RETURNVERBOSE)
 

Output:

(c*x^2+b*x+a)^(1+m)*(g*x^3+f*x^2+e*x+d)^(1+n)/x^2
 

Fricas [F(-1)]

Timed out. \[ \int \frac {\left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n \left (-2 a d+(-b d-a e+b d m+a e n) x+(2 c d m+b e m+b e n+2 a f n) x^2+(c e+b f+a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(2 c f+2 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (3+2 m+3 n) x^5\right )}{x^3} \, dx=\text {Timed out} \] Input:

integrate((c*x^2+b*x+a)^m*(g*x^3+f*x^2+e*x+d)^n*(-2*a*d+(a*e*n+b*d*m-a*e-b 
*d)*x+(2*a*f*n+b*e*m+b*e*n+2*c*d*m)*x^2+(3*a*g*n+b*f*m+2*b*f*n+2*c*e*m+c*e 
*n+a*g+b*f+c*e)*x^3+(b*g*m+3*b*g*n+2*c*f*m+2*c*f*n+2*b*g+2*c*f)*x^4+c*g*(3 
+2*m+3*n)*x^5)/x^3,x, algorithm="fricas")
 

Output:

Timed out
 

Sympy [F(-1)]

Timed out. \[ \int \frac {\left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n \left (-2 a d+(-b d-a e+b d m+a e n) x+(2 c d m+b e m+b e n+2 a f n) x^2+(c e+b f+a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(2 c f+2 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (3+2 m+3 n) x^5\right )}{x^3} \, dx=\text {Timed out} \] Input:

integrate((c*x**2+b*x+a)**m*(g*x**3+f*x**2+e*x+d)**n*(-2*a*d+(a*e*n+b*d*m- 
a*e-b*d)*x+(2*a*f*n+b*e*m+b*e*n+2*c*d*m)*x**2+(3*a*g*n+b*f*m+2*b*f*n+2*c*e 
*m+c*e*n+a*g+b*f+c*e)*x**3+(b*g*m+3*b*g*n+2*c*f*m+2*c*f*n+2*b*g+2*c*f)*x** 
4+c*g*(3+2*m+3*n)*x**5)/x**3,x)
 

Output:

Timed out
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 95 vs. \(2 (37) = 74\).

Time = 0.12 (sec) , antiderivative size = 95, normalized size of antiderivative = 2.57 \[ \int \frac {\left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n \left (-2 a d+(-b d-a e+b d m+a e n) x+(2 c d m+b e m+b e n+2 a f n) x^2+(c e+b f+a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(2 c f+2 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (3+2 m+3 n) x^5\right )}{x^3} \, dx=\frac {{\left (c g x^{5} + {\left (c f + b g\right )} x^{4} + {\left (c e + b f + a g\right )} x^{3} + {\left (c d + b e + a f\right )} x^{2} + a d + {\left (b d + a e\right )} x\right )} e^{\left (n \log \left (g x^{3} + f x^{2} + e x + d\right ) + m \log \left (c x^{2} + b x + a\right )\right )}}{x^{2}} \] Input:

integrate((c*x^2+b*x+a)^m*(g*x^3+f*x^2+e*x+d)^n*(-2*a*d+(a*e*n+b*d*m-a*e-b 
*d)*x+(2*a*f*n+b*e*m+b*e*n+2*c*d*m)*x^2+(3*a*g*n+b*f*m+2*b*f*n+2*c*e*m+c*e 
*n+a*g+b*f+c*e)*x^3+(b*g*m+3*b*g*n+2*c*f*m+2*c*f*n+2*b*g+2*c*f)*x^4+c*g*(3 
+2*m+3*n)*x^5)/x^3,x, algorithm="maxima")
 

Output:

(c*g*x^5 + (c*f + b*g)*x^4 + (c*e + b*f + a*g)*x^3 + (c*d + b*e + a*f)*x^2 
 + a*d + (b*d + a*e)*x)*e^(n*log(g*x^3 + f*x^2 + e*x + d) + m*log(c*x^2 + 
b*x + a))/x^2
 

Giac [F(-1)]

Timed out. \[ \int \frac {\left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n \left (-2 a d+(-b d-a e+b d m+a e n) x+(2 c d m+b e m+b e n+2 a f n) x^2+(c e+b f+a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(2 c f+2 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (3+2 m+3 n) x^5\right )}{x^3} \, dx=\text {Timed out} \] Input:

integrate((c*x^2+b*x+a)^m*(g*x^3+f*x^2+e*x+d)^n*(-2*a*d+(a*e*n+b*d*m-a*e-b 
*d)*x+(2*a*f*n+b*e*m+b*e*n+2*c*d*m)*x^2+(3*a*g*n+b*f*m+2*b*f*n+2*c*e*m+c*e 
*n+a*g+b*f+c*e)*x^3+(b*g*m+3*b*g*n+2*c*f*m+2*c*f*n+2*b*g+2*c*f)*x^4+c*g*(3 
+2*m+3*n)*x^5)/x^3,x, algorithm="giac")
 

Output:

Timed out
 

Mupad [B] (verification not implemented)

Time = 31.20 (sec) , antiderivative size = 146, normalized size of antiderivative = 3.95 \[ \int \frac {\left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n \left (-2 a d+(-b d-a e+b d m+a e n) x+(2 c d m+b e m+b e n+2 a f n) x^2+(c e+b f+a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(2 c f+2 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (3+2 m+3 n) x^5\right )}{x^3} \, dx={\left (c\,x^2+b\,x+a\right )}^m\,{\left (g\,x^3+f\,x^2+e\,x+d\right )}^n\,\left (a\,f+b\,e+c\,d+c\,g\,x^3+a\,g\,x+b\,f\,x+c\,e\,x+b\,g\,x^2+c\,f\,x^2\right )+\frac {\left (a\,e+b\,d\right )\,{\left (c\,x^2+b\,x+a\right )}^m\,{\left (g\,x^3+f\,x^2+e\,x+d\right )}^n}{x}+\frac {a\,d\,{\left (c\,x^2+b\,x+a\right )}^m\,{\left (g\,x^3+f\,x^2+e\,x+d\right )}^n}{x^2} \] Input:

int(((a + b*x + c*x^2)^m*(d + e*x + f*x^2 + g*x^3)^n*(x^4*(2*b*g + 2*c*f + 
 b*g*m + 2*c*f*m + 3*b*g*n + 2*c*f*n) - 2*a*d - x*(a*e + b*d - b*d*m - a*e 
*n) + x^2*(b*e*m + 2*c*d*m + 2*a*f*n + b*e*n) + x^3*(a*g + b*f + c*e + b*f 
*m + 2*c*e*m + 3*a*g*n + 2*b*f*n + c*e*n) + c*g*x^5*(2*m + 3*n + 3)))/x^3, 
x)
 

Output:

(a + b*x + c*x^2)^m*(d + e*x + f*x^2 + g*x^3)^n*(a*f + b*e + c*d + c*g*x^3 
 + a*g*x + b*f*x + c*e*x + b*g*x^2 + c*f*x^2) + ((a*e + b*d)*(a + b*x + c* 
x^2)^m*(d + e*x + f*x^2 + g*x^3)^n)/x + (a*d*(a + b*x + c*x^2)^m*(d + e*x 
+ f*x^2 + g*x^3)^n)/x^2
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 99, normalized size of antiderivative = 2.68 \[ \int \frac {\left (a+b x+c x^2\right )^m \left (d+e x+f x^2+g x^3\right )^n \left (-2 a d+(-b d-a e+b d m+a e n) x+(2 c d m+b e m+b e n+2 a f n) x^2+(c e+b f+a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(2 c f+2 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (3+2 m+3 n) x^5\right )}{x^3} \, dx=\frac {\left (g \,x^{3}+f \,x^{2}+e x +d \right )^{n} \left (c \,x^{2}+b x +a \right )^{m} \left (c g \,x^{5}+b g \,x^{4}+c f \,x^{4}+a g \,x^{3}+b f \,x^{3}+c e \,x^{3}+a f \,x^{2}+b e \,x^{2}+c d \,x^{2}+a e x +b d x +a d \right )}{x^{2}} \] Input:

int((c*x^2+b*x+a)^m*(g*x^3+f*x^2+e*x+d)^n*(-2*a*d+(a*e*n+b*d*m-a*e-b*d)*x+ 
(2*a*f*n+b*e*m+b*e*n+2*c*d*m)*x^2+(3*a*g*n+b*f*m+2*b*f*n+2*c*e*m+c*e*n+a*g 
+b*f+c*e)*x^3+(b*g*m+3*b*g*n+2*c*f*m+2*c*f*n+2*b*g+2*c*f)*x^4+c*g*(3+2*m+3 
*n)*x^5)/x^3,x)
 

Output:

((d + e*x + f*x**2 + g*x**3)**n*(a + b*x + c*x**2)**m*(a*d + a*e*x + a*f*x 
**2 + a*g*x**3 + b*d*x + b*e*x**2 + b*f*x**3 + b*g*x**4 + c*d*x**2 + c*e*x 
**3 + c*f*x**4 + c*g*x**5))/x**2