\(\int (a+b x)^2 (c+d x) \sqrt {e+f x} (g+h x) \, dx\) [2]

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

Optimal result

Integrand size = 27, antiderivative size = 247 \[ \int (a+b x)^2 (c+d x) \sqrt {e+f x} (g+h x) \, dx=-\frac {2 (b e-a f)^2 (d e-c f) (f g-e h) (e+f x)^{3/2}}{3 f^5}+\frac {2 (b e-a f) (b d e (3 f g-4 e h)-b c f (2 f g-3 e h)-a f (d f g-2 d e h+c f h)) (e+f x)^{5/2}}{5 f^5}+\frac {2 \left (a^2 d f^2 h+2 a b f (d f g-3 d e h+c f h)+b^2 (c f (f g-3 e h)-3 d e (f g-2 e h))\right ) (e+f x)^{7/2}}{7 f^5}+\frac {2 b (2 a d f h+b (d f g-4 d e h+c f h)) (e+f x)^{9/2}}{9 f^5}+\frac {2 b^2 d h (e+f x)^{11/2}}{11 f^5} \] Output:

-2/3*(-a*f+b*e)^2*(-c*f+d*e)*(-e*h+f*g)*(f*x+e)^(3/2)/f^5+2/5*(-a*f+b*e)*( 
b*d*e*(-4*e*h+3*f*g)-b*c*f*(-3*e*h+2*f*g)-a*f*(c*f*h-2*d*e*h+d*f*g))*(f*x+ 
e)^(5/2)/f^5+2/7*(a^2*d*f^2*h+2*a*b*f*(c*f*h-3*d*e*h+d*f*g)+b^2*(c*f*(-3*e 
*h+f*g)-3*d*e*(-2*e*h+f*g)))*(f*x+e)^(7/2)/f^5+2/9*b*(2*a*d*f*h+b*(c*f*h-4 
*d*e*h+d*f*g))*(f*x+e)^(9/2)/f^5+2/11*b^2*d*h*(f*x+e)^(11/2)/f^5
 

Mathematica [A] (verified)

Time = 0.25 (sec) , antiderivative size = 304, normalized size of antiderivative = 1.23 \[ \int (a+b x)^2 (c+d x) \sqrt {e+f x} (g+h x) \, dx=\frac {2 (e+f x)^{3/2} \left (33 a^2 f^2 \left (7 c f (5 f g-2 e h+3 f h x)+d \left (8 e^2 h+3 f^2 x (7 g+5 h x)-2 e f (7 g+6 h x)\right )\right )+22 a b f \left (3 c f \left (8 e^2 h+3 f^2 x (7 g+5 h x)-2 e f (7 g+6 h x)\right )+d \left (-16 e^3 h+24 e^2 f (g+h x)-6 e f^2 x (6 g+5 h x)+5 f^3 x^2 (9 g+7 h x)\right )\right )+b^2 \left (11 c f \left (-16 e^3 h+24 e^2 f (g+h x)-6 e f^2 x (6 g+5 h x)+5 f^3 x^2 (9 g+7 h x)\right )+d \left (128 e^4 h+35 f^4 x^3 (11 g+9 h x)+24 e^2 f^2 x (11 g+10 h x)-16 e^3 f (11 g+12 h x)-10 e f^3 x^2 (33 g+28 h x)\right )\right )\right )}{3465 f^5} \] Input:

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

Output:

(2*(e + f*x)^(3/2)*(33*a^2*f^2*(7*c*f*(5*f*g - 2*e*h + 3*f*h*x) + d*(8*e^2 
*h + 3*f^2*x*(7*g + 5*h*x) - 2*e*f*(7*g + 6*h*x))) + 22*a*b*f*(3*c*f*(8*e^ 
2*h + 3*f^2*x*(7*g + 5*h*x) - 2*e*f*(7*g + 6*h*x)) + d*(-16*e^3*h + 24*e^2 
*f*(g + h*x) - 6*e*f^2*x*(6*g + 5*h*x) + 5*f^3*x^2*(9*g + 7*h*x))) + b^2*( 
11*c*f*(-16*e^3*h + 24*e^2*f*(g + h*x) - 6*e*f^2*x*(6*g + 5*h*x) + 5*f^3*x 
^2*(9*g + 7*h*x)) + d*(128*e^4*h + 35*f^4*x^3*(11*g + 9*h*x) + 24*e^2*f^2* 
x*(11*g + 10*h*x) - 16*e^3*f*(11*g + 12*h*x) - 10*e*f^3*x^2*(33*g + 28*h*x 
)))))/(3465*f^5)
 

Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 247, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {159, 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 (a+b x)^2 (c+d x) \sqrt {e+f x} (g+h x) \, dx\)

\(\Big \downarrow \) 159

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {2 (e+f x)^{7/2} \left (a^2 d f^2 h+2 a b f (c f h-3 d e h+d f g)+b^2 (c f (f g-3 e h)-3 d e (f g-2 e h))\right )}{7 f^5}+\frac {2 b (e+f x)^{9/2} (2 a d f h+b (c f h-4 d e h+d f g))}{9 f^5}+\frac {2 (e+f x)^{5/2} (b e-a f) (-a f (c f h-2 d e h+d f g)-b c f (2 f g-3 e h)+b d e (3 f g-4 e h))}{5 f^5}-\frac {2 (e+f x)^{3/2} (b e-a f)^2 (d e-c f) (f g-e h)}{3 f^5}+\frac {2 b^2 d h (e+f x)^{11/2}}{11 f^5}\)

Input:

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

Output:

