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

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 [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 173 \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x) (e+f x)^{3/2}} \, dx=\frac {2 (b e-a f)^2 (f g-e h)}{f^3 (d e-c f) \sqrt {e+f x}}+\frac {2 b (2 a d f h+b (d f g-2 d e h-c f h)) \sqrt {e+f x}}{d^2 f^3}+\frac {2 b^2 h (e+f x)^{3/2}}{3 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^{5/2} (d e-c f)^{3/2}} \] Output:

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

Mathematica [A] (verified)

Time = 0.43 (sec) , antiderivative size = 224, normalized size of antiderivative = 1.29 \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x) (e+f x)^{3/2}} \, dx=\frac {2 \left (3 a^2 d^2 f^2 (-f g+e h)+6 a b d f (c f h (e+f x)+d e (f g-2 e h-f h x))+b^2 \left (-3 c^2 f^2 h (e+f x)+c d f (e+f x) (3 f g-2 e h+f h x)+d^2 e \left (8 e^2 h-f^2 x (3 g+h x)+e f (-6 g+4 h x)\right )\right )\right )}{3 d^2 f^3 (-d e+c f) \sqrt {e+f x}}+\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^{5/2} (-d e+c f)^{3/2}} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.45 (sec) , antiderivative size = 223, normalized size of antiderivative = 1.29, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {167, 27, 164, 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) (e+f x)^{3/2}} \, dx\)

\(\Big \downarrow \) 167

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 164

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

\(\displaystyle \frac {-\frac {2 f (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^{5/2} \sqrt {d e-c f}}-\frac {2 b \sqrt {e+f x} \left (6 a d f (c f h-2 d e h+d f g)-b \left (3 c^2 f^2 h-c d f (3 f g-2 e h)+2 d^2 e (3 f g-4 e h)\right )+b d f x (c f h-4 d e h+3 d f g)\right )}{3 d^2 f^2}}{f (d e-c f)}+\frac {2 (a+b x)^2 (f g-e h)}{f \sqrt {e+f x} (d e-c f)}\)

Input:

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

Output:

(2*(f*g - e*h)*(a + b*x)^2)/(f*(d*e - c*f)*Sqrt[e + f*x]) + ((-2*b*Sqrt[e 
+ f*x]*(6*a*d*f*(d*f*g - 2*d*e*h + c*f*h) - b*(3*c^2*f^2*h + 2*d^2*e*(3*f* 
g - 4*e*h) - c*d*f*(3*f*g - 2*e*h)) + b*d*f*(3*d*f*g - 4*d*e*h + c*f*h)*x) 
)/(3*d^2*f^2) - (2*(b*c - a*d)^2*f*(d*g - c*h)*ArcTanh[(Sqrt[d]*Sqrt[e + f 
*x])/Sqrt[d*e - c*f]])/(d^(5/2)*Sqrt[d*e - c*f]))/(f*(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 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 167
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] && LtQ[m, -1] && GtQ[n, 0] && IntegersQ[2*m, 2*n, 2*p]
 

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.48 (sec) , antiderivative size = 230, normalized size of antiderivative = 1.33

method result size
pseudoelliptic \(\frac {\frac {2 b \sqrt {f x +e}\, \left (h b d f x +6 a d f h -3 b c f h -5 b d e h +3 b g d f \right )}{3 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 ) \sqrt {f x +e}}+\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 )}{\left (c f -d e \right ) d^{2} \sqrt {\left (c f -d e \right ) d}}}{f^{3}}\) \(230\)
risch \(\frac {2 b \left (h b d f x +6 a d f h -3 b c f h -5 b d e h +3 b g d f \right ) \sqrt {f x +e}}{3 f^{3} d^{2}}+\frac {\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 ) d^{2}}{\left (c f -d e \right ) \sqrt {f x +e}}+\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 )}{\left (c f -d e \right ) \sqrt {\left (c f -d e \right ) d}}}{f^{3} d^{2}}\) \(237\)
derivativedivides \(\frac {\frac {2 b \left (\frac {d h \left (f x +e \right )^{\frac {3}{2}} b}{3}+2 a d f h \sqrt {f x +e}-b c f h \sqrt {f x +e}-2 b d e h \sqrt {f x +e}+b d f g \sqrt {f x +e}\right )}{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 ) \sqrt {f x +e}}+\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 )}{\left (c f -d e \right ) d^{2} \sqrt {\left (c f -d e \right ) d}}}{f^{3}}\) \(256\)
default \(\frac {\frac {2 b \left (\frac {d h \left (f x +e \right )^{\frac {3}{2}} b}{3}+2 a d f h \sqrt {f x +e}-b c f h \sqrt {f x +e}-2 b d e h \sqrt {f x +e}+b d f g \sqrt {f x +e}\right )}{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 ) \sqrt {f x +e}}+\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 )}{\left (c f -d e \right ) d^{2} \sqrt {\left (c f -d e \right ) d}}}{f^{3}}\) \(256\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 624 vs. \(2 (155) = 310\).

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

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

Output:

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

Sympy [A] (verification not implemented)

Time = 14.63 (sec) , antiderivative size = 304, normalized size of antiderivative = 1.76 \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x) (e+f x)^{3/2}} \, dx=\begin {cases} \frac {2 \left (\frac {b^{2} h \left (e + f x\right )^{\frac {3}{2}}}{3 d f^{2}} + \frac {\left (a f - b e\right )^{2} \left (e h - f g\right )}{f^{2} \sqrt {e + f x} \left (c f - d e\right )} + \frac {\sqrt {e + f x} \left (2 a b d f h - b^{2} c f h - 2 b^{2} d e h + b^{2} d f g\right )}{d^{2} 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^{3} \sqrt {\frac {c f - d e}{d}} \left (c f - d e\right )}\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}}}{e^{\frac {3}{2}}} & \text {otherwise} \end {cases} \] Input:

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

