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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (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 = 246 \[ \int \frac {(a+b x) (c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=-\frac {2 (b e-a f) (d e-c f)^2 (f g-e h) \sqrt {e+f x}}{f^5}+\frac {2 (d e-c f) (b d e (3 f g-4 e h)-b c f (f g-2 e h)-a f (2 d f g-3 d e h+c f h)) (e+f x)^{3/2}}{3 f^5}+\frac {2 \left (a d f (d f g-3 d e h+2 c f h)+b \left (c^2 f^2 h+2 c d f (f g-3 e h)-3 d^2 e (f g-2 e h)\right )\right ) (e+f x)^{5/2}}{5 f^5}+\frac {2 d (a d f h+b (d f g-4 d e h+2 c f h)) (e+f x)^{7/2}}{7 f^5}+\frac {2 b d^2 h (e+f x)^{9/2}}{9 f^5} \] Output:

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

Mathematica [A] (verified)

Time = 0.22 (sec) , antiderivative size = 311, normalized size of antiderivative = 1.26 \[ \int \frac {(a+b x) (c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 \sqrt {e+f x} \left (3 a f \left (35 c^2 f^2 (3 f g-2 e h+f h x)+14 c d f \left (8 e^2 h-2 e f (5 g+2 h x)+f^2 x (5 g+3 h x)\right )+d^2 \left (-48 e^3 h+8 e^2 f (7 g+3 h x)+3 f^3 x^2 (7 g+5 h x)-2 e f^2 x (14 g+9 h x)\right )\right )+b \left (21 c^2 f^2 \left (8 e^2 h-2 e f (5 g+2 h x)+f^2 x (5 g+3 h x)\right )+6 c d f \left (-48 e^3 h+8 e^2 f (7 g+3 h x)+3 f^3 x^2 (7 g+5 h x)-2 e f^2 x (14 g+9 h x)\right )+d^2 \left (128 e^4 h+24 e^2 f^2 x (3 g+2 h x)-16 e^3 f (9 g+4 h x)+5 f^4 x^3 (9 g+7 h x)-2 e f^3 x^2 (27 g+20 h x)\right )\right )\right )}{315 f^5} \] Input:

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

Output:

(2*Sqrt[e + f*x]*(3*a*f*(35*c^2*f^2*(3*f*g - 2*e*h + f*h*x) + 14*c*d*f*(8* 
e^2*h - 2*e*f*(5*g + 2*h*x) + f^2*x*(5*g + 3*h*x)) + d^2*(-48*e^3*h + 8*e^ 
2*f*(7*g + 3*h*x) + 3*f^3*x^2*(7*g + 5*h*x) - 2*e*f^2*x*(14*g + 9*h*x))) + 
 b*(21*c^2*f^2*(8*e^2*h - 2*e*f*(5*g + 2*h*x) + f^2*x*(5*g + 3*h*x)) + 6*c 
*d*f*(-48*e^3*h + 8*e^2*f*(7*g + 3*h*x) + 3*f^3*x^2*(7*g + 5*h*x) - 2*e*f^ 
2*x*(14*g + 9*h*x)) + d^2*(128*e^4*h + 24*e^2*f^2*x*(3*g + 2*h*x) - 16*e^3 
*f*(9*g + 4*h*x) + 5*f^4*x^3*(9*g + 7*h*x) - 2*e*f^3*x^2*(27*g + 20*h*x))) 
))/(315*f^5)
 

Rubi [A] (verified)

Time = 0.48 (sec) , antiderivative size = 246, 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 \frac {(a+b x) (c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx\)

\(\Big \downarrow \) 159

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

(-2*(b*e - a*f)*(d*e - c*f)^2*(f*g - e*h)*Sqrt[e + f*x])/f^5 + (2*(d*e - c 
*f)*(b*d*e*(3*f*g - 4*e*h) - b*c*f*(f*g - 2*e*h) - a*f*(2*d*f*g - 3*d*e*h 
+ c*f*h))*(e + f*x)^(3/2))/(3*f^5) + (2*(a*d*f*(d*f*g - 3*d*e*h + 2*c*f*h) 
 + b*(c^2*f^2*h + 2*c*d*f*(f*g - 3*e*h) - 3*d^2*e*(f*g - 2*e*h)))*(e + f*x 
)^(5/2))/(5*f^5) + (2*d*(a*d*f*h + b*(d*f*g - 4*d*e*h + 2*c*f*h))*(e + f*x 
)^(7/2))/(7*f^5) + (2*b*d^2*h*(e + f*x)^(9/2))/(9*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.91 (sec) , antiderivative size = 254, normalized size of antiderivative = 1.03

method result size
derivativedivides \(\frac {\frac {2 h b \,d^{2} \left (f x +e \right )^{\frac {9}{2}}}{9}+\frac {2 \left (\left (\left (a f -b e \right ) d^{2}+2 b d \left (c f -d e \right )\right ) h +b \,d^{2} \left (-e h +f g \right )\right ) \left (f x +e \right )^{\frac {7}{2}}}{7}+\frac {2 \left (\left (2 \left (a f -b e \right ) d \left (c f -d e \right )+b \left (c f -d e \right )^{2}\right ) h +\left (\left (a f -b e \right ) d^{2}+2 b d \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 (\left (a f -b e \right ) \left (c f -d e \right )^{2} h +\left (2 \left (a f -b e \right ) d \left (c f -d e \right )+b \left (c f -d e \right )^{2}\right ) \left (-e h +f g \right )\right ) \left (f x +e \right )^{\frac {3}{2}}}{3}+2 \left (a f -b e \right ) \left (c f -d e \right )^{2} \left (-e h +f g \right ) \sqrt {f x +e}}{f^{5}}\) \(254\)
default \(\frac {\frac {2 h b \,d^{2} \left (f x +e \right )^{\frac {9}{2}}}{9}+\frac {2 \left (-\left (\left (-a f +b e \right ) d^{2}-2 b d \left (c f -d e \right )\right ) h -b \,d^{2} \left (e h -f g \right )\right ) \left (f x +e \right )^{\frac {7}{2}}}{7}+\frac {2 \left (-\left (2 \left (-a f +b e \right ) d \left (c f -d e \right )-b \left (c f -d e \right )^{2}\right ) h +\left (\left (-a f +b e \right ) d^{2}-2 b d \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 (-\left (-a f +b e \right ) \left (c f -d e \right )^{2} h +\left (2 \left (-a f +b e \right ) d \left (c f -d e \right )-b \left (c f -d e \right )^{2}\right ) \left (e h -f g \right )\right ) \left (f x +e \right )^{\frac {3}{2}}}{3}+2 \left (-a f +b e \right ) \left (c f -d e \right )^{2} \left (e h -f g \right ) \sqrt {f x +e}}{f^{5}}\) \(260\)
pseudoelliptic \(-\frac {4 \sqrt {f x +e}\, \left (\left (-\frac {3 x^{2} \left (\frac {5 b h \,x^{2}}{9}+\frac {5 \left (a h +b g \right ) x}{7}+g a \right ) d^{2}}{10}-x c \left (\frac {3 b h \,x^{2}}{7}+\frac {3 \left (a h +b g \right ) x}{5}+g a \right ) d -\frac {3 c^{2} \left (\frac {b h \,x^{2}}{5}+\frac {\left (a h +b g \right ) x}{3}+g a \right )}{2}\right ) f^{4}+e \left (\left (\frac {4 b h \,x^{3}}{21}+\frac {9 \left (a h +b g \right ) x^{2}}{35}+\frac {2 a g x}{5}\right ) d^{2}+2 c \left (\frac {9 b h \,x^{2}}{35}+\frac {2 \left (a h +b g \right ) x}{5}+g a \right ) d +c^{2} \left (a h +b g +\frac {2}{5} b h x \right )\right ) f^{3}-\frac {8 \left (\left (\frac {b h \,x^{2}}{7}+\frac {3 \left (a h +b g \right ) x}{14}+\frac {g a}{2}\right ) d^{2}+c \left (\frac {3}{7} b h x +a h +b g \right ) d +\frac {b \,c^{2} h}{2}\right ) e^{2} f^{2}}{5}+\frac {24 d \,e^{3} \left (\left (\frac {4}{9} b h x +a h +b g \right ) d +2 b c h \right ) f}{35}-\frac {64 b \,d^{2} e^{4} h}{105}\right )}{3 f^{5}}\) \(270\)
gosper \(-\frac {2 \sqrt {f x +e}\, \left (-35 h b \,d^{2} x^{4} f^{4}-45 a \,d^{2} f^{4} h \,x^{3}-90 b c d \,f^{4} h \,x^{3}+40 b \,d^{2} e \,f^{3} h \,x^{3}-45 b \,d^{2} f^{4} g \,x^{3}-126 a c d \,f^{4} h \,x^{2}+54 a \,d^{2} e \,f^{3} h \,x^{2}-63 a \,d^{2} f^{4} g \,x^{2}-63 b \,c^{2} f^{4} h \,x^{2}+108 b c d e \,f^{3} h \,x^{2}-126 b c d \,f^{4} g \,x^{2}-48 b \,d^{2} e^{2} f^{2} h \,x^{2}+54 b \,d^{2} e \,f^{3} g \,x^{2}-105 a \,c^{2} f^{4} h x +168 a c d e \,f^{3} h x -210 a c d \,f^{4} g x -72 a \,d^{2} e^{2} f^{2} h x +84 a \,d^{2} e \,f^{3} g x +84 b \,c^{2} e \,f^{3} h x -105 b \,c^{2} f^{4} g x -144 b c d \,e^{2} f^{2} h x +168 b c d e \,f^{3} g x +64 b \,d^{2} e^{3} f h x -72 b \,d^{2} e^{2} f^{2} g x +210 a \,c^{2} e \,f^{3} h -315 g a \,c^{2} f^{4}-336 a c d \,e^{2} f^{2} h +420 a c d e \,f^{3} g +144 a \,d^{2} e^{3} f h -168 a \,d^{2} e^{2} f^{2} g -168 b \,c^{2} e^{2} f^{2} h +210 b \,c^{2} e \,f^{3} g +288 b c d \,e^{3} f h -336 b c d \,e^{2} f^{2} g -128 b \,d^{2} e^{4} h +144 b \,d^{2} e^{3} f g \right )}{315 f^{5}}\) \(451\)
trager \(-\frac {2 \sqrt {f x +e}\, \left (-35 h b \,d^{2} x^{4} f^{4}-45 a \,d^{2} f^{4} h \,x^{3}-90 b c d \,f^{4} h \,x^{3}+40 b \,d^{2} e \,f^{3} h \,x^{3}-45 b \,d^{2} f^{4} g \,x^{3}-126 a c d \,f^{4} h \,x^{2}+54 a \,d^{2} e \,f^{3} h \,x^{2}-63 a \,d^{2} f^{4} g \,x^{2}-63 b \,c^{2} f^{4} h \,x^{2}+108 b c d e \,f^{3} h \,x^{2}-126 b c d \,f^{4} g \,x^{2}-48 b \,d^{2} e^{2} f^{2} h \,x^{2}+54 b \,d^{2} e \,f^{3} g \,x^{2}-105 a \,c^{2} f^{4} h x +168 a c d e \,f^{3} h x -210 a c d \,f^{4} g x -72 a \,d^{2} e^{2} f^{2} h x +84 a \,d^{2} e \,f^{3} g x +84 b \,c^{2} e \,f^{3} h x -105 b \,c^{2} f^{4} g x -144 b c d \,e^{2} f^{2} h x +168 b c d e \,f^{3} g x +64 b \,d^{2} e^{3} f h x -72 b \,d^{2} e^{2} f^{2} g x +210 a \,c^{2} e \,f^{3} h -315 g a \,c^{2} f^{4}-336 a c d \,e^{2} f^{2} h +420 a c d e \,f^{3} g +144 a \,d^{2} e^{3} f h -168 a \,d^{2} e^{2} f^{2} g -168 b \,c^{2} e^{2} f^{2} h +210 b \,c^{2} e \,f^{3} g +288 b c d \,e^{3} f h -336 b c d \,e^{2} f^{2} g -128 b \,d^{2} e^{4} h +144 b \,d^{2} e^{3} f g \right )}{315 f^{5}}\) \(451\)
risch \(-\frac {2 \sqrt {f x +e}\, \left (-35 h b \,d^{2} x^{4} f^{4}-45 a \,d^{2} f^{4} h \,x^{3}-90 b c d \,f^{4} h \,x^{3}+40 b \,d^{2} e \,f^{3} h \,x^{3}-45 b \,d^{2} f^{4} g \,x^{3}-126 a c d \,f^{4} h \,x^{2}+54 a \,d^{2} e \,f^{3} h \,x^{2}-63 a \,d^{2} f^{4} g \,x^{2}-63 b \,c^{2} f^{4} h \,x^{2}+108 b c d e \,f^{3} h \,x^{2}-126 b c d \,f^{4} g \,x^{2}-48 b \,d^{2} e^{2} f^{2} h \,x^{2}+54 b \,d^{2} e \,f^{3} g \,x^{2}-105 a \,c^{2} f^{4} h x +168 a c d e \,f^{3} h x -210 a c d \,f^{4} g x -72 a \,d^{2} e^{2} f^{2} h x +84 a \,d^{2} e \,f^{3} g x +84 b \,c^{2} e \,f^{3} h x -105 b \,c^{2} f^{4} g x -144 b c d \,e^{2} f^{2} h x +168 b c d e \,f^{3} g x +64 b \,d^{2} e^{3} f h x -72 b \,d^{2} e^{2} f^{2} g x +210 a \,c^{2} e \,f^{3} h -315 g a \,c^{2} f^{4}-336 a c d \,e^{2} f^{2} h +420 a c d e \,f^{3} g +144 a \,d^{2} e^{3} f h -168 a \,d^{2} e^{2} f^{2} g -168 b \,c^{2} e^{2} f^{2} h +210 b \,c^{2} e \,f^{3} g +288 b c d \,e^{3} f h -336 b c d \,e^{2} f^{2} g -128 b \,d^{2} e^{4} h +144 b \,d^{2} e^{3} f g \right )}{315 f^{5}}\) \(451\)
orering \(-\frac {2 \sqrt {f x +e}\, \left (-35 h b \,d^{2} x^{4} f^{4}-45 a \,d^{2} f^{4} h \,x^{3}-90 b c d \,f^{4} h \,x^{3}+40 b \,d^{2} e \,f^{3} h \,x^{3}-45 b \,d^{2} f^{4} g \,x^{3}-126 a c d \,f^{4} h \,x^{2}+54 a \,d^{2} e \,f^{3} h \,x^{2}-63 a \,d^{2} f^{4} g \,x^{2}-63 b \,c^{2} f^{4} h \,x^{2}+108 b c d e \,f^{3} h \,x^{2}-126 b c d \,f^{4} g \,x^{2}-48 b \,d^{2} e^{2} f^{2} h \,x^{2}+54 b \,d^{2} e \,f^{3} g \,x^{2}-105 a \,c^{2} f^{4} h x +168 a c d e \,f^{3} h x -210 a c d \,f^{4} g x -72 a \,d^{2} e^{2} f^{2} h x +84 a \,d^{2} e \,f^{3} g x +84 b \,c^{2} e \,f^{3} h x -105 b \,c^{2} f^{4} g x -144 b c d \,e^{2} f^{2} h x +168 b c d e \,f^{3} g x +64 b \,d^{2} e^{3} f h x -72 b \,d^{2} e^{2} f^{2} g x +210 a \,c^{2} e \,f^{3} h -315 g a \,c^{2} f^{4}-336 a c d \,e^{2} f^{2} h +420 a c d e \,f^{3} g +144 a \,d^{2} e^{3} f h -168 a \,d^{2} e^{2} f^{2} g -168 b \,c^{2} e^{2} f^{2} h +210 b \,c^{2} e \,f^{3} g +288 b c d \,e^{3} f h -336 b c d \,e^{2} f^{2} g -128 b \,d^{2} e^{4} h +144 b \,d^{2} e^{3} f g \right )}{315 f^{5}}\) \(451\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 386, normalized size of antiderivative = 1.57 \[ \int \frac {(a+b x) (c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 \, {\left (35 \, b d^{2} f^{4} h x^{4} + 5 \, {\left (9 \, b d^{2} f^{4} g - {\left (8 \, b d^{2} e f^{3} - 9 \, {\left (2 \, b c d + a d^{2}\right )} f^{4}\right )} h\right )} x^{3} - 3 \, {\left (3 \, {\left (6 \, b d^{2} e f^{3} - 7 \, {\left (2 \, b c d + a d^{2}\right )} f^{4}\right )} g - {\left (16 \, b d^{2} e^{2} f^{2} - 18 \, {\left (2 \, b c d + a d^{2}\right )} e f^{3} + 21 \, {\left (b c^{2} + 2 \, a c d\right )} f^{4}\right )} h\right )} x^{2} - 3 \, {\left (48 \, b d^{2} e^{3} f - 105 \, a c^{2} f^{4} - 56 \, {\left (2 \, b c d + a d^{2}\right )} e^{2} f^{2} + 70 \, {\left (b c^{2} + 2 \, a c d\right )} e f^{3}\right )} g + 2 \, {\left (64 \, b d^{2} e^{4} - 105 \, a c^{2} e f^{3} - 72 \, {\left (2 \, b c d + a d^{2}\right )} e^{3} f + 84 \, {\left (b c^{2} + 2 \, a c d\right )} e^{2} f^{2}\right )} h + {\left (3 \, {\left (24 \, b d^{2} e^{2} f^{2} - 28 \, {\left (2 \, b c d + a d^{2}\right )} e f^{3} + 35 \, {\left (b c^{2} + 2 \, a c d\right )} f^{4}\right )} g - {\left (64 \, b d^{2} e^{3} f - 105 \, a c^{2} f^{4} - 72 \, {\left (2 \, b c d + a d^{2}\right )} e^{2} f^{2} + 84 \, {\left (b c^{2} + 2 \, a c d\right )} e f^{3}\right )} h\right )} x\right )} \sqrt {f x + e}}{315 \, f^{5}} \] Input:

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

Output:

2/315*(35*b*d^2*f^4*h*x^4 + 5*(9*b*d^2*f^4*g - (8*b*d^2*e*f^3 - 9*(2*b*c*d 
 + a*d^2)*f^4)*h)*x^3 - 3*(3*(6*b*d^2*e*f^3 - 7*(2*b*c*d + a*d^2)*f^4)*g - 
 (16*b*d^2*e^2*f^2 - 18*(2*b*c*d + a*d^2)*e*f^3 + 21*(b*c^2 + 2*a*c*d)*f^4 
)*h)*x^2 - 3*(48*b*d^2*e^3*f - 105*a*c^2*f^4 - 56*(2*b*c*d + a*d^2)*e^2*f^ 
2 + 70*(b*c^2 + 2*a*c*d)*e*f^3)*g + 2*(64*b*d^2*e^4 - 105*a*c^2*e*f^3 - 72 
*(2*b*c*d + a*d^2)*e^3*f + 84*(b*c^2 + 2*a*c*d)*e^2*f^2)*h + (3*(24*b*d^2* 
e^2*f^2 - 28*(2*b*c*d + a*d^2)*e*f^3 + 35*(b*c^2 + 2*a*c*d)*f^4)*g - (64*b 
*d^2*e^3*f - 105*a*c^2*f^4 - 72*(2*b*c*d + a*d^2)*e^2*f^2 + 84*(b*c^2 + 2* 
a*c*d)*e*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. 619 vs. \(2 (262) = 524\).

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 376, normalized size of antiderivative = 1.53 \[ \int \frac {(a+b x) (c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 \, {\left (35 \, {\left (f x + e\right )}^{\frac {9}{2}} b d^{2} h + 45 \, {\left (b d^{2} f g - {\left (4 \, b d^{2} e - {\left (2 \, b c d + a d^{2}\right )} f\right )} h\right )} {\left (f x + e\right )}^{\frac {7}{2}} - 63 \, {\left ({\left (3 \, b d^{2} e f - {\left (2 \, b c d + a d^{2}\right )} f^{2}\right )} g - {\left (6 \, b d^{2} e^{2} - 3 \, {\left (2 \, b c d + a d^{2}\right )} e f + {\left (b c^{2} + 2 \, a c d\right )} f^{2}\right )} h\right )} {\left (f x + e\right )}^{\frac {5}{2}} + 105 \, {\left ({\left (3 \, b d^{2} e^{2} f - 2 \, {\left (2 \, b c d + a d^{2}\right )} e f^{2} + {\left (b c^{2} + 2 \, a c d\right )} f^{3}\right )} g - {\left (4 \, b d^{2} e^{3} - a c^{2} f^{3} - 3 \, {\left (2 \, b c d + a d^{2}\right )} e^{2} f + 2 \, {\left (b c^{2} + 2 \, a c d\right )} e f^{2}\right )} h\right )} {\left (f x + e\right )}^{\frac {3}{2}} - 315 \, {\left ({\left (b d^{2} e^{3} f - a c^{2} f^{4} - {\left (2 \, b c d + a d^{2}\right )} e^{2} f^{2} + {\left (b c^{2} + 2 \, a c d\right )} e f^{3}\right )} g - {\left (b d^{2} e^{4} - a c^{2} e f^{3} - {\left (2 \, b c d + a d^{2}\right )} e^{3} f + {\left (b c^{2} + 2 \, a c d\right )} e^{2} f^{2}\right )} h\right )} \sqrt {f x + e}\right )}}{315 \, f^{5}} \] Input:

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

Output:

2/315*(35*(f*x + e)^(9/2)*b*d^2*h + 45*(b*d^2*f*g - (4*b*d^2*e - (2*b*c*d 
+ a*d^2)*f)*h)*(f*x + e)^(7/2) - 63*((3*b*d^2*e*f - (2*b*c*d + a*d^2)*f^2) 
*g - (6*b*d^2*e^2 - 3*(2*b*c*d + a*d^2)*e*f + (b*c^2 + 2*a*c*d)*f^2)*h)*(f 
*x + e)^(5/2) + 105*((3*b*d^2*e^2*f - 2*(2*b*c*d + a*d^2)*e*f^2 + (b*c^2 + 
 2*a*c*d)*f^3)*g - (4*b*d^2*e^3 - a*c^2*f^3 - 3*(2*b*c*d + a*d^2)*e^2*f + 
2*(b*c^2 + 2*a*c*d)*e*f^2)*h)*(f*x + e)^(3/2) - 315*((b*d^2*e^3*f - a*c^2* 
f^4 - (2*b*c*d + a*d^2)*e^2*f^2 + (b*c^2 + 2*a*c*d)*e*f^3)*g - (b*d^2*e^4 
- a*c^2*e*f^3 - (2*b*c*d + a*d^2)*e^3*f + (b*c^2 + 2*a*c*d)*e^2*f^2)*h)*sq 
rt(f*x + e))/f^5
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 495 vs. \(2 (228) = 456\).

Time = 0.13 (sec) , antiderivative size = 495, normalized size of antiderivative = 2.01 \[ \int \frac {(a+b x) (c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 \, {\left (315 \, \sqrt {f x + e} a c^{2} g + \frac {105 \, {\left ({\left (f x + e\right )}^{\frac {3}{2}} - 3 \, \sqrt {f x + e} e\right )} b c^{2} g}{f} + \frac {210 \, {\left ({\left (f x + e\right )}^{\frac {3}{2}} - 3 \, \sqrt {f x + e} e\right )} a c d g}{f} + \frac {105 \, {\left ({\left (f x + e\right )}^{\frac {3}{2}} - 3 \, \sqrt {f x + e} e\right )} a c^{2} h}{f} + \frac {42 \, {\left (3 \, {\left (f x + e\right )}^{\frac {5}{2}} - 10 \, {\left (f x + e\right )}^{\frac {3}{2}} e + 15 \, \sqrt {f x + e} e^{2}\right )} b c d g}{f^{2}} + \frac {21 \, {\left (3 \, {\left (f x + e\right )}^{\frac {5}{2}} - 10 \, {\left (f x + e\right )}^{\frac {3}{2}} e + 15 \, \sqrt {f x + e} e^{2}\right )} a d^{2} g}{f^{2}} + \frac {21 \, {\left (3 \, {\left (f x + e\right )}^{\frac {5}{2}} - 10 \, {\left (f x + e\right )}^{\frac {3}{2}} e + 15 \, \sqrt {f x + e} e^{2}\right )} b c^{2} h}{f^{2}} + \frac {42 \, {\left (3 \, {\left (f x + e\right )}^{\frac {5}{2}} - 10 \, {\left (f x + e\right )}^{\frac {3}{2}} e + 15 \, \sqrt {f x + e} e^{2}\right )} a c d h}{f^{2}} + \frac {9 \, {\left (5 \, {\left (f x + e\right )}^{\frac {7}{2}} - 21 \, {\left (f x + e\right )}^{\frac {5}{2}} e + 35 \, {\left (f x + e\right )}^{\frac {3}{2}} e^{2} - 35 \, \sqrt {f x + e} e^{3}\right )} b d^{2} g}{f^{3}} + \frac {18 \, {\left (5 \, {\left (f x + e\right )}^{\frac {7}{2}} - 21 \, {\left (f x + e\right )}^{\frac {5}{2}} e + 35 \, {\left (f x + e\right )}^{\frac {3}{2}} e^{2} - 35 \, \sqrt {f x + e} e^{3}\right )} b c d h}{f^{3}} + \frac {9 \, {\left (5 \, {\left (f x + e\right )}^{\frac {7}{2}} - 21 \, {\left (f x + e\right )}^{\frac {5}{2}} e + 35 \, {\left (f x + e\right )}^{\frac {3}{2}} e^{2} - 35 \, \sqrt {f x + e} e^{3}\right )} a d^{2} h}{f^{3}} + \frac {{\left (35 \, {\left (f x + e\right )}^{\frac {9}{2}} - 180 \, {\left (f x + e\right )}^{\frac {7}{2}} e + 378 \, {\left (f x + e\right )}^{\frac {5}{2}} e^{2} - 420 \, {\left (f x + e\right )}^{\frac {3}{2}} e^{3} + 315 \, \sqrt {f x + e} e^{4}\right )} b d^{2} h}{f^{4}}\right )}}{315 \, f} \] Input:

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

Output:

2/315*(315*sqrt(f*x + e)*a*c^2*g + 105*((f*x + e)^(3/2) - 3*sqrt(f*x + e)* 
e)*b*c^2*g/f + 210*((f*x + e)^(3/2) - 3*sqrt(f*x + e)*e)*a*c*d*g/f + 105*( 
(f*x + e)^(3/2) - 3*sqrt(f*x + e)*e)*a*c^2*h/f + 42*(3*(f*x + e)^(5/2) - 1 
0*(f*x + e)^(3/2)*e + 15*sqrt(f*x + e)*e^2)*b*c*d*g/f^2 + 21*(3*(f*x + e)^ 
(5/2) - 10*(f*x + e)^(3/2)*e + 15*sqrt(f*x + e)*e^2)*a*d^2*g/f^2 + 21*(3*( 
f*x + e)^(5/2) - 10*(f*x + e)^(3/2)*e + 15*sqrt(f*x + e)*e^2)*b*c^2*h/f^2 
+ 42*(3*(f*x + e)^(5/2) - 10*(f*x + e)^(3/2)*e + 15*sqrt(f*x + e)*e^2)*a*c 
*d*h/f^2 + 9*(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*d^2*g/f^3 + 18*(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*c*d*h/f^ 
3 + 9*(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*d^2*h/f^3 + (35*(f*x + e)^(9/2) - 180*(f*x + e)^( 
7/2)*e + 378*(f*x + e)^(5/2)*e^2 - 420*(f*x + e)^(3/2)*e^3 + 315*sqrt(f*x 
+ e)*e^4)*b*d^2*h/f^4)/f
 

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 449, normalized size of antiderivative = 1.83 \[ \int \frac {(a+b x) (c+d x)^2 (g+h x)}{\sqrt {e+f x}} \, dx=\frac {2 \sqrt {f x +e}\, \left (35 b \,d^{2} f^{4} h \,x^{4}+45 a \,d^{2} f^{4} h \,x^{3}+90 b c d \,f^{4} h \,x^{3}-40 b \,d^{2} e \,f^{3} h \,x^{3}+45 b \,d^{2} f^{4} g \,x^{3}+126 a c d \,f^{4} h \,x^{2}-54 a \,d^{2} e \,f^{3} h \,x^{2}+63 a \,d^{2} f^{4} g \,x^{2}+63 b \,c^{2} f^{4} h \,x^{2}-108 b c d e \,f^{3} h \,x^{2}+126 b c d \,f^{4} g \,x^{2}+48 b \,d^{2} e^{2} f^{2} h \,x^{2}-54 b \,d^{2} e \,f^{3} g \,x^{2}+105 a \,c^{2} f^{4} h x -168 a c d e \,f^{3} h x +210 a c d \,f^{4} g x +72 a \,d^{2} e^{2} f^{2} h x -84 a \,d^{2} e \,f^{3} g x -84 b \,c^{2} e \,f^{3} h x +105 b \,c^{2} f^{4} g x +144 b c d \,e^{2} f^{2} h x -168 b c d e \,f^{3} g x -64 b \,d^{2} e^{3} f h x +72 b \,d^{2} e^{2} f^{2} g x -210 a \,c^{2} e \,f^{3} h +315 a \,c^{2} f^{4} g +336 a c d \,e^{2} f^{2} h -420 a c d e \,f^{3} g -144 a \,d^{2} e^{3} f h +168 a \,d^{2} e^{2} f^{2} g +168 b \,c^{2} e^{2} f^{2} h -210 b \,c^{2} e \,f^{3} g -288 b c d \,e^{3} f h +336 b c d \,e^{2} f^{2} g +128 b \,d^{2} e^{4} h -144 b \,d^{2} e^{3} f g \right )}{315 f^{5}} \] Input:

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

Output:

(2*sqrt(e + f*x)*( - 210*a*c**2*e*f**3*h + 315*a*c**2*f**4*g + 105*a*c**2* 
f**4*h*x + 336*a*c*d*e**2*f**2*h - 420*a*c*d*e*f**3*g - 168*a*c*d*e*f**3*h 
*x + 210*a*c*d*f**4*g*x + 126*a*c*d*f**4*h*x**2 - 144*a*d**2*e**3*f*h + 16 
8*a*d**2*e**2*f**2*g + 72*a*d**2*e**2*f**2*h*x - 84*a*d**2*e*f**3*g*x - 54 
*a*d**2*e*f**3*h*x**2 + 63*a*d**2*f**4*g*x**2 + 45*a*d**2*f**4*h*x**3 + 16 
8*b*c**2*e**2*f**2*h - 210*b*c**2*e*f**3*g - 84*b*c**2*e*f**3*h*x + 105*b* 
c**2*f**4*g*x + 63*b*c**2*f**4*h*x**2 - 288*b*c*d*e**3*f*h + 336*b*c*d*e** 
2*f**2*g + 144*b*c*d*e**2*f**2*h*x - 168*b*c*d*e*f**3*g*x - 108*b*c*d*e*f* 
*3*h*x**2 + 126*b*c*d*f**4*g*x**2 + 90*b*c*d*f**4*h*x**3 + 128*b*d**2*e**4 
*h - 144*b*d**2*e**3*f*g - 64*b*d**2*e**3*f*h*x + 72*b*d**2*e**2*f**2*g*x 
+ 48*b*d**2*e**2*f**2*h*x**2 - 54*b*d**2*e*f**3*g*x**2 - 40*b*d**2*e*f**3* 
h*x**3 + 45*b*d**2*f**4*g*x**3 + 35*b*d**2*f**4*h*x**4))/(315*f**5)