(-2*(b*e - a*f)^2*(d*e - c*f)*(f*g - e*h)*(e + f*x)^(3/2))/(3*f^5) + (2*(b 
*e - a*f)*(b*d*e*(3*f*g - 4*e*h) - b*c*f*(2*f*g - 3*e*h) - a*f*(d*f*g - 2* 
d*e*h + c*f*h))*(e + f*x)^(5/2))/(5*f^5) + (2*(a^2*d*f^2*h + 2*a*b*f*(d*f* 
g - 3*d*e*h + c*f*h) + b^2*(c*f*(f*g - 3*e*h) - 3*d*e*(f*g - 2*e*h)))*(e + 
 f*x)^(7/2))/(7*f^5) + (2*b*(2*a*d*f*h + b*(d*f*g - 4*d*e*h + c*f*h))*(e + 
 f*x)^(9/2))/(9*f^5) + (2*b^2*d*h*(e + f*x)^(11/2))/(11*f^5)
 

Defintions of rubi rules used

rule 159
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_) + (f_.)*(x_ 
))*((g_.) + (h_.)*(x_)), x_] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n 
*(e + f*x)*(g + h*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, h}, x] && (IGtQ 
[m, 0] || IntegersQ[m, n])
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 
Maple [A] (verified)

Time = 0.95 (sec) , antiderivative size = 255, normalized size of antiderivative = 1.03