Output:

Piecewise((2*(b**2*h*(e + f*x)**(3/2)/(3*d*f**2) + (a*f - b*e)**2*(e*h - f 
*g)/(f**2*sqrt(e + f*x)*(c*f - d*e)) + sqrt(e + f*x)*(2*a*b*d*f*h - b**2*c 
*f*h - 2*b**2*d*e*h + b**2*d*f*g)/(d**2*f**2) + f*(a*d - b*c)**2*(c*h - d* 
g)*atan(sqrt(e + f*x)/sqrt((c*f - d*e)/d))/(d**3*sqrt((c*f - d*e)/d)*(c*f 
- d*e)))/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)/e**(3/2), True))
 

Maxima [F(-2)]

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

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

Time = 0.13 (sec) , antiderivative size = 290, normalized size of antiderivative = 1.68 \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x) (e+f x)^{3/2}} \, 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 )}{{\left (d^{3} e - c d^{2} f\right )} \sqrt {-d^{2} e + c d f}} + \frac {2 \, {\left (b^{2} e^{2} f g - 2 \, a b e f^{2} g + a^{2} f^{3} g - b^{2} e^{3} h + 2 \, a b e^{2} f h - a^{2} e f^{2} h\right )}}{{\left (d e f^{3} - c f^{4}\right )} \sqrt {f x + e}} + \frac {2 \, {\left (3 \, \sqrt {f x + e} b^{2} d^{2} f^{7} g + {\left (f x + e\right )}^{\frac {3}{2}} b^{2} d^{2} f^{6} h - 6 \, \sqrt {f x + e} b^{2} d^{2} e f^{6} h - 3 \, \sqrt {f x + e} b^{2} c d f^{7} h + 6 \, \sqrt {f x + e} a b d^{2} f^{7} h\right )}}{3 \, d^{3} f^{9}} \] Input:

