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

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.46 (sec) , antiderivative size = 277, normalized size of antiderivative = 1.08 \[ \int \frac {(c+d x)^2 \sqrt {e+f x} (g+h x)}{a+b x} \, dx=\frac {2 \sqrt {e+f x} \left (-105 a^3 d^2 f^3 h+35 a^2 b d f^2 (6 c f h+d (3 f g+e h+f h x))-7 a b^2 f \left (15 c^2 f^2 h-d^2 (e+f x) (-5 f g+2 e h-3 f h x)+10 c d f (3 f g+e h+f h x)\right )+b^3 \left (35 c^2 f^2 (3 f g+e h+f h x)+14 c d f (e+f x) (5 f g-2 e h+3 f h x)+d^2 (e+f x) \left (8 e^2 h+3 f^2 x (7 g+5 h x)-2 e f (7 g+6 h x)\right )\right )\right )}{105 b^4 f^3}-\frac {2 (b c-a d)^2 \sqrt {-b e+a f} (b g-a h) \arctan \left (\frac {\sqrt {b} \sqrt {e+f x}}{\sqrt {-b e+a f}}\right )}{b^{9/2}} \] Input:

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

Output:

(2*Sqrt[e + f*x]*(-105*a^3*d^2*f^3*h + 35*a^2*b*d*f^2*(6*c*f*h + d*(3*f*g 
+ e*h + f*h*x)) - 7*a*b^2*f*(15*c^2*f^2*h - d^2*(e + f*x)*(-5*f*g + 2*e*h 
- 3*f*h*x) + 10*c*d*f*(3*f*g + e*h + f*h*x)) + b^3*(35*c^2*f^2*(3*f*g + e* 
h + f*h*x) + 14*c*d*f*(e + f*x)*(5*f*g - 2*e*h + 3*f*h*x) + d^2*(e + f*x)* 
(8*e^2*h + 3*f^2*x*(7*g + 5*h*x) - 2*e*f*(7*g + 6*h*x)))))/(105*b^4*f^3) - 
 (2*(b*c - a*d)^2*Sqrt[-(b*e) + a*f]*(b*g - a*h)*ArcTan[(Sqrt[b]*Sqrt[e + 
f*x])/Sqrt[-(b*e) + a*f]])/b^(9/2)
 

Rubi [A] (verified)

Time = 0.46 (sec) , antiderivative size = 255, normalized size of antiderivative = 0.99, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {170, 27, 164, 60, 73, 221}

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

\(\Big \downarrow \) 170

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 164

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

\(\Big \downarrow \) 60

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

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

Input:

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

Output:

(2*h*(c + d*x)^2*(e + f*x)^(3/2))/(7*b*f) + ((2*(e + f*x)^(3/2)*(35*a^2*d^ 
2*f^2*h - 7*a*b*d*f*(5*d*f*g - 2*d*e*h + 10*c*f*h) + 2*b^2*(10*c^2*f^2*h - 
 d^2*e*(7*f*g - 4*e*h) + 7*c*d*f*(5*f*g - 2*e*h)) - 3*b*d*f*(7*a*d*f*h - b 
*(7*d*f*g - 4*d*e*h + 4*c*f*h))*x))/(15*b^2*f^2) + (7*(b*c - a*d)^2*f*(b*g 
 - a*h)*((2*Sqrt[e + f*x])/b - (2*Sqrt[b*e - a*f]*ArcTanh[(Sqrt[b]*Sqrt[e 
+ f*x])/Sqrt[b*e - a*f]])/b^(3/2)))/b^2)/(7*b*f)
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 60
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[ 
(a + b*x)^(m + 1)*((c + d*x)^n/(b*(m + n + 1))), x] + Simp[n*((b*c - a*d)/( 
b*(m + n + 1)))   Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a, b, 
 c, d}, x] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !Integer 