method result size
derivativedivides \(\frac {\frac {2 d h \,b^{2} \left (f x +e \right )^{\frac {11}{2}}}{11}+\frac {2 \left (\left (2 b \left (a f -b e \right ) d +b^{2} \left (c f -d e \right )\right ) h +d \,b^{2} \left (-e h +f g \right )\right ) \left (f x +e \right )^{\frac {9}{2}}}{9}+\frac {2 \left (\left (\left (a f -b e \right )^{2} d +2 b \left (a f -b e \right ) \left (c f -d e \right )\right ) h +\left (2 b \left (a f -b e \right ) d +b^{2} \left (c f -d e \right )\right ) \left (-e h +f g \right )\right ) \left (f x +e \right )^{\frac {7}{2}}}{7}+\frac {2 \left (\left (a f -b e \right )^{2} \left (c f -d e \right ) h +\left (\left (a f -b e \right )^{2} d +2 b \left (a f -b e \right ) \left (c f -d e \right )\right ) \left (-e h +f g \right )\right ) \left (f x +e \right )^{\frac {5}{2}}}{5}+\frac {2 \left (a f -b e \right )^{2} \left (c f -d e \right ) \left (-e h +f g \right ) \left (f x +e \right )^{\frac {3}{2}}}{3}}{f^{5}}\) \(255\)
default \(\frac {\frac {2 d h \,b^{2} \left (f x +e \right )^{\frac {11}{2}}}{11}-\frac {2 \left (-\left (2 b \left (a f -b e \right ) d +b^{2} \left (c f -d e \right )\right ) h +d \,b^{2} \left (e h -f g \right )\right ) \left (f x +e \right )^{\frac {9}{2}}}{9}-\frac {2 \left (-\left (\left (a f -b e \right )^{2} d +2 b \left (a f -b e \right ) \left (c f -d e \right )\right ) h +\left (2 b \left (a f -b e \right ) d +b^{2} \left (c f -d e \right )\right ) \left (e h -f g \right )\right ) \left (f x +e \right )^{\frac {7}{2}}}{7}-\frac {2 \left (-\left (a f -b e \right )^{2} \left (c f -d e \right ) h +\left (\left (a f -b e \right )^{2} d +2 b \left (a f -b e \right ) \left (c f -d e \right )\right ) \left (e h -f g \right )\right ) \left (f x +e \right )^{\frac {5}{2}}}{5}-\frac {2 \left (a f -b e \right )^{2} \left (c f -d e \right ) \left (e h -f g \right ) \left (f x +e \right )^{\frac {3}{2}}}{3}}{f^{5}}\) \(258\)
pseudoelliptic \(-\frac {4 \left (f x +e \right )^{\frac {3}{2}} \left (\left (-\frac {15 x^{2} \left (\frac {7 d h \,x^{2}}{11}+\frac {7 \left (c h +d g \right ) x}{9}+c g \right ) b^{2}}{14}-3 a x \left (\frac {5 d h \,x^{2}}{9}+\frac {5 \left (c h +d g \right ) x}{7}+c g \right ) b -\frac {5 a^{2} \left (\frac {3 d h \,x^{2}}{7}+\frac {3 \left (c h +d g \right ) x}{5}+c g \right )}{2}\right ) f^{4}+e \left (\frac {6 x \left (\frac {70 d h \,x^{2}}{99}+\frac {5 \left (c h +d g \right ) x}{6}+c g \right ) b^{2}}{7}+2 a \left (\frac {5 d h \,x^{2}}{7}+\frac {6 \left (c h +d g \right ) x}{7}+c g \right ) b +a^{2} \left (c h +d g +\frac {6}{7} d h x \right )\right ) f^{3}-\frac {4 \left (\left (\frac {10 d h \,x^{2}}{11}+\left (c h +d g \right ) x +c g \right ) b^{2}+2 a \left (d h x +c h +d g \right ) b +a^{2} d h \right ) e^{2} f^{2}}{7}+\frac {16 \left (\left (\frac {6}{11} d h x +\frac {1}{2} c h +\frac {1}{2} d g \right ) b +a d h \right ) b \,e^{3} f}{21}-\frac {64 b^{2} d \,e^{4} h}{231}\right )}{15 f^{5}}\) \(266\)
gosper \(-\frac {2 \left (f x +e \right )^{\frac {3}{2}} \left (-315 d h \,b^{2} x^{4} f^{4}-770 a b d \,f^{4} h \,x^{3}-385 b^{2} c \,f^{4} h \,x^{3}+280 b^{2} d e \,f^{3} h \,x^{3}-385 b^{2} d \,f^{4} g \,x^{3}-495 a^{2} d \,f^{4} h \,x^{2}-990 a b c \,f^{4} h \,x^{2}+660 a b d e \,f^{3} h \,x^{2}-990 a b d \,f^{4} g \,x^{2}+330 b^{2} c e \,f^{3} h \,x^{2}-495 b^{2} c \,f^{4} g \,x^{2}-240 b^{2} d \,e^{2} f^{2} h \,x^{2}+330 b^{2} d e \,f^{3} g \,x^{2}-693 a^{2} c \,f^{4} h x +396 a^{2} d e \,f^{3} h x -693 a^{2} d \,f^{4} g x +792 a b c e \,f^{3} h x -1386 a b c \,f^{4} g x -528 a b d \,e^{2} f^{2} h x +792 a b d e \,f^{3} g x -264 b^{2} c \,e^{2} f^{2} h x +396 b^{2} c e \,f^{3} g x +192 b^{2} d \,e^{3} f h x -264 b^{2} d \,e^{2} f^{2} g x +462 a^{2} c e \,f^{3} h -1155 c g \,a^{2} f^{4}-264 a^{2} d \,e^{2} f^{2} h +462 a^{2} d e \,f^{3} g -528 a b c \,e^{2} f^{2} h +924 a b c e \,f^{3} g +352 a b d \,e^{3} f h -528 a b d \,e^{2} f^{2} g +176 b^{2} c \,e^{3} f h -264 b^{2} c \,e^{2} f^{2} g -128 b^{2} d \,e^{4} h +176 b^{2} d \,e^{3} f g \right )}{3465 f^{5}}\) \(451\)
orering \(-\frac {2 \left (f x +e \right )^{\frac {3}{2}} \left (-315 d h \,b^{2} x^{4} f^{4}-770 a b d \,f^{4} h \,x^{3}-385 b^{2} c \,f^{4} h \,x^{3}+280 b^{2} d e \,f^{3} h \,x^{3}-385 b^{2} d \,f^{4} g \,x^{3}-495 a^{2} d \,f^{4} h \,x^{2}-990 a b c \,f^{4} h \,x^{2}+660 a b d e \,f^{3} h \,x^{2}-990 a b d \,f^{4} g \,x^{2}+330 b^{2} c e \,f^{3} h \,x^{2}-495 b^{2} c \,f^{4} g \,x^{2}-240 b^{2} d \,e^{2} f^{2} h \,x^{2}+330 b^{2} d e \,f^{3} g \,x^{2}-693 a^{2} c \,f^{4} h x +396 a^{2} d e \,f^{3} h x -693 a^{2} d \,f^{4} g x +792 a b c e \,f^{3} h x -1386 a b c \,f^{4} g x -528 a b d \,e^{2} f^{2} h x +792 a b d e \,f^{3} g x -264 b^{2} c \,e^{2} f^{2} h x +396 b^{2} c e \,f^{3} g x +192 b^{2} d \,e^{3} f h x -264 b^{2} d \,e^{2} f^{2} g x +462 a^{2} c e \,f^{3} h -1155 c g \,a^{2} f^{4}-264 a^{2} d \,e^{2} f^{2} h +462 a^{2} d e \,f^{3} g -528 a b c \,e^{2} f^{2} h +924 a b c e \,f^{3} g +352 a b d \,e^{3} f h -528 a b d \,e^{2} f^{2} g +176 b^{2} c \,e^{3} f h -264 b^{2} c \,e^{2} f^{2} g -128 b^{2} d \,e^{4} h +176 b^{2} d \,e^{3} f g \right )}{3465 f^{5}}\) \(451\)
trager \(-\frac {2 \left (-315 d h \,b^{2} f^{5} x^{5}-770 a b d \,f^{5} h \,x^{4}-385 b^{2} c \,f^{5} h \,x^{4}-35 b^{2} d e \,f^{4} h \,x^{4}-385 b^{2} d \,f^{5} g \,x^{4}-495 a^{2} d \,f^{5} h \,x^{3}-990 a b c \,f^{5} h \,x^{3}-110 a b d e \,f^{4} h \,x^{3}-990 a b d \,f^{5} g \,x^{3}-55 b^{2} c e \,f^{4} h \,x^{3}-495 b^{2} c \,f^{5} g \,x^{3}+40 b^{2} d \,e^{2} f^{3} h \,x^{3}-55 b^{2} d e \,f^{4} g \,x^{3}-693 a^{2} c \,f^{5} h \,x^{2}-99 a^{2} d e \,f^{4} h \,x^{2}-693 a^{2} d \,f^{5} g \,x^{2}-198 a b c e \,f^{4} h \,x^{2}-1386 a b c \,f^{5} g \,x^{2}+132 a b d \,e^{2} f^{3} h \,x^{2}-198 a b d e \,f^{4} g \,x^{2}+66 b^{2} c \,e^{2} f^{3} h \,x^{2}-99 b^{2} c e \,f^{4} g \,x^{2}-48 b^{2} d \,e^{3} f^{2} h \,x^{2}+66 b^{2} d \,e^{2} f^{3} g \,x^{2}-231 a^{2} c e \,f^{4} h x -1155 a^{2} c \,f^{5} g x +132 a^{2} d \,e^{2} f^{3} h x -231 a^{2} d e \,f^{4} g x +264 a b c \,e^{2} f^{3} h x -462 a b c e \,f^{4} g x -176 a b d \,e^{3} f^{2} h x +264 a b d \,e^{2} f^{3} g x -88 b^{2} c \,e^{3} f^{2} h x +132 b^{2} c \,e^{2} f^{3} g x +64 b^{2} d \,e^{4} f h x -88 b^{2} d \,e^{3} f^{2} g x +462 a^{2} c \,e^{2} f^{3} h -1155 a^{2} c e \,f^{4} g -264 a^{2} d \,e^{3} f^{2} h +462 a^{2} d \,e^{2} f^{3} g -528 a b c \,e^{3} f^{2} h +924 a b c \,e^{2} f^{3} g +352 a b d \,e^{4} f h -528 a b d \,e^{3} f^{2} g +176 b^{2} c \,e^{4} f h -264 b^{2} c \,e^{3} f^{2} g -128 b^{2} d \,e^{5} h +176 b^{2} d \,e^{4} f g \right ) \sqrt {f x +e}}{3465 f^{5}}\) \(635\)
risch \(-\frac {2 \left (-315 d h \,b^{2} f^{5} x^{5}-770 a b d \,f^{5} h \,x^{4}-385 b^{2} c \,f^{5} h \,x^{4}-35 b^{2} d e \,f^{4} h \,x^{4}-385 b^{2} d \,f^{5} g \,x^{4}-495 a^{2} d \,f^{5} h \,x^{3}-990 a b c \,f^{5} h \,x^{3}-110 a b d e \,f^{4} h \,x^{3}-990 a b d \,f^{5} g \,x^{3}-55 b^{2} c e \,f^{4} h \,x^{3}-495 b^{2} c \,f^{5} g \,x^{3}+40 b^{2} d \,e^{2} f^{3} h \,x^{3}-55 b^{2} d e \,f^{4} g \,x^{3}-693 a^{2} c \,f^{5} h \,x^{2}-99 a^{2} d e \,f^{4} h \,x^{2}-693 a^{2} d \,f^{5} g \,x^{2}-198 a b c e \,f^{4} h \,x^{2}-1386 a b c \,f^{5} g \,x^{2}+132 a b d \,e^{2} f^{3} h \,x^{2}-198 a b d e \,f^{4} g \,x^{2}+66 b^{2} c \,e^{2} f^{3} h \,x^{2}-99 b^{2} c e \,f^{4} g \,x^{2}-48 b^{2} d \,e^{3} f^{2} h \,x^{2}+66 b^{2} d \,e^{2} f^{3} g \,x^{2}-231 a^{2} c e \,f^{4} h x -1155 a^{2} c \,f^{5} g x +132 a^{2} d \,e^{2} f^{3} h x -231 a^{2} d e \,f^{4} g x +264 a b c \,e^{2} f^{3} h x -462 a b c e \,f^{4} g x -176 a b d \,e^{3} f^{2} h x +264 a b d \,e^{2} f^{3} g x -88 b^{2} c \,e^{3} f^{2} h x +132 b^{2} c \,e^{2} f^{3} g x +64 b^{2} d \,e^{4} f h x -88 b^{2} d \,e^{3} f^{2} g x +462 a^{2} c \,e^{2} f^{3} h -1155 a^{2} c e \,f^{4} g -264 a^{2} d \,e^{3} f^{2} h +462 a^{2} d \,e^{2} f^{3} g -528 a b c \,e^{3} f^{2} h +924 a b c \,e^{2} f^{3} g +352 a b d \,e^{4} f h -528 a b d \,e^{3} f^{2} g +176 b^{2} c \,e^{4} f h -264 b^{2} c \,e^{3} f^{2} g -128 b^{2} d \,e^{5} h +176 b^{2} d \,e^{4} f g \right ) \sqrt {f x +e}}{3465 f^{5}}\) \(635\)

