\(\int (g+h x) (a+b x+c x^2) (d+f x^2)^2 \, dx\) [9]

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

Optimal result

Integrand size = 25, antiderivative size = 144 \[ \int (g+h x) \left (a+b x+c x^2\right ) \left (d+f x^2\right )^2 \, dx=a d^2 g x+\frac {1}{2} d^2 (b g+a h) x^2+\frac {1}{3} d (c d g+2 a f g+b d h) x^3+\frac {1}{4} d (2 b f g+c d h+2 a f h) x^4+\frac {1}{5} f (2 c d g+a f g+2 b d h) x^5+\frac {1}{6} f (b f g+2 c d h+a f h) x^6+\frac {1}{7} f^2 (c g+b h) x^7+\frac {1}{8} c f^2 h x^8 \] Output:

a*d^2*g*x+1/2*d^2*(a*h+b*g)*x^2+1/3*d*(2*a*f*g+b*d*h+c*d*g)*x^3+1/4*d*(2*a 
*f*h+2*b*f*g+c*d*h)*x^4+1/5*f*(a*f*g+2*b*d*h+2*c*d*g)*x^5+1/6*f*(a*f*h+b*f 
*g+2*c*d*h)*x^6+1/7*f^2*(b*h+c*g)*x^7+1/8*c*f^2*h*x^8
 

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.00 \[ \int (g+h x) \left (a+b x+c x^2\right ) \left (d+f x^2\right )^2 \, dx=a d^2 g x+\frac {1}{2} d^2 (b g+a h) x^2+\frac {1}{3} d (c d g+2 a f g+b d h) x^3+\frac {1}{4} d (2 b f g+c d h+2 a f h) x^4+\frac {1}{5} f (2 c d g+a f g+2 b d h) x^5+\frac {1}{6} f (b f g+2 c d h+a f h) x^6+\frac {1}{7} f^2 (c g+b h) x^7+\frac {1}{8} c f^2 h x^8 \] Input:

Integrate[(g + h*x)*(a + b*x + c*x^2)*(d + f*x^2)^2,x]
 

Output:

a*d^2*g*x + (d^2*(b*g + a*h)*x^2)/2 + (d*(c*d*g + 2*a*f*g + b*d*h)*x^3)/3 
+ (d*(2*b*f*g + c*d*h + 2*a*f*h)*x^4)/4 + (f*(2*c*d*g + a*f*g + 2*b*d*h)*x 
^5)/5 + (f*(b*f*g + 2*c*d*h + a*f*h)*x^6)/6 + (f^2*(c*g + b*h)*x^7)/7 + (c 
*f^2*h*x^8)/8
 

Rubi [A] (verified)

Time = 0.40 (sec) , antiderivative size = 128, normalized size of antiderivative = 0.89, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2017, 2341, 2009}

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 \left (d+f x^2\right )^2 (g+h x) \left (a+b x+c x^2\right ) \, dx\)

\(\Big \downarrow \) 2017

\(\displaystyle \int \left (f x^2+d\right )^2 \left ((g+h x) \left (c x^2+b x+a\right )-(b g+a h) x\right )dx+\frac {\left (d+f x^2\right )^3 (a h+b g)}{6 f}\)

\(\Big \downarrow \) 2341

\(\displaystyle \int \left (c f^2 h x^7+f^2 (c g+b h) x^6+2 c d f h x^5+f (2 c d g+a f g+2 b d h) x^4+c d^2 h x^3+d (c d g+2 a f g+b d h) x^2+a d^2 g\right )dx+\frac {\left (d+f x^2\right )^3 (a h+b g)}{6 f}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{5} f x^5 (a f g+2 b d h+2 c d g)+\frac {1}{3} d x^3 (2 a f g+b d h+c d g)+\frac {\left (d+f x^2\right )^3 (a h+b g)}{6 f}+a d^2 g x+\frac {1}{7} f^2 x^7 (b h+c g)+\frac {1}{4} c d^2 h x^4+\frac {1}{3} c d f h x^6+\frac {1}{8} c f^2 h x^8\)

Input:

Int[(g + h*x)*(a + b*x + c*x^2)*(d + f*x^2)^2,x]
 

Output:

a*d^2*g*x + (d*(c*d*g + 2*a*f*g + b*d*h)*x^3)/3 + (c*d^2*h*x^4)/4 + (f*(2* 
c*d*g + a*f*g + 2*b*d*h)*x^5)/5 + (c*d*f*h*x^6)/3 + (f^2*(c*g + b*h)*x^7)/ 
7 + (c*f^2*h*x^8)/8 + ((b*g + a*h)*(d + f*x^2)^3)/(6*f)
 

