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

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 = 167, 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 (-a d+(b d m+a e n) x+(c d+b e+a f+2 c d m+b e m+b e n+2 a f n) x^2+(2 c e+2 b f+2 a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(3 c f+3 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (4+2 m+3 n) x^5\right )}{x^2} \, 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} \] Output:

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

Mathematica [A] (verified)

Time = 10.80 (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 (-a d+(b d m+a e n) x+(c d+b e+a f+2 c d m+b e m+b e n+2 a f n) x^2+(2 c e+2 b f+2 a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(3 c f+3 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (4+2 m+3 n) x^5\right )}{x^2} \, dx=\frac {(a+x (b+c x))^{1+m} (d+x (e+x (f+g x)))^{1+n}}{x} \] Input:

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

Output:

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

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+a f+b e m+b e n+b e+2 c d m+c d)+x^3 (3 a g n+2 a g+b f m+2 b f n+2 b f+2 c e m+c e n+2 c e)+x (a e n+b d m)-a d+x^4 (b g m+3 b g n+3 b g+2 c f m+2 c f n+3 c f)+c g x^5 (2 m+3 n+4)\right )}{x^2} \, dx\)

\(\Big \downarrow \) 7293

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

\(\Big \downarrow \) 2009

\(\displaystyle (a f (2 n+1)+b e (m+n+1)+c (2 d m+d)) \int \left (c x^2+b x+a\right )^m \left (g x^3+f x^2+e x+d\right )^ndx-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^2}dx+(a e n+b 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+(a g (3 n+2)+b f (m+2 n+2)+c e (2 m+n+2)) \int x \left (c x^2+b x+a\right )^m \left (g x^3+f x^2+e x+d\right )^ndx+(b g (m+3 n+3)+c f (2 m+2 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+c g (2 m+3 n+4) \int x^3 \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*(-(a*d) + (b*d*m + a* 
e*n)*x + (c*d + b*e + a*f + 2*c*d*m + b*e*m + b*e*n + 2*a*f*n)*x^2 + (2*c* 
e + 2*b*f + 2*a*g + 2*c*e*m + b*f*m + c*e*n + 2*b*f*n + 3*a*g*n)*x^3 + (3* 
c*f + 3*b*g + 2*c*f*m + b*g*m + 2*c*f*n + 3*b*g*n)*x^4 + c*g*(4 + 2*m + 3* 
n)*x^5))/x^2,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 = 50.03 (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}\) \(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}\) \(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 (-a d +\left (a e n +b d m \right ) x +\left (2 a f n +b e m +b e n +2 c d m +a f +b e +c d \right ) x^{2}+\left (3 a g n +b f m +2 b f n +2 c e m +c e n +2 a g +2 b f +2 c e \right ) x^{3}+\left (b g m +3 b g n +2 c f m +2 c f n +3 b g +3 c f \right ) x^{4}+c g \left (4+2 m +3 n \right ) x^{5}\right )}{\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}-4 c g \,x^{5}-3 a g n \,x^{3}-b f m \,x^{3}-2 b f n \,x^{3}-3 b g \,x^{4}-2 c e m \,x^{3}-c e n \,x^{3}-3 c f \,x^{4}-2 a f n \,x^{2}-2 a g \,x^{3}-b e m \,x^{2}-b e n \,x^{2}-2 b f \,x^{3}-2 c d m \,x^{2}-2 c e \,x^{3}-a e n x -a f \,x^{2}-b d m x -b e \,x^{2}-c d \,x^{2}+a d \right ) x}\) \(395\)
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 c g}\) \(456\)

Input:

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

Output:

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

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 (-a d+(b d m+a e n) x+(c d+b e+a f+2 c d m+b e m+b e n+2 a f n) x^2+(2 c e+2 b f+2 a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(3 c f+3 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (4+2 m+3 n) x^5\right )}{x^2} \, dx=\text {Timed out} \] Input:

