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

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.31 (sec) , antiderivative size = 193, normalized size of antiderivative = 0.87 \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x) \sqrt {e+f x}} \, dx=\frac {2 \sqrt {e+f x} \left (15 a^2 d^2 f^2 h+10 a b d f (-3 c f h+d (3 f g-2 e h+f h x))+b^2 \left (15 c^2 f^2 h-5 c d f (3 f g-2 e h+f h x)+d^2 \left (8 e^2 h-2 e f (5 g+2 h x)+f^2 x (5 g+3 h x)\right )\right )\right )}{15 d^3 f^3}+\frac {2 (b c-a d)^2 (d g-c h) \arctan \left (\frac {\sqrt {d} \sqrt {e+f x}}{\sqrt {-d e+c f}}\right )}{d^{7/2} \sqrt {-d e+c f}} \] Input:

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

Output:

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

Rubi [F]

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

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

\(\Big \downarrow \) 170

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

Input:

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

Output:

$Aborted
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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 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]
 
Maple [A] (verified)

Time = 0.44 (sec) , antiderivative size = 192, normalized size of antiderivative = 0.87

method result size
pseudoelliptic \(\frac {-2 f^{3} \left (a d -b c \right )^{2} \left (c h -d g \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )+2 \left (\left (\left (\frac {x \left (\frac {3 h x}{5}+g \right ) b^{2}}{3}+2 a \left (\frac {h x}{3}+g \right ) b +a^{2} h \right ) d^{2}-2 \left (\left (\frac {h x}{6}+\frac {g}{2}\right ) b +a h \right ) c b d +b^{2} c^{2} h \right ) f^{2}-\frac {4 d \left (\left (\left (\frac {h x}{5}+\frac {g}{2}\right ) b +a h \right ) d -\frac {b c h}{2}\right ) b e f}{3}+\frac {8 b^{2} d^{2} e^{2} h}{15}\right ) \sqrt {f x +e}\, \sqrt {\left (c f -d e \right ) d}}{f^{3} d^{3} \sqrt {\left (c f -d e \right ) d}}\) \(192\)
risch \(\frac {2 \left (3 x^{2} h \,b^{2} d^{2} f^{2}+10 a b \,d^{2} f^{2} h x -5 b^{2} c d \,f^{2} h x -4 b^{2} d^{2} e f h x +5 b^{2} d^{2} f^{2} g x +15 a^{2} d^{2} f^{2} h -30 a b c d \,f^{2} h -20 a b \,d^{2} e f h +30 a b \,d^{2} f^{2} g +15 c^{2} b^{2} f^{2} h +10 b^{2} c d e f h -15 b^{2} c d \,f^{2} g +8 b^{2} d^{2} e^{2} h -10 b^{2} d^{2} e f g \right ) \sqrt {f x +e}}{15 f^{3} d^{3}}-\frac {2 \left (a^{2} c \,d^{2} h -a^{2} d^{3} g -2 a b \,c^{2} d h +2 a b c \,d^{2} g +c^{3} h \,b^{2}-b^{2} c^{2} d g \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )}{d^{3} \sqrt {\left (c f -d e \right ) d}}\) \(275\)
derivativedivides \(\frac {\frac {2 \left (\frac {d^{2} h \left (f x +e \right )^{\frac {5}{2}} b^{2}}{5}+\frac {2 a b \,d^{2} f h \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {b^{2} c d f h \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {2 b^{2} d^{2} e h \left (f x +e \right )^{\frac {3}{2}}}{3}+\frac {b^{2} d^{2} f g \left (f x +e \right )^{\frac {3}{2}}}{3}+a^{2} d^{2} f^{2} h \sqrt {f x +e}-2 a b c d \,f^{2} h \sqrt {f x +e}-2 a b \,d^{2} e f h \sqrt {f x +e}+2 a b \,d^{2} f^{2} g \sqrt {f x +e}+b^{2} c^{2} f^{2} h \sqrt {f x +e}+b^{2} c d e f h \sqrt {f x +e}-b^{2} c d \,f^{2} g \sqrt {f x +e}+b^{2} d^{2} e^{2} h \sqrt {f x +e}-b^{2} d^{2} e f g \sqrt {f x +e}\right )}{d^{3}}-\frac {2 f^{3} \left (a^{2} c \,d^{2} h -a^{2} d^{3} g -2 a b \,c^{2} d h +2 a b c \,d^{2} g +c^{3} h \,b^{2}-b^{2} c^{2} d g \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )}{d^{3} \sqrt {\left (c f -d e \right ) d}}}{f^{3}}\) \(349\)
default \(\frac {\frac {2 \left (\frac {d^{2} h \left (f x +e \right )^{\frac {5}{2}} b^{2}}{5}+\frac {2 a b \,d^{2} f h \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {b^{2} c d f h \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {2 b^{2} d^{2} e h \left (f x +e \right )^{\frac {3}{2}}}{3}+\frac {b^{2} d^{2} f g \left (f x +e \right )^{\frac {3}{2}}}{3}+a^{2} d^{2} f^{2} h \sqrt {f x +e}-2 a b c d \,f^{2} h \sqrt {f x +e}-2 a b \,d^{2} e f h \sqrt {f x +e}+2 a b \,d^{2} f^{2} g \sqrt {f x +e}+b^{2} c^{2} f^{2} h \sqrt {f x +e}+b^{2} c d e f h \sqrt {f x +e}-b^{2} c d \,f^{2} g \sqrt {f x +e}+b^{2} d^{2} e^{2} h \sqrt {f x +e}-b^{2} d^{2} e f g \sqrt {f x +e}\right )}{d^{3}}-\frac {2 f^{3} \left (a^{2} c \,d^{2} h -a^{2} d^{3} g -2 a b \,c^{2} d h +2 a b c \,d^{2} g +c^{3} h \,b^{2}-b^{2} c^{2} d g \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )}{d^{3} \sqrt {\left (c f -d e \right ) d}}}{f^{3}}\) \(349\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 422 vs. \(2 (201) = 402\).

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

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

Output:

[-1/15*(15*((b^2*c^2*d - 2*a*b*c*d^2 + a^2*d^3)*f^3*g - (b^2*c^3 - 2*a*b*c 
^2*d + a^2*c*d^2)*f^3*h)*sqrt(d^2*e - c*d*f)*log((d*f*x + 2*d*e - c*f + 2* 
sqrt(d^2*e - c*d*f)*sqrt(f*x + e))/(d*x + c)) - 2*(3*(b^2*d^4*e*f^2 - b^2* 
c*d^3*f^3)*h*x^2 - 5*(2*b^2*d^4*e^2*f + (b^2*c*d^3 - 6*a*b*d^4)*e*f^2 - 3* 
(b^2*c^2*d^2 - 2*a*b*c*d^3)*f^3)*g + (8*b^2*d^4*e^3 + 2*(b^2*c*d^3 - 10*a* 
b*d^4)*e^2*f + 5*(b^2*c^2*d^2 - 2*a*b*c*d^3 + 3*a^2*d^4)*e*f^2 - 15*(b^2*c 
^3*d - 2*a*b*c^2*d^2 + a^2*c*d^3)*f^3)*h + (5*(b^2*d^4*e*f^2 - b^2*c*d^3*f 
^3)*g - (4*b^2*d^4*e^2*f + (b^2*c*d^3 - 10*a*b*d^4)*e*f^2 - 5*(b^2*c^2*d^2 
 - 2*a*b*c*d^3)*f^3)*h)*x)*sqrt(f*x + e))/(d^5*e*f^3 - c*d^4*f^4), 2/15*(1 
5*((b^2*c^2*d - 2*a*b*c*d^2 + a^2*d^3)*f^3*g - (b^2*c^3 - 2*a*b*c^2*d + a^ 
2*c*d^2)*f^3*h)*sqrt(-d^2*e + c*d*f)*arctan(sqrt(-d^2*e + c*d*f)*sqrt(f*x 
+ e)/(d*f*x + d*e)) + (3*(b^2*d^4*e*f^2 - b^2*c*d^3*f^3)*h*x^2 - 5*(2*b^2* 
d^4*e^2*f + (b^2*c*d^3 - 6*a*b*d^4)*e*f^2 - 3*(b^2*c^2*d^2 - 2*a*b*c*d^3)* 
f^3)*g + (8*b^2*d^4*e^3 + 2*(b^2*c*d^3 - 10*a*b*d^4)*e^2*f + 5*(b^2*c^2*d^ 
2 - 2*a*b*c*d^3 + 3*a^2*d^4)*e*f^2 - 15*(b^2*c^3*d - 2*a*b*c^2*d^2 + a^2*c 
*d^3)*f^3)*h + (5*(b^2*d^4*e*f^2 - b^2*c*d^3*f^3)*g - (4*b^2*d^4*e^2*f + ( 
b^2*c*d^3 - 10*a*b*d^4)*e*f^2 - 5*(b^2*c^2*d^2 - 2*a*b*c*d^3)*f^3)*h)*x)*s 
qrt(f*x + e))/(d^5*e*f^3 - c*d^4*f^4)]
 

Sympy [A] (verification not implemented)

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

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

Output:

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

Maxima [F(-2)]

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

integrate((b*x+a)^2*(h*x+g)/(d*x+c)/(f*x+e)^(1/2),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(c*f-d*e>0)', see `assume?` for m 
ore detail
 

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 382, normalized size of antiderivative = 1.73 \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x) \sqrt {e+f x}} \, dx=\frac {2 \, {\left (b^{2} c^{2} d g - 2 \, a b c d^{2} g + a^{2} d^{3} g - b^{2} c^{3} h + 2 \, a b c^{2} d h - a^{2} c d^{2} h\right )} \arctan \left (\frac {\sqrt {f x + e} d}{\sqrt {-d^{2} e + c d f}}\right )}{\sqrt {-d^{2} e + c d f} d^{3}} + \frac {2 \, {\left (5 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{2} d^{4} f^{13} g - 15 \, \sqrt {f x + e} b^{2} d^{4} e f^{13} g - 15 \, \sqrt {f x + e} b^{2} c d^{3} f^{14} g + 30 \, \sqrt {f x + e} a b d^{4} f^{14} g + 3 \, {\left (f x + e\right )}^{\frac {5}{2}} b^{2} d^{4} f^{12} h - 10 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{2} d^{4} e f^{12} h + 15 \, \sqrt {f x + e} b^{2} d^{4} e^{2} f^{12} h - 5 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{2} c d^{3} f^{13} h + 10 \, {\left (f x + e\right )}^{\frac {3}{2}} a b d^{4} f^{13} h + 15 \, \sqrt {f x + e} b^{2} c d^{3} e f^{13} h - 30 \, \sqrt {f x + e} a b d^{4} e f^{13} h + 15 \, \sqrt {f x + e} b^{2} c^{2} d^{2} f^{14} h - 30 \, \sqrt {f x + e} a b c d^{3} f^{14} h + 15 \, \sqrt {f x + e} a^{2} d^{4} f^{14} h\right )}}{15 \, d^{5} f^{15}} \] Input:

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

Output:

2*(b^2*c^2*d*g - 2*a*b*c*d^2*g + a^2*d^3*g - b^2*c^3*h + 2*a*b*c^2*d*h - a 
^2*c*d^2*h)*arctan(sqrt(f*x + e)*d/sqrt(-d^2*e + c*d*f))/(sqrt(-d^2*e + c* 
d*f)*d^3) + 2/15*(5*(f*x + e)^(3/2)*b^2*d^4*f^13*g - 15*sqrt(f*x + e)*b^2* 
d^4*e*f^13*g - 15*sqrt(f*x + e)*b^2*c*d^3*f^14*g + 30*sqrt(f*x + e)*a*b*d^ 
4*f^14*g + 3*(f*x + e)^(5/2)*b^2*d^4*f^12*h - 10*(f*x + e)^(3/2)*b^2*d^4*e 
*f^12*h + 15*sqrt(f*x + e)*b^2*d^4*e^2*f^12*h - 5*(f*x + e)^(3/2)*b^2*c*d^ 
3*f^13*h + 10*(f*x + e)^(3/2)*a*b*d^4*f^13*h + 15*sqrt(f*x + e)*b^2*c*d^3* 
e*f^13*h - 30*sqrt(f*x + e)*a*b*d^4*e*f^13*h + 15*sqrt(f*x + e)*b^2*c^2*d^ 
2*f^14*h - 30*sqrt(f*x + e)*a*b*c*d^3*f^14*h + 15*sqrt(f*x + e)*a^2*d^4*f^ 
14*h)/(d^5*f^15)
 

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

(2*( - 15*sqrt(d)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f 
 - d*e)))*a**2*c*d**2*f**3*h + 15*sqrt(d)*sqrt(c*f - d*e)*atan((sqrt(e + f 
*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*a**2*d**3*f**3*g + 30*sqrt(d)*sqrt(c*f - 
 d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*a*b*c**2*d*f**3*h 
- 30*sqrt(d)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d* 
e)))*a*b*c*d**2*f**3*g - 15*sqrt(d)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d) 
/(sqrt(d)*sqrt(c*f - d*e)))*b**2*c**3*f**3*h + 15*sqrt(d)*sqrt(c*f - d*e)* 
atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*b**2*c**2*d*f**3*g + 15* 
sqrt(e + f*x)*a**2*c*d**3*f**3*h - 15*sqrt(e + f*x)*a**2*d**4*e*f**2*h - 3 
0*sqrt(e + f*x)*a*b*c**2*d**2*f**3*h + 10*sqrt(e + f*x)*a*b*c*d**3*e*f**2* 
h + 30*sqrt(e + f*x)*a*b*c*d**3*f**3*g + 10*sqrt(e + f*x)*a*b*c*d**3*f**3* 
h*x + 20*sqrt(e + f*x)*a*b*d**4*e**2*f*h - 30*sqrt(e + f*x)*a*b*d**4*e*f** 
2*g - 10*sqrt(e + f*x)*a*b*d**4*e*f**2*h*x + 15*sqrt(e + f*x)*b**2*c**3*d* 
f**3*h - 5*sqrt(e + f*x)*b**2*c**2*d**2*e*f**2*h - 15*sqrt(e + f*x)*b**2*c 
**2*d**2*f**3*g - 5*sqrt(e + f*x)*b**2*c**2*d**2*f**3*h*x - 2*sqrt(e + f*x 
)*b**2*c*d**3*e**2*f*h + 5*sqrt(e + f*x)*b**2*c*d**3*e*f**2*g + sqrt(e + f 
*x)*b**2*c*d**3*e*f**2*h*x + 5*sqrt(e + f*x)*b**2*c*d**3*f**3*g*x + 3*sqrt 
(e + f*x)*b**2*c*d**3*f**3*h*x**2 - 8*sqrt(e + f*x)*b**2*d**4*e**3*h + 10* 
sqrt(e + f*x)*b**2*d**4*e**2*f*g + 4*sqrt(e + f*x)*b**2*d**4*e**2*f*h*x - 
5*sqrt(e + f*x)*b**2*d**4*e*f**2*g*x - 3*sqrt(e + f*x)*b**2*d**4*e*f**2...