integrate((b*x+a)^2*(h*x+g)/(d*x+c)/(f*x+e)^(3/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))/((d^3*e - c*d^2*f 
)*sqrt(-d^2*e + c*d*f)) + 2*(b^2*e^2*f*g - 2*a*b*e*f^2*g + a^2*f^3*g - b^2 
*e^3*h + 2*a*b*e^2*f*h - a^2*e*f^2*h)/((d*e*f^3 - c*f^4)*sqrt(f*x + e)) + 
2/3*(3*sqrt(f*x + e)*b^2*d^2*f^7*g + (f*x + e)^(3/2)*b^2*d^2*f^6*h - 6*sqr 
t(f*x + e)*b^2*d^2*e*f^6*h - 3*sqrt(f*x + e)*b^2*c*d*f^7*h + 6*sqrt(f*x + 
e)*a*b*d^2*f^7*h)/(d^3*f^9)
 

Mupad [B] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 326, normalized size of antiderivative = 1.88 \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x) (e+f x)^{3/2}} \, dx=\sqrt {e+f\,x}\,\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 )+\frac {2\,b^2\,h\,{\left (e+f\,x\right )}^{3/2}}{3\,d\,f^3}+\frac {2\,\mathrm {atan}\left (\frac {2\,\sqrt {e+f\,x}\,{\left (a\,d-b\,c\right )}^2\,\left (c\,h-d\,g\right )\,\left (d^3\,e-c\,d^2\,f\right )}{d^{3/2}\,{\left (c\,f-d\,e\right )}^{3/2}\,\left (-2\,h\,a^2\,c\,d^2+2\,g\,a^2\,d^3+4\,h\,a\,b\,c^2\,d-4\,g\,a\,b\,c\,d^2-2\,h\,b^2\,c^3+2\,g\,b^2\,c^2\,d\right )}\right )\,{\left (a\,d-b\,c\right )}^2\,\left (c\,h-d\,g\right )}{d^{5/2}\,{\left (c\,f-d\,e\right )}^{3/2}}-\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 )}{d^2\,f^3\,\sqrt {e+f\,x}\,\left (c\,f-d\,e\right )} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 790, normalized size of antiderivative = 4.57 \[ \int \frac {(a+b x)^2 (g+h x)}{(c+d x) (e+f x)^{3/2}} \, dx=\frac {2 a^{2} c \,d^{3} e \,f^{3} h +8 a b \,d^{4} e^{3} f h -4 a b \,d^{4} e^{2} f^{2} g -2 b^{2} c^{3} d e \,f^{3} h -2 b^{2} c^{3} d \,f^{4} h x +2 b^{2} c^{2} d^{2} e \,f^{3} g +2 b^{2} c^{2} d^{2} f^{4} g x +\frac {20 b^{2} c \,d^{3} e^{3} f h}{3}-6 b^{2} c \,d^{3} e^{2} f^{2} g -\frac {8 b^{2} d^{4} e^{3} f h x}{3}+2 b^{2} d^{4} e^{2} f^{2} g x +4 a b \,c^{2} d^{2} e \,f^{3} h +4 a b \,c^{2} d^{2} f^{4} h x -12 a b c \,d^{3} e^{2} f^{2} h +4 a b c \,d^{3} e \,f^{3} g +4 a b \,d^{4} e^{2} f^{2} h x +\frac {4 b^{2} c^{2} d^{2} e \,f^{3} h x}{3}+\frac {10 b^{2} c \,d^{3} e^{2} f^{2} h x}{3}-4 b^{2} c \,d^{3} e \,f^{3} g x -\frac {4 b^{2} c \,d^{3} e \,f^{3} h \,x^{2}}{3}+2 \sqrt {d}\, \sqrt {f x +e}\, \sqrt {c f -d e}\, \mathit {atan} \left (\frac {\sqrt {f x +e}\, d}{\sqrt {d}\, \sqrt {c f -d e}}\right ) a^{2} c \,d^{2} f^{3} h -2 \sqrt {d}\, \sqrt {f x +e}\, \sqrt {c f -d e}\, \mathit {atan} \left (\frac {\sqrt {f x +e}\, d}{\sqrt {d}\, \sqrt {c f -d e}}\right ) b^{2} c^{2} d \,f^{3} g -2 \sqrt {d}\, \sqrt {f x +e}\, \sqrt {c f -d e}\, \mathit {atan} \left (\frac {\sqrt {f x +e}\, d}{\sqrt {d}\, \sqrt {c f -d e}}\right ) a^{2} d^{3} f^{3} g +2 \sqrt {d}\, \sqrt {f x +e}\, \sqrt {c f -d e}\, \mathit {atan} \left (\frac {\sqrt {f x +e}\, d}{\sqrt {d}\, \sqrt {c f -d e}}\right ) b^{2} c^{3} f^{3} h -8 a b c \,d^{3} e \,f^{3} h x -2 a^{2} c \,d^{3} f^{4} g -2 a^{2} d^{4} e^{2} f^{2} h +2 a^{2} d^{4} e \,f^{3} g +4 b^{2} d^{4} e^{3} f g +\frac {2 b^{2} c^{2} d^{2} e^{2} f^{2} h}{3}-4 \sqrt {d}\, \sqrt {f x +e}\, \sqrt {c f -d e}\, \mathit {atan} \left (\frac {\sqrt {f x +e}\, d}{\sqrt {d}\, \sqrt {c f -d e}}\right ) a b \,c^{2} d \,f^{3} h +4 \sqrt {d}\, \sqrt {f x +e}\, \sqrt {c f -d e}\, \mathit {atan} \left (\frac {\sqrt {f x +e}\, d}{\sqrt {d}\, \sqrt {c f -d e}}\right ) a b c \,d^{2} f^{3} g +\frac {2 b^{2} c^{2} d^{2} f^{4} h \,x^{2}}{3}+\frac {2 b^{2} d^{4} e^{2} f^{2} h \,x^{2}}{3}-\frac {16 b^{2} d^{4} e^{4} h}{3}}{\sqrt {f x +e}\, d^{3} f^{3} \left (c^{2} f^{2}-2 c d e f +d^{2} e^{2}\right )} \] Input:

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

