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

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 = 216 \[ \int \frac {(c+d x)^2 (g+h x)}{(a+b x)^2 (e+f x)^{3/2}} \, dx=-\frac {2 (d e-c f)^2 (f g-e h)}{f^2 (b e-a f)^2 \sqrt {e+f x}}+\frac {2 d^2 h \sqrt {e+f x}}{b^2 f^2}-\frac {(b c-a d)^2 (b g-a h) \sqrt {e+f x}}{b^2 (b e-a f)^2 (a+b x)}-\frac {(b c-a d) \left (3 a^2 d f h+b^2 (4 d e g-3 c f g+2 c e h)+a b (c f h-d (f g+6 e h))\right ) \text {arctanh}\left (\frac {\sqrt {b} \sqrt {e+f x}}{\sqrt {b e-a f}}\right )}{b^{5/2} (b e-a f)^{5/2}} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.52 (sec) , antiderivative size = 326, normalized size of antiderivative = 1.51, 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 {(c+d x)^2 (g+h x)}{(a+b x)^2 (e+f x)^{3/2}} \, dx\)

\(\Big \downarrow \) 166

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 163

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

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

Input:

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

Output:

-(((b*g - a*h)*(c + d*x)^2)/(b*(b*e - a*f)*(a + b*x)*Sqrt[e + f*x])) - ((- 
2*(3*a^2*d^2*e*f^2*h - b^2*(2*d^2*e^2*(f*g - 2*e*h) - 2*c*d*e*f*(3*f*g - 2 
*e*h) + c^2*f^2*(3*f*g - 2*e*h)) - a*b*f*(2*c*d*e*f*h - c^2*f^2*h + d^2*e* 
(f*g + 4*e*h)) + d^2*f*(b*e - a*f)*(b*f*g + 2*b*e*h - 3*a*f*h)*x))/(b*f^2* 
(b*e - a*f)*Sqrt[e + f*x]) + (2*(b*c - a*d)*(3*a^2*d*f*h + b^2*(4*d*e*g - 
3*c*f*g + 2*c*e*h) + a*b*(c*f*h - d*(f*g + 6*e*h)))*ArcTanh[(Sqrt[b]*Sqrt[ 
e + f*x])/Sqrt[b*e - a*f]])/(b^(3/2)*(b*e - a*f)^(3/2)))/(2*b*(b*e - a*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.59 (sec) , antiderivative size = 352, normalized size of antiderivative = 1.63

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

Input:

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

Output:

2/f^2*(d^2*h/b^2*(f*x+e)^(1/2)-f^2/(a*f-b*e)^2/b^2*((-1/2*a^3*d^2*f*h+a^2* 
b*c*d*f*h+1/2*a^2*b*d^2*f*g-1/2*a*b^2*c^2*f*h-a*b^2*c*d*f*g+1/2*b^3*c^2*f* 
g)*(f*x+e)^(1/2)/((f*x+e)*b+a*f-b*e)+1/2*(3*a^3*d^2*f*h-2*a^2*b*c*d*f*h-6* 
a^2*b*d^2*e*h-a^2*b*d^2*f*g-a*b^2*c^2*f*h+8*a*b^2*c*d*e*h-2*a*b^2*c*d*f*g+ 
4*a*b^2*d^2*e*g-2*b^3*c^2*e*h+3*b^3*c^2*f*g-4*b^3*c*d*e*g)/((a*f-b*e)*b)^( 
1/2)*arctan(b*(f*x+e)^(1/2)/((a*f-b*e)*b)^(1/2)))-(-c^2*e*f^2*h+c^2*f^3*g+ 
2*c*d*e^2*f*h-2*c*d*e*f^2*g-d^2*e^3*h+d^2*e^2*f*g)/(a*f-b*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. 1195 vs. \(2 (200) = 400\).

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F(-2)]

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

integrate((d*x+c)^2*(h*x+g)/(b*x+a)^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(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. 620 vs. \(2 (200) = 400\).

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

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

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

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