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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F(-1)]
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 = 218 \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x)^2 (e+f x)^{3/2}} \, dx=-\frac {2 (b e-a f)^2 (f g-e h)}{f^2 (d e-c f)^2 \sqrt {e+f x}}+\frac {2 b^2 h \sqrt {e+f x}}{d^2 f^2}-\frac {(b c-a d)^2 (d g-c h) \sqrt {e+f x}}{d^2 (d e-c f)^2 (c+d x)}-\frac {(b c-a d) \left (a d (3 d f g-2 d e h-c f h)-b \left (4 d^2 e g+3 c^2 f h-c d (f g+6 e h)\right )\right ) \text {arctanh}\left (\frac {\sqrt {d} \sqrt {e+f x}}{\sqrt {d e-c f}}\right )}{d^{5/2} (d e-c f)^{5/2}} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

(-2*a*b*d*f*(2*d^2*e*(-(f*g) + e*h)*x + c^2*f*h*(e + f*x) + c*d*(-3*e*f*g 
+ 2*e^2*h - f^2*g*x)) + a^2*d^2*f^2*(-(d*(e*g + 3*f*g*x - 2*e*h*x)) + c*(- 
2*f*g + 3*e*h + f*h*x)) + b^2*(3*c^3*f^2*h*(e + f*x) + 2*d^3*e^2*x*(-(f*g) 
 + 2*e*h + f*h*x) + c^2*d*f*(e + f*x)*(-(f*g) - 4*e*h + 2*f*h*x) + 2*c*d^2 
*e*(2*e^2*h - 2*f^2*h*x^2 - e*f*(g + h*x))))/(d^2*f^2*(d*e - c*f)^2*(c + d 
*x)*Sqrt[e + f*x]) + ((-(b*c) + a*d)*(a*d*(-3*d*f*g + 2*d*e*h + c*f*h) + b 
*(4*d^2*e*g + 3*c^2*f*h - c*d*(f*g + 6*e*h)))*ArcTan[(Sqrt[d]*Sqrt[e + f*x 
])/Sqrt[-(d*e) + c*f]])/(d^(5/2)*(-(d*e) + c*f)^(5/2))
 

Rubi [A] (verified)

Time = 0.49 (sec) , antiderivative size = 317, normalized size of antiderivative = 1.45, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {166, 27, 163, 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 {(a+b x)^2 (g+h x)}{(c+d x)^2 (e+f x)^{3/2}} \, dx\)

\(\Big \downarrow \) 166

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 163

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

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

Input:

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

Output:

-(((d*g - c*h)*(a + b*x)^2)/(d*(d*e - c*f)*(c + d*x)*Sqrt[e + f*x])) + ((2 
*(2*a*b*d*e*f*(3*d*f*g - 2*d*e*h - c*f*h) - a^2*d*f^2*(3*d*f*g - 2*d*e*h - 
 c*f*h) + b^2*e*(3*c^2*f^2*h - 2*d^2*e*(f*g - 2*e*h) - c*d*f*(f*g + 4*e*h) 
) + b^2*f*(d*e - c*f)*(d*f*g + 2*d*e*h - 3*c*f*h)*x))/(d*f^2*(d*e - c*f)*S 
qrt[e + f*x]) - (2*(b*c - a*d)*(a*d*(3*d*f*g - 2*d*e*h - c*f*h) - b*(4*d^2 
*e*g + 3*c^2*f*h - c*d*(f*g + 6*e*h)))*ArcTanh[(Sqrt[d]*Sqrt[e + f*x])/Sqr 
t[d*e - c*f]])/(d^(3/2)*(d*e - c*f)^(3/2)))/(2*d*(d*e - c*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 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 163
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_) + (f_.)*(x_) 
)*((g_.) + (h_.)*(x_)), x_] :> Simp[((a^2*d*f*h*(n + 2) + b^2*d*e*g*(m + n 
+ 3) + a*b*(c*f*h*(m + 1) - d*(f*g + e*h)*(m + n + 3)) + b*f*h*(b*c - a*d)* 
(m + 1)*x)/(b^2*d*(b*c - a*d)*(m + 1)*(m + n + 3)))*(a + b*x)^(m + 1)*(c + 
d*x)^(n + 1), 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*(b*c - a*d)*(m + 1)*(m + n + 3))   Int[(a + b*x)^(m + 1)*(c + d*x)^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, g, h, m, n}, x] && ((GeQ[m, -2] && LtQ[m, - 
1]) || SumSimplerQ[m, 1]) && NeQ[m, -1] && NeQ[m + n + 3, 0]
 

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

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.61 (sec) , antiderivative size = 349, normalized size of antiderivative = 1.60