Input:

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

Output:

2/f^5*(1/11*d*h*b^2*(f*x+e)^(11/2)+1/9*((2*b*(a*f-b*e)*d+b^2*(c*f-d*e))*h+ 
d*b^2*(-e*h+f*g))*(f*x+e)^(9/2)+1/7*(((a*f-b*e)^2*d+2*b*(a*f-b*e)*(c*f-d*e 
))*h+(2*b*(a*f-b*e)*d+b^2*(c*f-d*e))*(-e*h+f*g))*(f*x+e)^(7/2)+1/5*((a*f-b 
*e)^2*(c*f-d*e)*h+((a*f-b*e)^2*d+2*b*(a*f-b*e)*(c*f-d*e))*(-e*h+f*g))*(f*x 
+e)^(5/2)+1/3*(a*f-b*e)^2*(c*f-d*e)*(-e*h+f*g)*(f*x+e)^(3/2))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 519 vs. \(2 (229) = 458\).

Time = 0.07 (sec) , antiderivative size = 519, normalized size of antiderivative = 2.10 \[ \int (a+b x)^2 (c+d x) \sqrt {e+f x} (g+h x) \, dx=\frac {2 \, {\left (315 \, b^{2} d f^{5} h x^{5} + 35 \, {\left (11 \, b^{2} d f^{5} g + {\left (b^{2} d e f^{4} + 11 \, {\left (b^{2} c + 2 \, a b d\right )} f^{5}\right )} h\right )} x^{4} + 5 \, {\left (11 \, {\left (b^{2} d e f^{4} + 9 \, {\left (b^{2} c + 2 \, a b d\right )} f^{5}\right )} g - {\left (8 \, b^{2} d e^{2} f^{3} - 11 \, {\left (b^{2} c + 2 \, a b d\right )} e f^{4} - 99 \, {\left (2 \, a b c + a^{2} d\right )} f^{5}\right )} h\right )} x^{3} - 3 \, {\left (11 \, {\left (2 \, b^{2} d e^{2} f^{3} - 3 \, {\left (b^{2} c + 2 \, a b d\right )} e f^{4} - 21 \, {\left (2 \, a b c + a^{2} d\right )} f^{5}\right )} g - {\left (16 \, b^{2} d e^{3} f^{2} + 231 \, a^{2} c f^{5} - 22 \, {\left (b^{2} c + 2 \, a b d\right )} e^{2} f^{3} + 33 \, {\left (2 \, a b c + a^{2} d\right )} e f^{4}\right )} h\right )} x^{2} - 11 \, {\left (16 \, b^{2} d e^{4} f - 105 \, a^{2} c e f^{4} - 24 \, {\left (b^{2} c + 2 \, a b d\right )} e^{3} f^{2} + 42 \, {\left (2 \, a b c + a^{2} d\right )} e^{2} f^{3}\right )} g + 2 \, {\left (64 \, b^{2} d e^{5} - 231 \, a^{2} c e^{2} f^{3} - 88 \, {\left (b^{2} c + 2 \, a b d\right )} e^{4} f + 132 \, {\left (2 \, a b c + a^{2} d\right )} e^{3} f^{2}\right )} h + {\left (11 \, {\left (8 \, b^{2} d e^{3} f^{2} + 105 \, a^{2} c f^{5} - 12 \, {\left (b^{2} c + 2 \, a b d\right )} e^{2} f^{3} + 21 \, {\left (2 \, a b c + a^{2} d\right )} e f^{4}\right )} g - {\left (64 \, b^{2} d e^{4} f - 231 \, a^{2} c e f^{4} - 88 \, {\left (b^{2} c + 2 \, a b d\right )} e^{3} f^{2} + 132 \, {\left (2 \, a b c + a^{2} d\right )} e^{2} f^{3}\right )} h\right )} x\right )} \sqrt {f x + e}}{3465 \, f^{5}} \] Input:

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