integrate((c*x^2+b*x+a)^m*(g*x^3+f*x^2+e*x+d)^n*(-a*d+(a*e*n+b*d*m)*x+(2*a 
*f*n+b*e*m+b*e*n+2*c*d*m+a*f+b*e+c*d)*x^2+(3*a*g*n+b*f*m+2*b*f*n+2*c*e*m+c 
*e*n+2*a*g+2*b*f+2*c*e)*x^3+(b*g*m+3*b*g*n+2*c*f*m+2*c*f*n+3*b*g+3*c*f)*x^ 
4+c*g*(4+2*m+3*n)*x^5)/x^2,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 (-a d+(b d m+a e n) x+(c d+b e+a f+2 c d m+b e m+b e n+2 a f n) x^2+(2 c e+2 b f+2 a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(3 c f+3 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (4+2 m+3 n) x^5\right )}{x^2} \, dx=\text {Timed out} \] Input:

integrate((c*x**2+b*x+a)**m*(g*x**3+f*x**2+e*x+d)**n*(-a*d+(a*e*n+b*d*m)*x 
+(2*a*f*n+b*e*m+b*e*n+2*c*d*m+a*f+b*e+c*d)*x**2+(3*a*g*n+b*f*m+2*b*f*n+2*c 
*e*m+c*e*n+2*a*g+2*b*f+2*c*e)*x**3+(b*g*m+3*b*g*n+2*c*f*m+2*c*f*n+3*b*g+3* 
c*f)*x**4+c*g*(4+2*m+3*n)*x**5)/x**2,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.13 (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 (-a d+(b d m+a e n) x+(c d+b e+a f+2 c d m+b e m+b e n+2 a f n) x^2+(2 c e+2 b f+2 a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(3 c f+3 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (4+2 m+3 n) x^5\right )}{x^2} \, 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} \] Input:

integrate((c*x^2+b*x+a)^m*(g*x^3+f*x^2+e*x+d)^n*(-a*d+(a*e*n+b*d*m)*x+(2*a 
*f*n+b*e*m+b*e*n+2*c*d*m+a*f+b*e+c*d)*x^2+(3*a*g*n+b*f*m+2*b*f*n+2*c*e*m+c 
*e*n+2*a*g+2*b*f+2*c*e)*x^3+(b*g*m+3*b*g*n+2*c*f*m+2*c*f*n+3*b*g+3*c*f)*x^ 
4+c*g*(4+2*m+3*n)*x^5)/x^2,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
 

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 (-a d+(b d m+a e n) x+(c d+b e+a f+2 c d m+b e m+b e n+2 a f n) x^2+(2 c e+2 b f+2 a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(3 c f+3 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (4+2 m+3 n) x^5\right )}{x^2} \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Mupad [B] (verification not implemented)

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

int(((a + b*x + c*x^2)^m*(d + e*x + f*x^2 + g*x^3)^n*(x^4*(3*b*g + 3*c*f + 
 b*g*m + 2*c*f*m + 3*b*g*n + 2*c*f*n) - a*d + x^2*(a*f + b*e + c*d + b*e*m 
 + 2*c*d*m + 2*a*f*n + b*e*n) + x*(b*d*m + a*e*n) + x^3*(2*a*g + 2*b*f + 2 
*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 + 
 4)))/x^2,x)
 

Output:

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

Reduce [B] (verification not implemented)

Time = 0.20 (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 (-a d+(b d m+a e n) x+(c d+b e+a f+2 c d m+b e m+b e n+2 a f n) x^2+(2 c e+2 b f+2 a g+2 c e m+b f m+c e n+2 b f n+3 a g n) x^3+(3 c f+3 b g+2 c f m+b g m+2 c f n+3 b g n) x^4+c g (4+2 m+3 n) x^5\right )}{x^2} \, 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} \] Input:

int((c*x^2+b*x+a)^m*(g*x^3+f*x^2+e*x+d)^n*(-a*d+(a*e*n+b*d*m)*x+(2*a*f*n+b 
*e*m+b*e*n+2*c*d*m+a*f+b*e+c*d)*x^2+(3*a*g*n+b*f*m+2*b*f*n+2*c*e*m+c*e*n+2 
*a*g+2*b*f+2*c*e)*x^3+(b*g*m+3*b*g*n+2*c*f*m+2*c*f*n+3*b*g+3*c*f)*x^4+c*g* 
(4+2*m+3*n)*x^5)/x^2,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