Q[n] || (GtQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinear 
Q[a, b, c, d, m, n, x]
 

rule 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

rule 164
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_) + (f_.)*(x_ 
))*((g_.) + (h_.)*(x_)), x_] :> Simp[(-(a*d*f*h*(n + 2) + b*c*f*h*(m + 2) - 
 b*d*(f*g + e*h)*(m + n + 3) - b*d*f*h*(m + n + 2)*x))*(a + b*x)^(m + 1)*(( 
c + d*x)^(n + 1)/(b^2*d^2*(m + n + 2)*(m + n + 3))), x] + Simp[(a^2*d^2*f*h 
*(n + 1)*(n + 2) + a*b*d*(n + 1)*(2*c*f*h*(m + 1) - d*(f*g + e*h)*(m + n + 
3)) + b^2*(c^2*f*h*(m + 1)*(m + 2) - c*d*(f*g + e*h)*(m + 1)*(m + n + 3) + 
d^2*e*g*(m + n + 2)*(m + n + 3)))/(b^2*d^2*(m + n + 2)*(m + n + 3))   Int[( 
a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, h, m, n}, x] 
&& NeQ[m + n + 2, 0] && NeQ[m + n + 3, 0]
 

rule 170
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_)*((g_.) + (h_.)*(x_)), x_] :> Simp[h*(a + b*x)^m*(c + d*x)^(n + 1)*(( 
e + f*x)^(p + 1)/(d*f*(m + n + p + 2))), x] + Simp[1/(d*f*(m + n + p + 2)) 
  Int[(a + b*x)^(m - 1)*(c + d*x)^n*(e + f*x)^p*Simp[a*d*f*g*(m + n + p + 2 
) - h*(b*c*e*m + a*(d*e*(n + 1) + c*f*(p + 1))) + (b*d*f*g*(m + n + p + 2) 
+ h*(a*d*f*m - b*(d*e*(m + n + 1) + c*f*(m + p + 1))))*x, x], x], x] /; Fre 
eQ[{a, b, c, d, e, f, g, h, n, p}, x] && GtQ[m, 0] && NeQ[m + n + p + 2, 0] 
 && IntegerQ[m]
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 
Maple [A] (verified)

Time = 0.50 (sec) , antiderivative size = 310, normalized size of antiderivative = 1.21