Output:

2/3465*(315*b^2*d*f^5*h*x^5 + 35*(11*b^2*d*f^5*g + (b^2*d*e*f^4 + 11*(b^2* 
c + 2*a*b*d)*f^5)*h)*x^4 + 5*(11*(b^2*d*e*f^4 + 9*(b^2*c + 2*a*b*d)*f^5)*g 
 - (8*b^2*d*e^2*f^3 - 11*(b^2*c + 2*a*b*d)*e*f^4 - 99*(2*a*b*c + a^2*d)*f^ 
5)*h)*x^3 - 3*(11*(2*b^2*d*e^2*f^3 - 3*(b^2*c + 2*a*b*d)*e*f^4 - 21*(2*a*b 
*c + a^2*d)*f^5)*g - (16*b^2*d*e^3*f^2 + 231*a^2*c*f^5 - 22*(b^2*c + 2*a*b 
*d)*e^2*f^3 + 33*(2*a*b*c + a^2*d)*e*f^4)*h)*x^2 - 11*(16*b^2*d*e^4*f - 10 
5*a^2*c*e*f^4 - 24*(b^2*c + 2*a*b*d)*e^3*f^2 + 42*(2*a*b*c + a^2*d)*e^2*f^ 
3)*g + 2*(64*b^2*d*e^5 - 231*a^2*c*e^2*f^3 - 88*(b^2*c + 2*a*b*d)*e^4*f + 
132*(2*a*b*c + a^2*d)*e^3*f^2)*h + (11*(8*b^2*d*e^3*f^2 + 105*a^2*c*f^5 - 
12*(b^2*c + 2*a*b*d)*e^2*f^3 + 21*(2*a*b*c + a^2*d)*e*f^4)*g - (64*b^2*d*e 
^4*f - 231*a^2*c*e*f^4 - 88*(b^2*c + 2*a*b*d)*e^3*f^2 + 132*(2*a*b*c + a^2 
*d)*e^2*f^3)*h)*x)*sqrt(f*x + e)/f^5
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 620 vs. \(2 (262) = 524\).

Time = 1.52 (sec) , antiderivative size = 620, normalized size of antiderivative = 2.51 \[ \int (a+b x)^2 (c+d x) \sqrt {e+f x} (g+h x) \, dx=\begin {cases} \frac {2 \left (\frac {b^{2} d h \left (e + f x\right )^{\frac {11}{2}}}{11 f^{4}} + \frac {\left (e + f x\right )^{\frac {9}{2}} \cdot \left (2 a b d f h + b^{2} c f h - 4 b^{2} d e h + b^{2} d f g\right )}{9 f^{4}} + \frac {\left (e + f x\right )^{\frac {7}{2}} \left (a^{2} d f^{2} h + 2 a b c f^{2} h - 6 a b d e f h + 2 a b d f^{2} g - 3 b^{2} c e f h + b^{2} c f^{2} g + 6 b^{2} d e^{2} h - 3 b^{2} d e f g\right )}{7 f^{4}} + \frac {\left (e + f x\right )^{\frac {5}{2}} \left (a^{2} c f^{3} h - 2 a^{2} d e f^{2} h + a^{2} d f^{3} g - 4 a b c e f^{2} h + 2 a b c f^{3} g + 6 a b d e^{2} f h - 4 a b d e f^{2} g + 3 b^{2} c e^{2} f h - 2 b^{2} c e f^{2} g - 4 b^{2} d e^{3} h + 3 b^{2} d e^{2} f g\right )}{5 f^{4}} + \frac {\left (e + f x\right )^{\frac {3}{2}} \left (- a^{2} c e f^{3} h + a^{2} c f^{4} g + a^{2} d e^{2} f^{2} h - a^{2} d e f^{3} g + 2 a b c e^{2} f^{2} h - 2 a b c e f^{3} g - 2 a b d e^{3} f h + 2 a b d e^{2} f^{2} g - b^{2} c e^{3} f h + b^{2} c e^{2} f^{2} g + b^{2} d e^{4} h - b^{2} d e^{3} f g\right )}{3 f^{4}}\right )}{f} & \text {for}\: f \neq 0 \\\sqrt {e} \left (a^{2} c g x + \frac {b^{2} d h x^{5}}{5} + \frac {x^{4} \cdot \left (2 a b d h + b^{2} c h + b^{2} d g\right )}{4} + \frac {x^{3} \left (a^{2} d h + 2 a b c h + 2 a b d g + b^{2} c g\right )}{3} + \frac {x^{2} \left (a^{2} c h + a^{2} d g + 2 a b c g\right )}{2}\right ) & \text {otherwise} \end {cases} \] Input:

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