method result size
derivativedivides \(\frac {\frac {2 h \,b^{2} \sqrt {f x +e}}{d^{2}}-\frac {2 \left (-a^{2} e \,f^{2} h +a^{2} f^{3} g +2 a b \,e^{2} f h -2 a b e \,f^{2} g -b^{2} e^{3} h +b^{2} e^{2} f g \right )}{\left (c f -d e \right )^{2} \sqrt {f x +e}}+\frac {2 f^{2} \left (\frac {\left (\frac {1}{2} a^{2} c \,d^{2} f h -\frac {1}{2} a^{2} d^{3} f g -a b \,c^{2} d f h +a b c \,d^{2} f g +\frac {1}{2} b^{2} c^{3} f h -\frac {1}{2} b^{2} c^{2} d f g \right ) \sqrt {f x +e}}{\left (f x +e \right ) d +c f -d e}+\frac {\left (a^{2} c \,d^{2} f h +2 a^{2} d^{3} e h -3 a^{2} d^{3} f g +2 a b \,c^{2} d f h -8 a b c \,d^{2} e h +2 a b c \,d^{2} f g +4 a b \,d^{3} e g -3 b^{2} c^{3} f h +6 b^{2} c^{2} d e h +b^{2} c^{2} d f g -4 b^{2} c \,d^{2} e g \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )}{2 \sqrt {\left (c f -d e \right ) d}}\right )}{\left (c f -d e \right )^{2} d^{2}}}{f^{2}}\) \(349\)
default \(\frac {\frac {2 h \,b^{2} \sqrt {f x +e}}{d^{2}}-\frac {2 \left (-a^{2} e \,f^{2} h +a^{2} f^{3} g +2 a b \,e^{2} f h -2 a b e \,f^{2} g -b^{2} e^{3} h +b^{2} e^{2} f g \right )}{\left (c f -d e \right )^{2} \sqrt {f x +e}}+\frac {2 f^{2} \left (\frac {\left (\frac {1}{2} a^{2} c \,d^{2} f h -\frac {1}{2} a^{2} d^{3} f g -a b \,c^{2} d f h +a b c \,d^{2} f g +\frac {1}{2} b^{2} c^{3} f h -\frac {1}{2} b^{2} c^{2} d f g \right ) \sqrt {f x +e}}{\left (f x +e \right ) d +c f -d e}+\frac {\left (a^{2} c \,d^{2} f h +2 a^{2} d^{3} e h -3 a^{2} d^{3} f g +2 a b \,c^{2} d f h -8 a b c \,d^{2} e h +2 a b c \,d^{2} f g +4 a b \,d^{3} e g -3 b^{2} c^{3} f h +6 b^{2} c^{2} d e h +b^{2} c^{2} d f g -4 b^{2} c \,d^{2} e g \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )}{2 \sqrt {\left (c f -d e \right ) d}}\right )}{\left (c f -d e \right )^{2} d^{2}}}{f^{2}}\) \(349\)
pseudoelliptic \(\frac {\left (x d +c \right ) \sqrt {f x +e}\, \left (\left (-3 a f g +2 e \left (a h +2 b g \right )\right ) d^{2}+\left (\left (a h -b g \right ) f -6 e h b \right ) c d +3 b \,c^{2} f h \right ) f^{2} \left (a d -b c \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )+3 \sqrt {\left (c f -d e \right ) d}\, \left (\left (-a^{2} f^{3} g x -\frac {a \left (-4 x g b +a \left (-2 h x +g \right )\right ) e \,f^{2}}{3}-\frac {4 x b \,e^{2} \left (\frac {\left (-h x +g \right ) b}{2}+a h \right ) f}{3}+\frac {4 b^{2} e^{3} h x}{3}\right ) d^{3}+c \left (-\frac {2 a \left (-x g b +a \left (-\frac {h x}{2}+g \right )\right ) f^{3}}{3}+e \left (-\frac {4}{3} h \,b^{2} x^{2}+2 g a b +a^{2} h \right ) f^{2}-\frac {4 \left (\frac {\left (h x +g \right ) b}{2}+a h \right ) b \,e^{2} f}{3}+\frac {4 b^{2} e^{3} h}{3}\right ) d^{2}-\frac {2 c^{2} \left (f x +e \right ) b f \left (\left (\left (-h x +\frac {g}{2}\right ) b +a h \right ) f +2 e h b \right ) d}{3}+b^{2} c^{3} f^{2} h \left (f x +e \right )\right )}{f^{2} d^{2} \left (c f -d e \right )^{2} \sqrt {f x +e}\, \left (x d +c \right ) \sqrt {\left (c f -d e \right ) d}}\) \(353\)
risch \(\frac {2 b^{2} h \sqrt {f x +e}}{d^{2} f^{2}}+\frac {\frac {2 d^{2} \left (a^{2} e \,f^{2} h -a^{2} f^{3} g -2 a b \,e^{2} f h +2 a b e \,f^{2} g +b^{2} e^{3} h -b^{2} e^{2} f g \right )}{\left (c f -d e \right )^{2} \sqrt {f x +e}}+\frac {2 f^{2} \left (\frac {\left (\frac {1}{2} a^{2} c \,d^{2} f h -\frac {1}{2} a^{2} d^{3} f g -a b \,c^{2} d f h +a b c \,d^{2} f g +\frac {1}{2} b^{2} c^{3} f h -\frac {1}{2} b^{2} c^{2} d f g \right ) \sqrt {f x +e}}{\left (f x +e \right ) d +c f -d e}+\frac {\left (a^{2} c \,d^{2} f h +2 a^{2} d^{3} e h -3 a^{2} d^{3} f g +2 a b \,c^{2} d f h -8 a b c \,d^{2} e h +2 a b c \,d^{2} f g +4 a b \,d^{3} e g -3 b^{2} c^{3} f h +6 b^{2} c^{2} d e h +b^{2} c^{2} d f g -4 b^{2} c \,d^{2} e g \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )}{2 \sqrt {\left (c f -d e \right ) d}}\right )}{\left (c f -d e \right )^{2}}}{d^{2} f^{2}}\) \(356\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1205 vs. \(2 (202) = 404\).

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

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

Output:

[-1/2*(sqrt(d^2*e - c*d*f)*(((4*(b^2*c*d^3 - a*b*d^4)*e*f^3 - (b^2*c^2*d^2 
 + 2*a*b*c*d^3 - 3*a^2*d^4)*f^4)*g - (2*(3*b^2*c^2*d^2 - 4*a*b*c*d^3 + a^2 
*d^4)*e*f^3 - (3*b^2*c^3*d - 2*a*b*c^2*d^2 - a^2*c*d^3)*f^4)*h)*x^2 + (4*( 
b^2*c^2*d^2 - a*b*c*d^3)*e^2*f^2 - (b^2*c^3*d + 2*a*b*c^2*d^2 - 3*a^2*c*d^ 
3)*e*f^3)*g - (2*(3*b^2*c^3*d - 4*a*b*c^2*d^2 + a^2*c*d^3)*e^2*f^2 - (3*b^ 
2*c^4 - 2*a*b*c^3*d - a^2*c^2*d^2)*e*f^3)*h + ((4*(b^2*c*d^3 - a*b*d^4)*e^ 
2*f^2 + 3*(b^2*c^2*d^2 - 2*a*b*c*d^3 + a^2*d^4)*e*f^3 - (b^2*c^3*d + 2*a*b 
*c^2*d^2 - 3*a^2*c*d^3)*f^4)*g - (2*(3*b^2*c^2*d^2 - 4*a*b*c*d^3 + a^2*d^4 
)*e^2*f^2 + 3*(b^2*c^3*d - 2*a*b*c^2*d^2 + a^2*c*d^3)*e*f^3 - (3*b^2*c^4 - 
 2*a*b*c^3*d - a^2*c^2*d^2)*f^4)*h)*x)*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*(2*(b^2*d^5*e^3*f - 3*b^2*c*d^ 
4*e^2*f^2 + 3*b^2*c^2*d^3*e*f^3 - b^2*c^3*d^2*f^4)*h*x^2 - (2*b^2*c*d^4*e^ 
3*f - 2*a^2*c^2*d^3*f^4 - (b^2*c^2*d^3 + 6*a*b*c*d^4 - a^2*d^5)*e^2*f^2 - 
(b^2*c^3*d^2 - 6*a*b*c^2*d^3 - a^2*c*d^4)*e*f^3)*g + (4*b^2*c*d^4*e^4 - 4* 
(2*b^2*c^2*d^3 + a*b*c*d^4)*e^3*f + (7*b^2*c^3*d^2 + 2*a*b*c^2*d^3 + 3*a^2 
*c*d^4)*e^2*f^2 - (3*b^2*c^4*d - 2*a*b*c^3*d^2 + 3*a^2*c^2*d^3)*e*f^3)*h - 
 ((2*b^2*d^5*e^3*f - 2*(b^2*c*d^4 + 2*a*b*d^5)*e^2*f^2 + (b^2*c^2*d^3 + 2* 
a*b*c*d^4 + 3*a^2*d^5)*e*f^3 - (b^2*c^3*d^2 - 2*a*b*c^2*d^3 + 3*a^2*c*d^4) 
*f^4)*g - (4*b^2*d^5*e^4 - 2*(3*b^2*c*d^4 + 2*a*b*d^5)*e^3*f + 2*(2*a*b*c* 
d^4 + a^2*d^5)*e^2*f^2 + (5*b^2*c^3*d^2 - 2*a*b*c^2*d^3 - a^2*c*d^4)*e*...
 

Sympy [F(-1)]

Timed out. \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x)^2 (e+f x)^{3/2}} \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Maxima [F(-2)]

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

integrate((b*x+a)^2*(h*x+g)/(d*x+c)^2/(f*x+e)^(3/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 [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 623 vs. \(2 (202) = 404\).

Time = 0.14 (sec) , antiderivative size = 623, normalized size of antiderivative = 2.86 \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x)^2 (e+f x)^{3/2}} \, dx=-\frac {{\left (4 \, b^{2} c d^{2} e g - 4 \, a b d^{3} e g - b^{2} c^{2} d f g - 2 \, a b c d^{2} f g + 3 \, a^{2} d^{3} f g - 6 \, b^{2} c^{2} d e h + 8 \, a b c d^{2} e h - 2 \, a^{2} d^{3} e h + 3 \, b^{2} c^{3} f h - 2 \, a b c^{2} d f h - a^{2} c d^{2} f h\right )} \arctan \left (\frac {\sqrt {f x + e} d}{\sqrt {-d^{2} e + c d f}}\right )}{{\left (d^{4} e^{2} - 2 \, c d^{3} e f + c^{2} d^{2} f^{2}\right )} \sqrt {-d^{2} e + c d f}} + \frac {2 \, \sqrt {f x + e} b^{2} h}{d^{2} f^{2}} - \frac {2 \, {\left (f x + e\right )} b^{2} d^{3} e^{2} f g - 2 \, b^{2} d^{3} e^{3} f g - 4 \, {\left (f x + e\right )} a b d^{3} e f^{2} g + 2 \, b^{2} c d^{2} e^{2} f^{2} g + 4 \, a b d^{3} e^{2} f^{2} g + {\left (f x + e\right )} b^{2} c^{2} d f^{3} g - 2 \, {\left (f x + e\right )} a b c d^{2} f^{3} g + 3 \, {\left (f x + e\right )} a^{2} d^{3} f^{3} g - 4 \, a b c d^{2} e f^{3} g - 2 \, a^{2} d^{3} e f^{3} g + 2 \, a^{2} c d^{2} f^{4} g - 2 \, {\left (f x + e\right )} b^{2} d^{3} e^{3} h + 2 \, b^{2} d^{3} e^{4} h + 4 \, {\left (f x + e\right )} a b d^{3} e^{2} f h - 2 \, b^{2} c d^{2} e^{3} f h - 4 \, a b d^{3} e^{3} f h - 2 \, {\left (f x + e\right )} a^{2} d^{3} e f^{2} h + 4 \, a b c d^{2} e^{2} f^{2} h + 2 \, a^{2} d^{3} e^{2} f^{2} h - {\left (f x + e\right )} b^{2} c^{3} f^{3} h + 2 \, {\left (f x + e\right )} a b c^{2} d f^{3} h - {\left (f x + e\right )} a^{2} c d^{2} f^{3} h - 2 \, a^{2} c d^{2} e f^{3} h}{{\left (d^{4} e^{2} f^{2} - 2 \, c d^{3} e f^{3} + c^{2} d^{2} f^{4}\right )} {\left ({\left (f x + e\right )}^{\frac {3}{2}} d - \sqrt {f x + e} d e + \sqrt {f x + e} c f\right )}} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

(sqrt(d)*sqrt(e + f*x)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqr 
t(c*f - d*e)))*a**2*c**2*d**2*f**3*h + 2*sqrt(d)*sqrt(e + f*x)*sqrt(c*f - 
d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*a**2*c*d**3*e*f**2* 
h - 3*sqrt(d)*sqrt(e + f*x)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d 
)*sqrt(c*f - d*e)))*a**2*c*d**3*f**3*g + sqrt(d)*sqrt(e + f*x)*sqrt(c*f - 
d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*a**2*c*d**3*f**3*h* 
x + 2*sqrt(d)*sqrt(e + f*x)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d 
)*sqrt(c*f - d*e)))*a**2*d**4*e*f**2*h*x - 3*sqrt(d)*sqrt(e + f*x)*sqrt(c* 
f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*a**2*d**4*f**3* 
g*x + 2*sqrt(d)*sqrt(e + f*x)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt 
(d)*sqrt(c*f - d*e)))*a*b*c**3*d*f**3*h - 8*sqrt(d)*sqrt(e + f*x)*sqrt(c*f 
 - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*a*b*c**2*d**2*e* 
f**2*h + 2*sqrt(d)*sqrt(e + f*x)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(s 
qrt(d)*sqrt(c*f - d*e)))*a*b*c**2*d**2*f**3*g + 2*sqrt(d)*sqrt(e + f*x)*sq 
rt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*a*b*c**2*d 
**2*f**3*h*x + 4*sqrt(d)*sqrt(e + f*x)*sqrt(c*f - d*e)*atan((sqrt(e + f*x) 
*d)/(sqrt(d)*sqrt(c*f - d*e)))*a*b*c*d**3*e*f**2*g - 8*sqrt(d)*sqrt(e + f* 
x)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*a*b*c 
*d**3*e*f**2*h*x + 2*sqrt(d)*sqrt(e + f*x)*sqrt(c*f - d*e)*atan((sqrt(e + 
f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*a*b*c*d**3*f**3*g*x + 4*sqrt(d)*sqrt...