Defintions of rubi rules used

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

rule 2017
Int[(Px_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[Coeff[Px, x, n - 
 1]*((a + b*x^n)^(p + 1)/(b*n*(p + 1))), x] + Int[(Px - Coeff[Px, x, n - 1] 
*x^(n - 1))*(a + b*x^n)^p, x] /; FreeQ[{a, b}, x] && PolyQ[Px, x] && IGtQ[p 
, 1] && IGtQ[n, 1] && NeQ[Coeff[Px, x, n - 1], 0] && NeQ[Px, Coeff[Px, x, n 
 - 1]*x^(n - 1)] &&  !MatchQ[Px, (Qx_.)*((c_) + (d_.)*x^(m_))^(q_) /; FreeQ 
[{c, d}, x] && PolyQ[Qx, x] && IGtQ[q, 1] && IGtQ[m, 1] && NeQ[Coeff[Qx*(a 
+ b*x^n)^p, x, m - 1], 0] && GtQ[m*q, n*p]]
 

rule 2341
Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq* 
(a + b*x^2)^p, x], x] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
 
Maple [A] (verified)

Time = 0.83 (sec) , antiderivative size = 141, normalized size of antiderivative = 0.98

method result size
default \(\frac {c \,f^{2} h \,x^{8}}{8}+\frac {f^{2} \left (b h +c g \right ) x^{7}}{7}+\frac {\left (\left (a h +b g \right ) f^{2}+2 h c d f \right ) x^{6}}{6}+\frac {\left (a g \,f^{2}+2 \left (b h +c g \right ) d f \right ) x^{5}}{5}+\frac {\left (2 \left (a h +b g \right ) d f +h c \,d^{2}\right ) x^{4}}{4}+\frac {\left (2 a g d f +\left (b h +c g \right ) d^{2}\right ) x^{3}}{3}+\frac {d^{2} \left (a h +b g \right ) x^{2}}{2}+a \,d^{2} g x\) \(141\)
norman \(\frac {c \,f^{2} h \,x^{8}}{8}+\left (\frac {1}{7} b \,f^{2} h +\frac {1}{7} f^{2} c g \right ) x^{7}+\left (\frac {1}{6} a \,f^{2} h +\frac {1}{6} b \,f^{2} g +\frac {1}{3} h c d f \right ) x^{6}+\left (\frac {1}{5} a g \,f^{2}+\frac {2}{5} b d f h +\frac {2}{5} c d f g \right ) x^{5}+\left (\frac {1}{2} a d f h +\frac {1}{2} b d f g +\frac {1}{4} h c \,d^{2}\right ) x^{4}+\left (\frac {2}{3} a g d f +\frac {1}{3} b \,d^{2} h +\frac {1}{3} c \,d^{2} g \right ) x^{3}+\left (\frac {1}{2} a \,d^{2} h +\frac {1}{2} b \,d^{2} g \right ) x^{2}+a \,d^{2} g x\) \(155\)
orering \(\frac {x \left (105 h c \,f^{2} x^{7}+120 b \,f^{2} h \,x^{6}+120 c \,f^{2} g \,x^{6}+140 a \,f^{2} h \,x^{5}+140 b \,f^{2} g \,x^{5}+280 c d f h \,x^{5}+168 a \,f^{2} g \,x^{4}+336 b d f h \,x^{4}+336 c d f g \,x^{4}+420 a d f h \,x^{3}+420 b d f g \,x^{3}+210 c \,d^{2} h \,x^{3}+560 a d f g \,x^{2}+280 b \,d^{2} h \,x^{2}+280 c \,d^{2} g \,x^{2}+420 a \,d^{2} h x +420 b \,d^{2} g x +840 a \,d^{2} g \right )}{840}\) \(172\)
gosper \(\frac {1}{8} c \,f^{2} h \,x^{8}+\frac {1}{7} x^{7} b \,f^{2} h +\frac {1}{7} x^{7} f^{2} c g +\frac {1}{6} x^{6} a \,f^{2} h +\frac {1}{6} x^{6} b \,f^{2} g +\frac {1}{3} x^{6} h c d f +\frac {1}{5} x^{5} a g \,f^{2}+\frac {2}{5} x^{5} b d f h +\frac {2}{5} x^{5} c d f g +\frac {1}{2} x^{4} a d f h +\frac {1}{2} x^{4} b d f g +\frac {1}{4} x^{4} h c \,d^{2}+\frac {2}{3} x^{3} a g d f +\frac {1}{3} x^{3} b \,d^{2} h +\frac {1}{3} x^{3} c \,d^{2} g +\frac {1}{2} x^{2} a \,d^{2} h +\frac {1}{2} x^{2} b \,d^{2} g +a \,d^{2} g x\) \(173\)
risch \(\frac {1}{8} c \,f^{2} h \,x^{8}+\frac {1}{7} x^{7} b \,f^{2} h +\frac {1}{7} x^{7} f^{2} c g +\frac {1}{6} x^{6} a \,f^{2} h +\frac {1}{6} x^{6} b \,f^{2} g +\frac {1}{3} x^{6} h c d f +\frac {1}{5} x^{5} a g \,f^{2}+\frac {2}{5} x^{5} b d f h +\frac {2}{5} x^{5} c d f g +\frac {1}{2} x^{4} a d f h +\frac {1}{2} x^{4} b d f g +\frac {1}{4} x^{4} h c \,d^{2}+\frac {2}{3} x^{3} a g d f +\frac {1}{3} x^{3} b \,d^{2} h +\frac {1}{3} x^{3} c \,d^{2} g +\frac {1}{2} x^{2} a \,d^{2} h +\frac {1}{2} x^{2} b \,d^{2} g +a \,d^{2} g x\) \(173\)
parallelrisch \(\frac {1}{8} c \,f^{2} h \,x^{8}+\frac {1}{7} x^{7} b \,f^{2} h +\frac {1}{7} x^{7} f^{2} c g +\frac {1}{6} x^{6} a \,f^{2} h +\frac {1}{6} x^{6} b \,f^{2} g +\frac {1}{3} x^{6} h c d f +\frac {1}{5} x^{5} a g \,f^{2}+\frac {2}{5} x^{5} b d f h +\frac {2}{5} x^{5} c d f g +\frac {1}{2} x^{4} a d f h +\frac {1}{2} x^{4} b d f g +\frac {1}{4} x^{4} h c \,d^{2}+\frac {2}{3} x^{3} a g d f +\frac {1}{3} x^{3} b \,d^{2} h +\frac {1}{3} x^{3} c \,d^{2} g +\frac {1}{2} x^{2} a \,d^{2} h +\frac {1}{2} x^{2} b \,d^{2} g +a \,d^{2} g x\) \(173\)