Output:

Piecewise((2*(b**2*d*h*(e + f*x)**(11/2)/(11*f**4) + (e + f*x)**(9/2)*(2*a 
*b*d*f*h + b**2*c*f*h - 4*b**2*d*e*h + b**2*d*f*g)/(9*f**4) + (e + f*x)**( 
7/2)*(a**2*d*f**2*h + 2*a*b*c*f**2*h - 6*a*b*d*e*f*h + 2*a*b*d*f**2*g - 3* 
b**2*c*e*f*h + b**2*c*f**2*g + 6*b**2*d*e**2*h - 3*b**2*d*e*f*g)/(7*f**4) 
+ (e + f*x)**(5/2)*(a**2*c*f**3*h - 2*a**2*d*e*f**2*h + a**2*d*f**3*g - 4* 
a*b*c*e*f**2*h + 2*a*b*c*f**3*g + 6*a*b*d*e**2*f*h - 4*a*b*d*e*f**2*g + 3* 
b**2*c*e**2*f*h - 2*b**2*c*e*f**2*g - 4*b**2*d*e**3*h + 3*b**2*d*e**2*f*g) 
/(5*f**4) + (e + f*x)**(3/2)*(-a**2*c*e*f**3*h + a**2*c*f**4*g + a**2*d*e* 
*2*f**2*h - a**2*d*e*f**3*g + 2*a*b*c*e**2*f**2*h - 2*a*b*c*e*f**3*g - 2*a 
*b*d*e**3*f*h + 2*a*b*d*e**2*f**2*g - b**2*c*e**3*f*h + b**2*c*e**2*f**2*g 
 + b**2*d*e**4*h - b**2*d*e**3*f*g)/(3*f**4))/f, Ne(f, 0)), (sqrt(e)*(a**2 
*c*g*x + b**2*d*h*x**5/5 + x**4*(2*a*b*d*h + b**2*c*h + b**2*d*g)/4 + x**3 
*(a**2*d*h + 2*a*b*c*h + 2*a*b*d*g + b**2*c*g)/3 + x**2*(a**2*c*h + a**2*d 
*g + 2*a*b*c*g)/2), True))
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 376, normalized size of antiderivative = 1.52 \[ \int (a+b x)^2 (c+d x) \sqrt {e+f x} (g+h x) \, dx=\frac {2 \, {\left (315 \, {\left (f x + e\right )}^{\frac {11}{2}} b^{2} d h + 385 \, {\left (b^{2} d f g - {\left (4 \, b^{2} d e - {\left (b^{2} c + 2 \, a b d\right )} f\right )} h\right )} {\left (f x + e\right )}^{\frac {9}{2}} - 495 \, {\left ({\left (3 \, b^{2} d e f - {\left (b^{2} c + 2 \, a b d\right )} f^{2}\right )} g - {\left (6 \, b^{2} d e^{2} - 3 \, {\left (b^{2} c + 2 \, a b d\right )} e f + {\left (2 \, a b c + a^{2} d\right )} f^{2}\right )} h\right )} {\left (f x + e\right )}^{\frac {7}{2}} + 693 \, {\left ({\left (3 \, b^{2} d e^{2} f - 2 \, {\left (b^{2} c + 2 \, a b d\right )} e f^{2} + {\left (2 \, a b c + a^{2} d\right )} f^{3}\right )} g - {\left (4 \, b^{2} d e^{3} - a^{2} c f^{3} - 3 \, {\left (b^{2} c + 2 \, a b d\right )} e^{2} f + 2 \, {\left (2 \, a b c + a^{2} d\right )} e f^{2}\right )} h\right )} {\left (f x + e\right )}^{\frac {5}{2}} - 1155 \, {\left ({\left (b^{2} d e^{3} f - a^{2} c f^{4} - {\left (b^{2} c + 2 \, a b d\right )} e^{2} f^{2} + {\left (2 \, a b c + a^{2} d\right )} e f^{3}\right )} g - {\left (b^{2} d e^{4} - a^{2} c e f^{3} - {\left (b^{2} c + 2 \, a b d\right )} e^{3} f + {\left (2 \, a b c + a^{2} d\right )} e^{2} f^{2}\right )} h\right )} {\left (f x + e\right )}^{\frac {3}{2}}\right )}}{3465 \, f^{5}} \] Input:

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

Output:

2/3465*(315*(f*x + e)^(11/2)*b^2*d*h + 385*(b^2*d*f*g - (4*b^2*d*e - (b^2* 
c + 2*a*b*d)*f)*h)*(f*x + e)^(9/2) - 495*((3*b^2*d*e*f - (b^2*c + 2*a*b*d) 
*f^2)*g - (6*b^2*d*e^2 - 3*(b^2*c + 2*a*b*d)*e*f + (2*a*b*c + a^2*d)*f^2)* 
h)*(f*x + e)^(7/2) + 693*((3*b^2*d*e^2*f - 2*(b^2*c + 2*a*b*d)*e*f^2 + (2* 
a*b*c + a^2*d)*f^3)*g - (4*b^2*d*e^3 - a^2*c*f^3 - 3*(b^2*c + 2*a*b*d)*e^2 
*f + 2*(2*a*b*c + a^2*d)*e*f^2)*h)*(f*x + e)^(5/2) - 1155*((b^2*d*e^3*f - 
a^2*c*f^4 - (b^2*c + 2*a*b*d)*e^2*f^2 + (2*a*b*c + a^2*d)*e*f^3)*g - (b^2* 
d*e^4 - a^2*c*e*f^3 - (b^2*c + 2*a*b*d)*e^3*f + (2*a*b*c + a^2*d)*e^2*f^2) 
*h)*(f*x + e)^(3/2))/f^5
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1147 vs. \(2 (229) = 458\).