Output:

(2*(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**2*f**3*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*d**3*f**3*g 
- 6*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*f**3*h + 6*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**2*f**3*g + 
3*sqrt(d)*sqrt(e + f*x)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sq 
rt(c*f - d*e)))*b**2*c**3*f**3*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)))*b**2*c**2*d*f**3*g + 3* 
a**2*c*d**3*e*f**3*h - 3*a**2*c*d**3*f**4*g - 3*a**2*d**4*e**2*f**2*h + 3* 
a**2*d**4*e*f**3*g + 6*a*b*c**2*d**2*e*f**3*h + 6*a*b*c**2*d**2*f**4*h*x - 
 18*a*b*c*d**3*e**2*f**2*h + 6*a*b*c*d**3*e*f**3*g - 12*a*b*c*d**3*e*f**3* 
h*x + 12*a*b*d**4*e**3*f*h - 6*a*b*d**4*e**2*f**2*g + 6*a*b*d**4*e**2*f**2 
*h*x - 3*b**2*c**3*d*e*f**3*h - 3*b**2*c**3*d*f**4*h*x + b**2*c**2*d**2*e* 
*2*f**2*h + 3*b**2*c**2*d**2*e*f**3*g + 2*b**2*c**2*d**2*e*f**3*h*x + 3*b* 
*2*c**2*d**2*f**4*g*x + b**2*c**2*d**2*f**4*h*x**2 + 10*b**2*c*d**3*e**3*f 
*h - 9*b**2*c*d**3*e**2*f**2*g + 5*b**2*c*d**3*e**2*f**2*h*x - 6*b**2*c*d* 
*3*e*f**3*g*x - 2*b**2*c*d**3*e*f**3*h*x**2 - 8*b**2*d**4*e**4*h + 6*b**2* 
d**4*e**3*f*g - 4*b**2*d**4*e**3*f*h*x + 3*b**2*d**4*e**2*f**2*g*x + b**2* 
d**4*e**2*f**2*h*x**2))/(3*sqrt(e + f*x)*d**3*f**3*(c**2*f**2 - 2*c*d*e...