method result size
pseudoelliptic \(\frac {-2 \left (\left (\left (-\frac {8 \left (\frac {15}{8} f^{2} x^{2}-\frac {3}{2} e f x +e^{2}\right ) \left (f x +e \right ) b^{3}}{105}-\frac {2 a \left (-\frac {3 f x}{2}+e \right ) f \left (f x +e \right ) b^{2}}{15}-\frac {a^{2} f^{2} \left (f x +e \right ) b}{3}+a^{3} f^{3}\right ) d^{2}-2 c \left (-\frac {2 \left (f x +e \right ) \left (-\frac {3 f x}{2}+e \right ) b^{2}}{15}-\frac {a f \left (f x +e \right ) b}{3}+a^{2} f^{2}\right ) b f d +c^{2} \left (\frac {\left (-f x -e \right ) b}{3}+a f \right ) b^{2} f^{2}\right ) h -b g f \left (\left (-\frac {2 \left (f x +e \right ) \left (-\frac {3 f x}{2}+e \right ) b^{2}}{15}-\frac {a f \left (f x +e \right ) b}{3}+a^{2} f^{2}\right ) d^{2}-2 c \left (\frac {\left (-f x -e \right ) b}{3}+a f \right ) b f d +b^{2} c^{2} f^{2}\right )\right ) \sqrt {\left (a f -b e \right ) b}\, \sqrt {f x +e}+2 f^{3} \left (a d -b c \right )^{2} \left (a h -b g \right ) \left (a f -b e \right ) \arctan \left (\frac {b \sqrt {f x +e}}{\sqrt {\left (a f -b e \right ) b}}\right )}{f^{3} b^{4} \sqrt {\left (a f -b e \right ) b}}\) \(310\)
derivativedivides \(\frac {-\frac {2 \left (-\frac {d^{2} h \left (f x +e \right )^{\frac {7}{2}} b^{3}}{7}+\frac {a \,b^{2} d^{2} f h \left (f x +e \right )^{\frac {5}{2}}}{5}-\frac {2 b^{3} c d f h \left (f x +e \right )^{\frac {5}{2}}}{5}+\frac {2 b^{3} d^{2} e h \left (f x +e \right )^{\frac {5}{2}}}{5}-\frac {b^{3} d^{2} f g \left (f x +e \right )^{\frac {5}{2}}}{5}-\frac {a^{2} b \,d^{2} f^{2} h \left (f x +e \right )^{\frac {3}{2}}}{3}+\frac {2 a \,b^{2} c d \,f^{2} h \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {a \,b^{2} d^{2} e f h \left (f x +e \right )^{\frac {3}{2}}}{3}+\frac {a \,b^{2} d^{2} f^{2} g \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {b^{3} c^{2} f^{2} h \left (f x +e \right )^{\frac {3}{2}}}{3}+\frac {2 b^{3} c d e f h \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {2 b^{3} c d \,f^{2} g \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {b^{3} d^{2} e^{2} h \left (f x +e \right )^{\frac {3}{2}}}{3}+\frac {b^{3} d^{2} e f g \left (f x +e \right )^{\frac {3}{2}}}{3}+a^{3} d^{2} f^{3} h \sqrt {f x +e}-2 a^{2} b c d \,f^{3} h \sqrt {f x +e}-a^{2} b \,d^{2} f^{3} g \sqrt {f x +e}+a \,b^{2} c^{2} f^{3} h \sqrt {f x +e}+2 a \,b^{2} c d \,f^{3} g \sqrt {f x +e}-b^{3} c^{2} f^{3} g \sqrt {f x +e}\right )}{b^{4}}+\frac {2 f^{3} \left (a^{4} d^{2} f h -2 a^{3} b c d f h -a^{3} b \,d^{2} e h -a^{3} b \,d^{2} f g +a^{2} b^{2} c^{2} f h +2 a^{2} b^{2} c d e h +2 a^{2} b^{2} c d f g +a^{2} b^{2} d^{2} e g -a \,b^{3} c^{2} e h -a \,b^{3} c^{2} f g -2 a \,b^{3} c d e g +c^{2} g e \,b^{4}\right ) \arctan \left (\frac {b \sqrt {f x +e}}{\sqrt {\left (a f -b e \right ) b}}\right )}{b^{4} \sqrt {\left (a f -b e \right ) b}}}{f^{3}}\) \(552\)
default \(\frac {-\frac {2 \left (-\frac {d^{2} h \left (f x +e \right )^{\frac {7}{2}} b^{3}}{7}+\frac {a \,b^{2} d^{2} f h \left (f x +e \right )^{\frac {5}{2}}}{5}-\frac {2 b^{3} c d f h \left (f x +e \right )^{\frac {5}{2}}}{5}+\frac {2 b^{3} d^{2} e h \left (f x +e \right )^{\frac {5}{2}}}{5}-\frac {b^{3} d^{2} f g \left (f x +e \right )^{\frac {5}{2}}}{5}-\frac {a^{2} b \,d^{2} f^{2} h \left (f x +e \right )^{\frac {3}{2}}}{3}+\frac {2 a \,b^{2} c d \,f^{2} h \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {a \,b^{2} d^{2} e f h \left (f x +e \right )^{\frac {3}{2}}}{3}+\frac {a \,b^{2} d^{2} f^{2} g \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {b^{3} c^{2} f^{2} h \left (f x +e \right )^{\frac {3}{2}}}{3}+\frac {2 b^{3} c d e f h \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {2 b^{3} c d \,f^{2} g \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {b^{3} d^{2} e^{2} h \left (f x +e \right )^{\frac {3}{2}}}{3}+\frac {b^{3} d^{2} e f g \left (f x +e \right )^{\frac {3}{2}}}{3}+a^{3} d^{2} f^{3} h \sqrt {f x +e}-2 a^{2} b c d \,f^{3} h \sqrt {f x +e}-a^{2} b \,d^{2} f^{3} g \sqrt {f x +e}+a \,b^{2} c^{2} f^{3} h \sqrt {f x +e}+2 a \,b^{2} c d \,f^{3} g \sqrt {f x +e}-b^{3} c^{2} f^{3} g \sqrt {f x +e}\right )}{b^{4}}+\frac {2 f^{3} \left (a^{4} d^{2} f h -2 a^{3} b c d f h -a^{3} b \,d^{2} e h -a^{3} b \,d^{2} f g +a^{2} b^{2} c^{2} f h +2 a^{2} b^{2} c d e h +2 a^{2} b^{2} c d f g +a^{2} b^{2} d^{2} e g -a \,b^{3} c^{2} e h -a \,b^{3} c^{2} f g -2 a \,b^{3} c d e g +c^{2} g e \,b^{4}\right ) \arctan \left (\frac {b \sqrt {f x +e}}{\sqrt {\left (a f -b e \right ) b}}\right )}{b^{4} \sqrt {\left (a f -b e \right ) b}}}{f^{3}}\) \(552\)
risch \(-\frac {2 \left (-15 d^{2} h \,b^{3} f^{3} x^{3}+21 a \,b^{2} d^{2} f^{3} h \,x^{2}-42 b^{3} c d \,f^{3} h \,x^{2}-3 b^{3} d^{2} e \,f^{2} h \,x^{2}-21 b^{3} d^{2} f^{3} g \,x^{2}-35 a^{2} b \,d^{2} f^{3} h x +70 a \,b^{2} c d \,f^{3} h x +7 a \,b^{2} d^{2} e \,f^{2} h x +35 a \,b^{2} d^{2} f^{3} g x -35 b^{3} c^{2} f^{3} h x -14 b^{3} c d e \,f^{2} h x -70 b^{3} c d \,f^{3} g x +4 b^{3} d^{2} e^{2} f h x -7 b^{3} d^{2} e \,f^{2} g x +105 a^{3} d^{2} f^{3} h -210 a^{2} b c d \,f^{3} h -35 a^{2} b \,d^{2} e \,f^{2} h -105 a^{2} b \,d^{2} f^{3} g +105 a \,b^{2} c^{2} f^{3} h +70 a \,b^{2} c d e \,f^{2} h +210 a \,b^{2} c d \,f^{3} g -14 a \,b^{2} d^{2} e^{2} f h +35 a \,b^{2} d^{2} e \,f^{2} g -35 b^{3} c^{2} e \,f^{2} h -105 b^{3} c^{2} f^{3} g +28 b^{3} c d \,e^{2} f h -70 b^{3} c d e \,f^{2} g -8 b^{3} d^{2} e^{3} h +14 b^{3} d^{2} e^{2} f g \right ) \sqrt {f x +e}}{105 f^{3} b^{4}}+\frac {2 \left (a^{4} d^{2} f h -2 a^{3} b c d f h -a^{3} b \,d^{2} e h -a^{3} b \,d^{2} f g +a^{2} b^{2} c^{2} f h +2 a^{2} b^{2} c d e h +2 a^{2} b^{2} c d f g +a^{2} b^{2} d^{2} e g -a \,b^{3} c^{2} e h -a \,b^{3} c^{2} f g -2 a \,b^{3} c d e g +c^{2} g e \,b^{4}\right ) \arctan \left (\frac {b \sqrt {f x +e}}{\sqrt {\left (a f -b e \right ) b}}\right )}{b^{4} \sqrt {\left (a f -b e \right ) b}}\) \(577\)

Input:

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

Output:

2/((a*f-b*e)*b)^(1/2)*(-(((-8/105*(15/8*f^2*x^2-3/2*e*f*x+e^2)*(f*x+e)*b^3 
-2/15*a*(-3/2*f*x+e)*f*(f*x+e)*b^2-1/3*a^2*f^2*(f*x+e)*b+a^3*f^3)*d^2-2*c* 
(-2/15*(f*x+e)*(-3/2*f*x+e)*b^2-1/3*a*f*(f*x+e)*b+a^2*f^2)*b*f*d+c^2*(1/3* 
(-f*x-e)*b+a*f)*b^2*f^2)*h-b*g*f*((-2/15*(f*x+e)*(-3/2*f*x+e)*b^2-1/3*a*f* 
(f*x+e)*b+a^2*f^2)*d^2-2*c*(1/3*(-f*x-e)*b+a*f)*b*f*d+b^2*c^2*f^2))*((a*f- 
b*e)*b)^(1/2)*(f*x+e)^(1/2)+f^3*(a*d-b*c)^2*(a*h-b*g)*(a*f-b*e)*arctan(b*( 
f*x+e)^(1/2)/((a*f-b*e)*b)^(1/2)))/f^3/b^4
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 473 vs. \(2 (233) = 466\).

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

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

Output:

[-1/105*(105*((b^3*c^2 - 2*a*b^2*c*d + a^2*b*d^2)*f^3*g - (a*b^2*c^2 - 2*a 
^2*b*c*d + a^3*d^2)*f^3*h)*sqrt((b*e - a*f)/b)*log((b*f*x + 2*b*e - a*f + 
2*sqrt(f*x + e)*b*sqrt((b*e - a*f)/b))/(b*x + a)) - 2*(15*b^3*d^2*f^3*h*x^ 
3 + 3*(7*b^3*d^2*f^3*g + (b^3*d^2*e*f^2 + 7*(2*b^3*c*d - a*b^2*d^2)*f^3)*h 
)*x^2 - 7*(2*b^3*d^2*e^2*f - 5*(2*b^3*c*d - a*b^2*d^2)*e*f^2 - 15*(b^3*c^2 
 - 2*a*b^2*c*d + a^2*b*d^2)*f^3)*g + (8*b^3*d^2*e^3 - 14*(2*b^3*c*d - a*b^ 
2*d^2)*e^2*f + 35*(b^3*c^2 - 2*a*b^2*c*d + a^2*b*d^2)*e*f^2 - 105*(a*b^2*c 
^2 - 2*a^2*b*c*d + a^3*d^2)*f^3)*h + (7*(b^3*d^2*e*f^2 + 5*(2*b^3*c*d - a* 
b^2*d^2)*f^3)*g - (4*b^3*d^2*e^2*f - 7*(2*b^3*c*d - a*b^2*d^2)*e*f^2 - 35* 
(b^3*c^2 - 2*a*b^2*c*d + a^2*b*d^2)*f^3)*h)*x)*sqrt(f*x + e))/(b^4*f^3), - 
2/105*(105*((b^3*c^2 - 2*a*b^2*c*d + a^2*b*d^2)*f^3*g - (a*b^2*c^2 - 2*a^2 
*b*c*d + a^3*d^2)*f^3*h)*sqrt(-(b*e - a*f)/b)*arctan(-sqrt(f*x + e)*b*sqrt 
(-(b*e - a*f)/b)/(b*e - a*f)) - (15*b^3*d^2*f^3*h*x^3 + 3*(7*b^3*d^2*f^3*g 
 + (b^3*d^2*e*f^2 + 7*(2*b^3*c*d - a*b^2*d^2)*f^3)*h)*x^2 - 7*(2*b^3*d^2*e 
^2*f - 5*(2*b^3*c*d - a*b^2*d^2)*e*f^2 - 15*(b^3*c^2 - 2*a*b^2*c*d + a^2*b 
*d^2)*f^3)*g + (8*b^3*d^2*e^3 - 14*(2*b^3*c*d - a*b^2*d^2)*e^2*f + 35*(b^3 
*c^2 - 2*a*b^2*c*d + a^2*b*d^2)*e*f^2 - 105*(a*b^2*c^2 - 2*a^2*b*c*d + a^3 
*d^2)*f^3)*h + (7*(b^3*d^2*e*f^2 + 5*(2*b^3*c*d - a*b^2*d^2)*f^3)*g - (4*b 
^3*d^2*e^2*f - 7*(2*b^3*c*d - a*b^2*d^2)*e*f^2 - 35*(b^3*c^2 - 2*a*b^2*c*d 
 + a^2*b*d^2)*f^3)*h)*x)*sqrt(f*x + e))/(b^4*f^3)]
 

Sympy [A] (verification not implemented)

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

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

Output:

Piecewise((2*(d**2*h*(e + f*x)**(7/2)/(7*b*f**2) + (e + f*x)**(5/2)*(-a*d* 
*2*f*h + 2*b*c*d*f*h - 2*b*d**2*e*h + b*d**2*f*g)/(5*b**2*f**2) + (e + f*x 
)**(3/2)*(a**2*d**2*f**2*h - 2*a*b*c*d*f**2*h + a*b*d**2*e*f*h - a*b*d**2* 
f**2*g + b**2*c**2*f**2*h - 2*b**2*c*d*e*f*h + 2*b**2*c*d*f**2*g + b**2*d* 
*2*e**2*h - b**2*d**2*e*f*g)/(3*b**3*f**2) + sqrt(e + f*x)*(-a**3*d**2*f*h 
 + 2*a**2*b*c*d*f*h + a**2*b*d**2*f*g - a*b**2*c**2*f*h - 2*a*b**2*c*d*f*g 
 + b**3*c**2*f*g)/b**4 + f*(a*d - b*c)**2*(a*f - b*e)*(a*h - b*g)*atan(sqr 
t(e + f*x)/sqrt((a*f - b*e)/b))/(b**5*sqrt((a*f - b*e)/b)))/f, Ne(f, 0)), 
(sqrt(e)*(d**2*h*x**3/(3*b) + x**2*(-a*d**2*h + 2*b*c*d*h + b*d**2*g)/(2*b 
**2) + x*(a**2*d**2*h - 2*a*b*c*d*h - a*b*d**2*g + b**2*c**2*h + 2*b**2*c* 
d*g)/b**3 - (a*d - b*c)**2*(a*h - b*g)*Piecewise((x/a, Eq(b, 0)), (log(a + 
 b*x)/b, True))/b**3), True))
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {(c+d x)^2 \sqrt {e+f x} (g+h x)}{a+b x} \, dx=\text {Exception raised: ValueError} \] Input:

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

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(a*f-b*e>0)', see `assume?` for m 
ore detail
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 581 vs. \(2 (233) = 466\).

Time = 0.14 (sec) , antiderivative size = 581, normalized size of antiderivative = 2.26 \[ \int \frac {(c+d x)^2 \sqrt {e+f x} (g+h x)}{a+b x} \, dx=\frac {2 \, {\left (b^{4} c^{2} e g - 2 \, a b^{3} c d e g + a^{2} b^{2} d^{2} e g - a b^{3} c^{2} f g + 2 \, a^{2} b^{2} c d f g - a^{3} b d^{2} f g - a b^{3} c^{2} e h + 2 \, a^{2} b^{2} c d e h - a^{3} b d^{2} e h + a^{2} b^{2} c^{2} f h - 2 \, a^{3} b c d f h + a^{4} d^{2} f h\right )} \arctan \left (\frac {\sqrt {f x + e} b}{\sqrt {-b^{2} e + a b f}}\right )}{\sqrt {-b^{2} e + a b f} b^{4}} + \frac {2 \, {\left (21 \, {\left (f x + e\right )}^{\frac {5}{2}} b^{6} d^{2} f^{19} g - 35 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{6} d^{2} e f^{19} g + 70 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{6} c d f^{20} g - 35 \, {\left (f x + e\right )}^{\frac {3}{2}} a b^{5} d^{2} f^{20} g + 105 \, \sqrt {f x + e} b^{6} c^{2} f^{21} g - 210 \, \sqrt {f x + e} a b^{5} c d f^{21} g + 105 \, \sqrt {f x + e} a^{2} b^{4} d^{2} f^{21} g + 15 \, {\left (f x + e\right )}^{\frac {7}{2}} b^{6} d^{2} f^{18} h - 42 \, {\left (f x + e\right )}^{\frac {5}{2}} b^{6} d^{2} e f^{18} h + 35 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{6} d^{2} e^{2} f^{18} h + 42 \, {\left (f x + e\right )}^{\frac {5}{2}} b^{6} c d f^{19} h - 21 \, {\left (f x + e\right )}^{\frac {5}{2}} a b^{5} d^{2} f^{19} h - 70 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{6} c d e f^{19} h + 35 \, {\left (f x + e\right )}^{\frac {3}{2}} a b^{5} d^{2} e f^{19} h + 35 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{6} c^{2} f^{20} h - 70 \, {\left (f x + e\right )}^{\frac {3}{2}} a b^{5} c d f^{20} h + 35 \, {\left (f x + e\right )}^{\frac {3}{2}} a^{2} b^{4} d^{2} f^{20} h - 105 \, \sqrt {f x + e} a b^{5} c^{2} f^{21} h + 210 \, \sqrt {f x + e} a^{2} b^{4} c d f^{21} h - 105 \, \sqrt {f x + e} a^{3} b^{3} d^{2} f^{21} h\right )}}{105 \, b^{7} f^{21}} \] Input:

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

Output:

2*(b^4*c^2*e*g - 2*a*b^3*c*d*e*g + a^2*b^2*d^2*e*g - a*b^3*c^2*f*g + 2*a^2 
*b^2*c*d*f*g - a^3*b*d^2*f*g - a*b^3*c^2*e*h + 2*a^2*b^2*c*d*e*h - a^3*b*d 
^2*e*h + a^2*b^2*c^2*f*h - 2*a^3*b*c*d*f*h + a^4*d^2*f*h)*arctan(sqrt(f*x 
+ e)*b/sqrt(-b^2*e + a*b*f))/(sqrt(-b^2*e + a*b*f)*b^4) + 2/105*(21*(f*x + 
 e)^(5/2)*b^6*d^2*f^19*g - 35*(f*x + e)^(3/2)*b^6*d^2*e*f^19*g + 70*(f*x + 
 e)^(3/2)*b^6*c*d*f^20*g - 35*(f*x + e)^(3/2)*a*b^5*d^2*f^20*g + 105*sqrt( 
f*x + e)*b^6*c^2*f^21*g - 210*sqrt(f*x + e)*a*b^5*c*d*f^21*g + 105*sqrt(f* 
x + e)*a^2*b^4*d^2*f^21*g + 15*(f*x + e)^(7/2)*b^6*d^2*f^18*h - 42*(f*x + 
e)^(5/2)*b^6*d^2*e*f^18*h + 35*(f*x + e)^(3/2)*b^6*d^2*e^2*f^18*h + 42*(f* 
x + e)^(5/2)*b^6*c*d*f^19*h - 21*(f*x + e)^(5/2)*a*b^5*d^2*f^19*h - 70*(f* 
x + e)^(3/2)*b^6*c*d*e*f^19*h + 35*(f*x + e)^(3/2)*a*b^5*d^2*e*f^19*h + 35 
*(f*x + e)^(3/2)*b^6*c^2*f^20*h - 70*(f*x + e)^(3/2)*a*b^5*c*d*f^20*h + 35 
*(f*x + e)^(3/2)*a^2*b^4*d^2*f^20*h - 105*sqrt(f*x + e)*a*b^5*c^2*f^21*h + 
 210*sqrt(f*x + e)*a^2*b^4*c*d*f^21*h - 105*sqrt(f*x + e)*a^3*b^3*d^2*f^21 
*h)/(b^7*f^21)
 

Mupad [B] (verification not implemented)

Time = 2.02 (sec) , antiderivative size = 571, normalized size of antiderivative = 2.22 \[ \int \frac {(c+d x)^2 \sqrt {e+f x} (g+h x)}{a+b x} \, dx={\left (e+f\,x\right )}^{5/2}\,\left (\frac {2\,d^2\,f\,g-6\,d^2\,e\,h+4\,c\,d\,f\,h}{5\,b\,f^3}-\frac {2\,d^2\,h\,\left (a\,f^4-b\,e\,f^3\right )}{5\,b^2\,f^6}\right )-\sqrt {e+f\,x}\,\left (\frac {2\,{\left (c\,f-d\,e\right )}^2\,\left (e\,h-f\,g\right )}{b\,f^3}-\frac {\left (\frac {\left (\frac {2\,d^2\,f\,g-6\,d^2\,e\,h+4\,c\,d\,f\,h}{b\,f^3}-\frac {2\,d^2\,h\,\left (a\,f^4-b\,e\,f^3\right )}{b^2\,f^6}\right )\,\left (a\,f^4-b\,e\,f^3\right )}{b\,f^3}-\frac {2\,\left (c\,f-d\,e\right )\,\left (c\,f\,h-3\,d\,e\,h+2\,d\,f\,g\right )}{b\,f^3}\right )\,\left (a\,f^4-b\,e\,f^3\right )}{b\,f^3}\right )-{\left (e+f\,x\right )}^{3/2}\,\left (\frac {\left (\frac {2\,d^2\,f\,g-6\,d^2\,e\,h+4\,c\,d\,f\,h}{b\,f^3}-\frac {2\,d^2\,h\,\left (a\,f^4-b\,e\,f^3\right )}{b^2\,f^6}\right )\,\left (a\,f^4-b\,e\,f^3\right )}{3\,b\,f^3}-\frac {2\,\left (c\,f-d\,e\right )\,\left (c\,f\,h-3\,d\,e\,h+2\,d\,f\,g\right )}{3\,b\,f^3}\right )+\frac {2\,d^2\,h\,{\left (e+f\,x\right )}^{7/2}}{7\,b\,f^3}+\frac {\mathrm {atan}\left (\frac {\sqrt {b}\,\sqrt {e+f\,x}\,{\left (a\,d-b\,c\right )}^2\,\sqrt {b\,e-a\,f}\,\left (a\,h-b\,g\right )\,1{}\mathrm {i}}{b^4\,c^2\,e\,g+a^4\,d^2\,f\,h-a\,b^3\,c^2\,e\,h-a\,b^3\,c^2\,f\,g-a^3\,b\,d^2\,e\,h-a^3\,b\,d^2\,f\,g+a^2\,b^2\,d^2\,e\,g+a^2\,b^2\,c^2\,f\,h-2\,a\,b^3\,c\,d\,e\,g-2\,a^3\,b\,c\,d\,f\,h+2\,a^2\,b^2\,c\,d\,e\,h+2\,a^2\,b^2\,c\,d\,f\,g}\right )\,{\left (a\,d-b\,c\right )}^2\,\sqrt {b\,e-a\,f}\,\left (a\,h-b\,g\right )\,2{}\mathrm {i}}{b^{9/2}} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

(2*(105*sqrt(b)*sqrt(a*f - b*e)*atan((sqrt(e + f*x)*b)/(sqrt(b)*sqrt(a*f - 
 b*e)))*a**3*d**2*f**3*h - 210*sqrt(b)*sqrt(a*f - b*e)*atan((sqrt(e + f*x) 
*b)/(sqrt(b)*sqrt(a*f - b*e)))*a**2*b*c*d*f**3*h - 105*sqrt(b)*sqrt(a*f - 
b*e)*atan((sqrt(e + f*x)*b)/(sqrt(b)*sqrt(a*f - b*e)))*a**2*b*d**2*f**3*g 
+ 105*sqrt(b)*sqrt(a*f - b*e)*atan((sqrt(e + f*x)*b)/(sqrt(b)*sqrt(a*f - b 
*e)))*a*b**2*c**2*f**3*h + 210*sqrt(b)*sqrt(a*f - b*e)*atan((sqrt(e + f*x) 
*b)/(sqrt(b)*sqrt(a*f - b*e)))*a*b**2*c*d*f**3*g - 105*sqrt(b)*sqrt(a*f - 
b*e)*atan((sqrt(e + f*x)*b)/(sqrt(b)*sqrt(a*f - b*e)))*b**3*c**2*f**3*g - 
105*sqrt(e + f*x)*a**3*b*d**2*f**3*h + 210*sqrt(e + f*x)*a**2*b**2*c*d*f** 
3*h + 35*sqrt(e + f*x)*a**2*b**2*d**2*e*f**2*h + 105*sqrt(e + f*x)*a**2*b* 
*2*d**2*f**3*g + 35*sqrt(e + f*x)*a**2*b**2*d**2*f**3*h*x - 105*sqrt(e + f 
*x)*a*b**3*c**2*f**3*h - 70*sqrt(e + f*x)*a*b**3*c*d*e*f**2*h - 210*sqrt(e 
 + f*x)*a*b**3*c*d*f**3*g - 70*sqrt(e + f*x)*a*b**3*c*d*f**3*h*x + 14*sqrt 
(e + f*x)*a*b**3*d**2*e**2*f*h - 35*sqrt(e + f*x)*a*b**3*d**2*e*f**2*g - 7 
*sqrt(e + f*x)*a*b**3*d**2*e*f**2*h*x - 35*sqrt(e + f*x)*a*b**3*d**2*f**3* 
g*x - 21*sqrt(e + f*x)*a*b**3*d**2*f**3*h*x**2 + 35*sqrt(e + f*x)*b**4*c** 
2*e*f**2*h + 105*sqrt(e + f*x)*b**4*c**2*f**3*g + 35*sqrt(e + f*x)*b**4*c* 
*2*f**3*h*x - 28*sqrt(e + f*x)*b**4*c*d*e**2*f*h + 70*sqrt(e + f*x)*b**4*c 
*d*e*f**2*g + 14*sqrt(e + f*x)*b**4*c*d*e*f**2*h*x + 70*sqrt(e + f*x)*b**4 
*c*d*f**3*g*x + 42*sqrt(e + f*x)*b**4*c*d*f**3*h*x**2 + 8*sqrt(e + f*x)...