Time = 0.13 (sec) , antiderivative size = 1147, normalized size of antiderivative = 4.64 \[ \int (a+b x)^2 (c+d x) \sqrt {e+f x} (g+h x) \, dx=\text {Too large to display} \] Input:

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

Output:

2/3465*(3465*sqrt(f*x + e)*a^2*c*e*g + 1155*((f*x + e)^(3/2) - 3*sqrt(f*x 
+ e)*e)*a^2*c*g + 2310*((f*x + e)^(3/2) - 3*sqrt(f*x + e)*e)*a*b*c*e*g/f + 
 1155*((f*x + e)^(3/2) - 3*sqrt(f*x + e)*e)*a^2*d*e*g/f + 1155*((f*x + e)^ 
(3/2) - 3*sqrt(f*x + e)*e)*a^2*c*e*h/f + 231*(3*(f*x + e)^(5/2) - 10*(f*x 
+ e)^(3/2)*e + 15*sqrt(f*x + e)*e^2)*b^2*c*e*g/f^2 + 462*(3*(f*x + e)^(5/2 
) - 10*(f*x + e)^(3/2)*e + 15*sqrt(f*x + e)*e^2)*a*b*d*e*g/f^2 + 462*(3*(f 
*x + e)^(5/2) - 10*(f*x + e)^(3/2)*e + 15*sqrt(f*x + e)*e^2)*a*b*c*g/f + 2 
31*(3*(f*x + e)^(5/2) - 10*(f*x + e)^(3/2)*e + 15*sqrt(f*x + e)*e^2)*a^2*d 
*g/f + 462*(3*(f*x + e)^(5/2) - 10*(f*x + e)^(3/2)*e + 15*sqrt(f*x + e)*e^ 
2)*a*b*c*e*h/f^2 + 231*(3*(f*x + e)^(5/2) - 10*(f*x + e)^(3/2)*e + 15*sqrt 
(f*x + e)*e^2)*a^2*d*e*h/f^2 + 231*(3*(f*x + e)^(5/2) - 10*(f*x + e)^(3/2) 
*e + 15*sqrt(f*x + e)*e^2)*a^2*c*h/f + 99*(5*(f*x + e)^(7/2) - 21*(f*x + e 
)^(5/2)*e + 35*(f*x + e)^(3/2)*e^2 - 35*sqrt(f*x + e)*e^3)*b^2*d*e*g/f^3 + 
 99*(5*(f*x + e)^(7/2) - 21*(f*x + e)^(5/2)*e + 35*(f*x + e)^(3/2)*e^2 - 3 
5*sqrt(f*x + e)*e^3)*b^2*c*g/f^2 + 198*(5*(f*x + e)^(7/2) - 21*(f*x + e)^( 
5/2)*e + 35*(f*x + e)^(3/2)*e^2 - 35*sqrt(f*x + e)*e^3)*a*b*d*g/f^2 + 99*( 
5*(f*x + e)^(7/2) - 21*(f*x + e)^(5/2)*e + 35*(f*x + e)^(3/2)*e^2 - 35*sqr 
t(f*x + e)*e^3)*b^2*c*e*h/f^3 + 198*(5*(f*x + e)^(7/2) - 21*(f*x + e)^(5/2 
)*e + 35*(f*x + e)^(3/2)*e^2 - 35*sqrt(f*x + e)*e^3)*a*b*d*e*h/f^3 + 198*( 
5*(f*x + e)^(7/2) - 21*(f*x + e)^(5/2)*e + 35*(f*x + e)^(3/2)*e^2 - 35*...
 

Mupad [B] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 259, normalized size of antiderivative = 1.05 \[ \int (a+b x)^2 (c+d x) \sqrt {e+f x} (g+h x) \, dx=\frac {{\left (e+f\,x\right )}^{9/2}\,\left (2\,b^2\,c\,f\,h-8\,b^2\,d\,e\,h+2\,b^2\,d\,f\,g+4\,a\,b\,d\,f\,h\right )}{9\,f^5}+\frac {{\left (e+f\,x\right )}^{7/2}\,\left (2\,b^2\,c\,f^2\,g+2\,a^2\,d\,f^2\,h+12\,b^2\,d\,e^2\,h+4\,a\,b\,c\,f^2\,h+4\,a\,b\,d\,f^2\,g-6\,b^2\,c\,e\,f\,h-6\,b^2\,d\,e\,f\,g-12\,a\,b\,d\,e\,f\,h\right )}{7\,f^5}+\frac {2\,{\left (e+f\,x\right )}^{5/2}\,\left (a\,f-b\,e\right )\,\left (a\,c\,f^2\,h+a\,d\,f^2\,g+2\,b\,c\,f^2\,g+4\,b\,d\,e^2\,h-2\,a\,d\,e\,f\,h-3\,b\,c\,e\,f\,h-3\,b\,d\,e\,f\,g\right )}{5\,f^5}+\frac {2\,b^2\,d\,h\,{\left (e+f\,x\right )}^{11/2}}{11\,f^5}-\frac {2\,{\left (e+f\,x\right )}^{3/2}\,{\left (a\,f-b\,e\right )}^2\,\left (c\,f-d\,e\right )\,\left (e\,h-f\,g\right )}{3\,f^5} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 633, normalized size of antiderivative = 2.56 \[ \int (a+b x)^2 (c+d x) \sqrt {e+f x} (g+h x) \, dx=\frac {2 \sqrt {f x +e}\, \left (315 b^{2} d \,f^{5} h \,x^{5}+770 a b d \,f^{5} h \,x^{4}+385 b^{2} c \,f^{5} h \,x^{4}+35 b^{2} d e \,f^{4} h \,x^{4}+385 b^{2} d \,f^{5} g \,x^{4}+495 a^{2} d \,f^{5} h \,x^{3}+990 a b c \,f^{5} h \,x^{3}+110 a b d e \,f^{4} h \,x^{3}+990 a b d \,f^{5} g \,x^{3}+55 b^{2} c e \,f^{4} h \,x^{3}+495 b^{2} c \,f^{5} g \,x^{3}-40 b^{2} d \,e^{2} f^{3} h \,x^{3}+55 b^{2} d e \,f^{4} g \,x^{3}+693 a^{2} c \,f^{5} h \,x^{2}+99 a^{2} d e \,f^{4} h \,x^{2}+693 a^{2} d \,f^{5} g \,x^{2}+198 a b c e \,f^{4} h \,x^{2}+1386 a b c \,f^{5} g \,x^{2}-132 a b d \,e^{2} f^{3} h \,x^{2}+198 a b d e \,f^{4} g \,x^{2}-66 b^{2} c \,e^{2} f^{3} h \,x^{2}+99 b^{2} c e \,f^{4} g \,x^{2}+48 b^{2} d \,e^{3} f^{2} h \,x^{2}-66 b^{2} d \,e^{2} f^{3} g \,x^{2}+231 a^{2} c e \,f^{4} h x +1155 a^{2} c \,f^{5} g x -132 a^{2} d \,e^{2} f^{3} h x +231 a^{2} d e \,f^{4} g x -264 a b c \,e^{2} f^{3} h x +462 a b c e \,f^{4} g x +176 a b d \,e^{3} f^{2} h x -264 a b d \,e^{2} f^{3} g x +88 b^{2} c \,e^{3} f^{2} h x -132 b^{2} c \,e^{2} f^{3} g x -64 b^{2} d \,e^{4} f h x +88 b^{2} d \,e^{3} f^{2} g x -462 a^{2} c \,e^{2} f^{3} h +1155 a^{2} c e \,f^{4} g +264 a^{2} d \,e^{3} f^{2} h -462 a^{2} d \,e^{2} f^{3} g +528 a b c \,e^{3} f^{2} h -924 a b c \,e^{2} f^{3} g -352 a b d \,e^{4} f h +528 a b d \,e^{3} f^{2} g -176 b^{2} c \,e^{4} f h +264 b^{2} c \,e^{3} f^{2} g +128 b^{2} d \,e^{5} h -176 b^{2} d \,e^{4} f g \right )}{3465 f^{5}} \] Input:

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

Output:

(2*sqrt(e + f*x)*( - 462*a**2*c*e**2*f**3*h + 1155*a**2*c*e*f**4*g + 231*a 
**2*c*e*f**4*h*x + 1155*a**2*c*f**5*g*x + 693*a**2*c*f**5*h*x**2 + 264*a** 
2*d*e**3*f**2*h - 462*a**2*d*e**2*f**3*g - 132*a**2*d*e**2*f**3*h*x + 231* 
a**2*d*e*f**4*g*x + 99*a**2*d*e*f**4*h*x**2 + 693*a**2*d*f**5*g*x**2 + 495 
*a**2*d*f**5*h*x**3 + 528*a*b*c*e**3*f**2*h - 924*a*b*c*e**2*f**3*g - 264* 
a*b*c*e**2*f**3*h*x + 462*a*b*c*e*f**4*g*x + 198*a*b*c*e*f**4*h*x**2 + 138 
6*a*b*c*f**5*g*x**2 + 990*a*b*c*f**5*h*x**3 - 352*a*b*d*e**4*f*h + 528*a*b 
*d*e**3*f**2*g + 176*a*b*d*e**3*f**2*h*x - 264*a*b*d*e**2*f**3*g*x - 132*a 
*b*d*e**2*f**3*h*x**2 + 198*a*b*d*e*f**4*g*x**2 + 110*a*b*d*e*f**4*h*x**3 
+ 990*a*b*d*f**5*g*x**3 + 770*a*b*d*f**5*h*x**4 - 176*b**2*c*e**4*f*h + 26 
4*b**2*c*e**3*f**2*g + 88*b**2*c*e**3*f**2*h*x - 132*b**2*c*e**2*f**3*g*x 
- 66*b**2*c*e**2*f**3*h*x**2 + 99*b**2*c*e*f**4*g*x**2 + 55*b**2*c*e*f**4* 
h*x**3 + 495*b**2*c*f**5*g*x**3 + 385*b**2*c*f**5*h*x**4 + 128*b**2*d*e**5 
*h - 176*b**2*d*e**4*f*g - 64*b**2*d*e**4*f*h*x + 88*b**2*d*e**3*f**2*g*x 
+ 48*b**2*d*e**3*f**2*h*x**2 - 66*b**2*d*e**2*f**3*g*x**2 - 40*b**2*d*e**2 
*f**3*h*x**3 + 55*b**2*d*e*f**4*g*x**3 + 35*b**2*d*e*f**4*h*x**4 + 385*b** 
2*d*f**5*g*x**4 + 315*b**2*d*f**5*h*x**5))/(3465*f**5)