Input:

int((h*x+g)*(c*x^2+b*x+a)*(f*x^2+d)^2,x,method=_RETURNVERBOSE)
 

Output:

1/8*c*f^2*h*x^8+1/7*f^2*(b*h+c*g)*x^7+1/6*((a*h+b*g)*f^2+2*h*c*d*f)*x^6+1/ 
5*(a*g*f^2+2*(b*h+c*g)*d*f)*x^5+1/4*(2*(a*h+b*g)*d*f+h*c*d^2)*x^4+1/3*(2*a 
*g*d*f+(b*h+c*g)*d^2)*x^3+1/2*d^2*(a*h+b*g)*x^2+a*d^2*g*x
 

Fricas [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.07 \[ \int (g+h x) \left (a+b x+c x^2\right ) \left (d+f x^2\right )^2 \, dx=\frac {1}{8} \, c f^{2} h x^{8} + \frac {1}{7} \, {\left (c f^{2} g + b f^{2} h\right )} x^{7} + \frac {1}{6} \, {\left (b f^{2} g + {\left (2 \, c d f + a f^{2}\right )} h\right )} x^{6} + \frac {1}{5} \, {\left (2 \, b d f h + {\left (2 \, c d f + a f^{2}\right )} g\right )} x^{5} + a d^{2} g x + \frac {1}{4} \, {\left (2 \, b d f g + {\left (c d^{2} + 2 \, a d f\right )} h\right )} x^{4} + \frac {1}{3} \, {\left (b d^{2} h + {\left (c d^{2} + 2 \, a d f\right )} g\right )} x^{3} + \frac {1}{2} \, {\left (b d^{2} g + a d^{2} h\right )} x^{2} \] Input:

integrate((h*x+g)*(c*x^2+b*x+a)*(f*x^2+d)^2,x, algorithm="fricas")
 

Output:

1/8*c*f^2*h*x^8 + 1/7*(c*f^2*g + b*f^2*h)*x^7 + 1/6*(b*f^2*g + (2*c*d*f + 
a*f^2)*h)*x^6 + 1/5*(2*b*d*f*h + (2*c*d*f + a*f^2)*g)*x^5 + a*d^2*g*x + 1/ 
4*(2*b*d*f*g + (c*d^2 + 2*a*d*f)*h)*x^4 + 1/3*(b*d^2*h + (c*d^2 + 2*a*d*f) 
*g)*x^3 + 1/2*(b*d^2*g + a*d^2*h)*x^2
 

Sympy [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.25 \[ \int (g+h x) \left (a+b x+c x^2\right ) \left (d+f x^2\right )^2 \, dx=a d^{2} g x + \frac {c f^{2} h x^{8}}{8} + x^{7} \left (\frac {b f^{2} h}{7} + \frac {c f^{2} g}{7}\right ) + x^{6} \left (\frac {a f^{2} h}{6} + \frac {b f^{2} g}{6} + \frac {c d f h}{3}\right ) + x^{5} \left (\frac {a f^{2} g}{5} + \frac {2 b d f h}{5} + \frac {2 c d f g}{5}\right ) + x^{4} \left (\frac {a d f h}{2} + \frac {b d f g}{2} + \frac {c d^{2} h}{4}\right ) + x^{3} \cdot \left (\frac {2 a d f g}{3} + \frac {b d^{2} h}{3} + \frac {c d^{2} g}{3}\right ) + x^{2} \left (\frac {a d^{2} h}{2} + \frac {b d^{2} g}{2}\right ) \] Input:

integrate((h*x+g)*(c*x**2+b*x+a)*(f*x**2+d)**2,x)
 

Output:

a*d**2*g*x + c*f**2*h*x**8/8 + x**7*(b*f**2*h/7 + c*f**2*g/7) + x**6*(a*f* 
*2*h/6 + b*f**2*g/6 + c*d*f*h/3) + x**5*(a*f**2*g/5 + 2*b*d*f*h/5 + 2*c*d* 
f*g/5) + x**4*(a*d*f*h/2 + b*d*f*g/2 + c*d**2*h/4) + x**3*(2*a*d*f*g/3 + b 
*d**2*h/3 + c*d**2*g/3) + x**2*(a*d**2*h/2 + b*d**2*g/2)
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.07 \[ \int (g+h x) \left (a+b x+c x^2\right ) \left (d+f x^2\right )^2 \, dx=\frac {1}{8} \, c f^{2} h x^{8} + \frac {1}{7} \, {\left (c f^{2} g + b f^{2} h\right )} x^{7} + \frac {1}{6} \, {\left (b f^{2} g + {\left (2 \, c d f + a f^{2}\right )} h\right )} x^{6} + \frac {1}{5} \, {\left (2 \, b d f h + {\left (2 \, c d f + a f^{2}\right )} g\right )} x^{5} + a d^{2} g x + \frac {1}{4} \, {\left (2 \, b d f g + {\left (c d^{2} + 2 \, a d f\right )} h\right )} x^{4} + \frac {1}{3} \, {\left (b d^{2} h + {\left (c d^{2} + 2 \, a d f\right )} g\right )} x^{3} + \frac {1}{2} \, {\left (b d^{2} g + a d^{2} h\right )} x^{2} \] Input:

integrate((h*x+g)*(c*x^2+b*x+a)*(f*x^2+d)^2,x, algorithm="maxima")
 

Output:

1/8*c*f^2*h*x^8 + 1/7*(c*f^2*g + b*f^2*h)*x^7 + 1/6*(b*f^2*g + (2*c*d*f + 
a*f^2)*h)*x^6 + 1/5*(2*b*d*f*h + (2*c*d*f + a*f^2)*g)*x^5 + a*d^2*g*x + 1/ 
4*(2*b*d*f*g + (c*d^2 + 2*a*d*f)*h)*x^4 + 1/3*(b*d^2*h + (c*d^2 + 2*a*d*f) 
*g)*x^3 + 1/2*(b*d^2*g + a*d^2*h)*x^2
 

Giac [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.19 \[ \int (g+h x) \left (a+b x+c x^2\right ) \left (d+f x^2\right )^2 \, dx=\frac {1}{8} \, c f^{2} h x^{8} + \frac {1}{7} \, c f^{2} g x^{7} + \frac {1}{7} \, b f^{2} h x^{7} + \frac {1}{6} \, b f^{2} g x^{6} + \frac {1}{3} \, c d f h x^{6} + \frac {1}{6} \, a f^{2} h x^{6} + \frac {2}{5} \, c d f g x^{5} + \frac {1}{5} \, a f^{2} g x^{5} + \frac {2}{5} \, b d f h x^{5} + \frac {1}{2} \, b d f g x^{4} + \frac {1}{4} \, c d^{2} h x^{4} + \frac {1}{2} \, a d f h x^{4} + \frac {1}{3} \, c d^{2} g x^{3} + \frac {2}{3} \, a d f g x^{3} + \frac {1}{3} \, b d^{2} h x^{3} + \frac {1}{2} \, b d^{2} g x^{2} + \frac {1}{2} \, a d^{2} h x^{2} + a d^{2} g x \] Input:

integrate((h*x+g)*(c*x^2+b*x+a)*(f*x^2+d)^2,x, algorithm="giac")
 

Output:

1/8*c*f^2*h*x^8 + 1/7*c*f^2*g*x^7 + 1/7*b*f^2*h*x^7 + 1/6*b*f^2*g*x^6 + 1/ 
3*c*d*f*h*x^6 + 1/6*a*f^2*h*x^6 + 2/5*c*d*f*g*x^5 + 1/5*a*f^2*g*x^5 + 2/5* 
b*d*f*h*x^5 + 1/2*b*d*f*g*x^4 + 1/4*c*d^2*h*x^4 + 1/2*a*d*f*h*x^4 + 1/3*c* 
d^2*g*x^3 + 2/3*a*d*f*g*x^3 + 1/3*b*d^2*h*x^3 + 1/2*b*d^2*g*x^2 + 1/2*a*d^ 
2*h*x^2 + a*d^2*g*x
 

Mupad [B] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 140, normalized size of antiderivative = 0.97 \[ \int (g+h x) \left (a+b x+c x^2\right ) \left (d+f x^2\right )^2 \, dx=x^3\,\left (\frac {b\,d^2\,h}{3}+\frac {c\,d^2\,g}{3}+\frac {2\,a\,d\,f\,g}{3}\right )+x^6\,\left (\frac {a\,f^2\,h}{6}+\frac {b\,f^2\,g}{6}+\frac {c\,d\,f\,h}{3}\right )+\frac {f\,x^5\,\left (a\,f\,g+2\,b\,d\,h+2\,c\,d\,g\right )}{5}+\frac {d\,x^4\,\left (2\,a\,f\,h+2\,b\,f\,g+c\,d\,h\right )}{4}+\frac {d^2\,x^2\,\left (a\,h+b\,g\right )}{2}+\frac {f^2\,x^7\,\left (b\,h+c\,g\right )}{7}+a\,d^2\,g\,x+\frac {c\,f^2\,h\,x^8}{8} \] Input:

int((g + h*x)*(d + f*x^2)^2*(a + b*x + c*x^2),x)
 

Output:

x^3*((b*d^2*h)/3 + (c*d^2*g)/3 + (2*a*d*f*g)/3) + x^6*((a*f^2*h)/6 + (b*f^ 
2*g)/6 + (c*d*f*h)/3) + (f*x^5*(a*f*g + 2*b*d*h + 2*c*d*g))/5 + (d*x^4*(2* 
a*f*h + 2*b*f*g + c*d*h))/4 + (d^2*x^2*(a*h + b*g))/2 + (f^2*x^7*(b*h + c* 
g))/7 + a*d^2*g*x + (c*f^2*h*x^8)/8
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.19 \[ \int (g+h x) \left (a+b x+c x^2\right ) \left (d+f x^2\right )^2 \, dx=\frac {x \left (105 c \,f^{2} h \,x^{7}+120 b \,f^{2} h \,x^{6}+120 c \,f^{2} g \,x^{6}+140 a \,f^{2} h \,x^{5}+140 b \,f^{2} g \,x^{5}+280 c d f h \,x^{5}+168 a \,f^{2} g \,x^{4}+336 b d f h \,x^{4}+336 c d f g \,x^{4}+420 a d f h \,x^{3}+420 b d f g \,x^{3}+210 c \,d^{2} h \,x^{3}+560 a d f g \,x^{2}+280 b \,d^{2} h \,x^{2}+280 c \,d^{2} g \,x^{2}+420 a \,d^{2} h x +420 b \,d^{2} g x +840 a \,d^{2} g \right )}{840} \] Input:

int((h*x+g)*(c*x^2+b*x+a)*(f*x^2+d)^2,x)
 

Output:

(x*(840*a*d**2*g + 420*a*d**2*h*x + 560*a*d*f*g*x**2 + 420*a*d*f*h*x**3 + 
168*a*f**2*g*x**4 + 140*a*f**2*h*x**5 + 420*b*d**2*g*x + 280*b*d**2*h*x**2 
 + 420*b*d*f*g*x**3 + 336*b*d*f*h*x**4 + 140*b*f**2*g*x**5 + 120*b*f**2*h* 
x**6 + 280*c*d**2*g*x**2 + 210*c*d**2*h*x**3 + 336*c*d*f*g*x**4 + 280*c*d* 
f*h*x**5 + 120*c*f**2*g*x**6 + 105*c*f**2*h*x**7))/840