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

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.49 (sec) , antiderivative size = 294, normalized size of antiderivative = 1.19, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {166, 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 {(a+b x)^2 \sqrt {e+f x} (g+h x)}{(c+d x)^2} \, dx\)

\(\Big \downarrow \) 166

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 164

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

\(\Big \downarrow \) 60

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

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

Input:

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

Output:

-(((d*g - c*h)*(a + b*x)^2*(e + f*x)^(3/2))/(d*(d*e - c*f)*(c + d*x))) + ( 
(2*b*(e + f*x)^(3/2)*(10*a*d*f*(3*d*f*g + 2*d*e*h - 5*c*f*h) + b*(35*c^2*f 
^2*h + 2*d^2*e*(5*f*g - 2*e*h) - c*d*f*(25*f*g + 16*e*h)) + 3*b*d*f*(5*d*f 
*g + 2*d*e*h - 7*c*f*h)*x))/(15*d^2*f^2) - ((b*c - a*d)*(a*d*(d*f*g + 2*d* 
e*h - 3*c*f*h) + b*(4*d^2*e*g + 7*c^2*f*h - c*d*(5*f*g + 6*e*h)))*((2*Sqrt 
[e + f*x])/d - (2*Sqrt[d*e - c*f]*ArcTanh[(Sqrt[d]*Sqrt[e + f*x])/Sqrt[d*e 
 - c*f]])/d^(3/2)))/d^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 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 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.56 (sec) , antiderivative size = 323, normalized size of antiderivative = 1.31

method result size
pseudoelliptic \(\frac {-3 \left (a d -b c \right ) \left (x d +c \right ) \left (\frac {\left (-a f g -2 e \left (a h +2 b g \right )\right ) d^{2}}{3}+c \left (\left (a h +\frac {5 b g}{3}\right ) f +2 e h b \right ) d -\frac {7 b \,c^{2} f h}{3}\right ) f^{2} \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}\, \sqrt {f x +e}\, \left (\frac {\left (\left (\frac {2 x^{2} \left (\frac {3 h x}{5}+g \right ) b^{2}}{3}+4 a x \left (\frac {h x}{3}+g \right ) b -a^{2} \left (-2 h x +g \right )\right ) f^{2}+\frac {4 x \left (\frac {\left (\frac {h x}{5}+g \right ) b}{2}+a h \right ) b e f}{3}-\frac {4 b^{2} e^{2} h x}{15}\right ) d^{3}}{3}+c \left (\left (-\frac {10 x \left (\frac {7 h x}{25}+g \right ) b^{2}}{9}+2 a \left (-\frac {10 h x}{9}+g \right ) b +a^{2} h \right ) f^{2}+\frac {4 \left (\frac {\left (-\frac {9 h x}{5}+g \right ) b}{2}+a h \right ) b e f}{9}-\frac {4 b^{2} e^{2} h}{45}\right ) d^{2}-\frac {10 c^{2} \left (\left (\left (-\frac {7 h x}{15}+\frac {g}{2}\right ) b +a h \right ) f +\frac {2 e h b}{15}\right ) b f d}{3}+\frac {7 b^{2} c^{3} f^{2} h}{3}\right )}{f^{2} d^{4} \left (x d +c \right ) \sqrt {\left (c f -d e \right ) d}}\) \(323\)
risch \(\frac {2 \left (3 h \,b^{2} x^{2} d^{2} f^{2}+10 a b \,d^{2} f^{2} h x -10 b^{2} c d \,f^{2} h x +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 -60 a b c d \,f^{2} h +10 a b \,d^{2} e f h +30 a b \,d^{2} f^{2} g +45 b^{2} c^{2} f^{2} h -10 b^{2} c d e f h -30 b^{2} c d \,f^{2} g -2 b^{2} d^{2} e^{2} h +5 b^{2} d^{2} e f g \right ) \sqrt {f x +e}}{15 f^{2} d^{4}}-\frac {\left (2 a d -2 b c \right ) \left (\frac {\left (-\frac {1}{2} a c d f h +\frac {1}{2} a \,d^{2} f g +\frac {1}{2} b \,c^{2} f h -\frac {1}{2} b c d f g \right ) \sqrt {f x +e}}{\left (f x +e \right ) d +c f -d e}+\frac {\left (3 a c d f h -2 a \,d^{2} e h -a \,d^{2} f g -7 b \,c^{2} f h +6 b c d e h +5 b c d f g -4 b \,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 )}{d^{4}}\) \(341\)
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 {2 b^{2} c d f h \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {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}-4 a b c d \,f^{2} h \sqrt {f x +e}+2 a b \,d^{2} f^{2} g \sqrt {f x +e}+3 c^{2} f^{2} h \,b^{2} \sqrt {f x +e}-2 b^{2} c d \,f^{2} g \sqrt {f x +e}\right )}{d^{4}}-\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 (3 a^{2} c \,d^{2} f h -2 a^{2} d^{3} e h -a^{2} d^{3} f g -10 a b \,c^{2} d f h +8 a b c \,d^{2} e h +6 a b c \,d^{2} f g -4 a b \,d^{3} e g +7 b^{2} c^{3} f h -6 b^{2} c^{2} d e h -5 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 )}{d^{4}}}{f^{2}}\) \(430\)
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 {2 b^{2} c d f h \left (f x +e \right )^{\frac {3}{2}}}{3}-\frac {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}-4 a b c d \,f^{2} h \sqrt {f x +e}+2 a b \,d^{2} f^{2} g \sqrt {f x +e}+3 c^{2} f^{2} h \,b^{2} \sqrt {f x +e}-2 b^{2} c d \,f^{2} g \sqrt {f x +e}\right )}{d^{4}}-\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 (3 a^{2} c \,d^{2} f h -2 a^{2} d^{3} e h -a^{2} d^{3} f g -10 a b \,c^{2} d f h +8 a b c \,d^{2} e h +6 a b c \,d^{2} f g -4 a b \,d^{3} e g +7 b^{2} c^{3} f h -6 b^{2} c^{2} d e h -5 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 )}{d^{4}}}{f^{2}}\) \(430\)

Input:

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

Output:

3/((c*f-d*e)*d)^(1/2)*(-(a*d-b*c)*(d*x+c)*(1/3*(-a*f*g-2*e*(a*h+2*b*g))*d^ 
2+c*((a*h+5/3*b*g)*f+2*e*h*b)*d-7/3*b*c^2*f*h)*f^2*arctan(d*(f*x+e)^(1/2)/ 
((c*f-d*e)*d)^(1/2))+((c*f-d*e)*d)^(1/2)*(f*x+e)^(1/2)*(1/3*((2/3*x^2*(3/5 
*h*x+g)*b^2+4*a*x*(1/3*h*x+g)*b-a^2*(-2*h*x+g))*f^2+4/3*x*(1/2*(1/5*h*x+g) 
*b+a*h)*b*e*f-4/15*b^2*e^2*h*x)*d^3+c*((-10/9*x*(7/25*h*x+g)*b^2+2*a*(-10/ 
9*h*x+g)*b+a^2*h)*f^2+4/9*(1/2*(-9/5*h*x+g)*b+a*h)*b*e*f-4/45*b^2*e^2*h)*d 
^2-10/3*c^2*(((-7/15*h*x+1/2*g)*b+a*h)*f+2/15*e*h*b)*b*f*d+7/3*b^2*c^3*f^2 
*h))/f^2/d^4/(d*x+c)
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 864 vs. \(2 (225) = 450\).

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

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

Output:

[1/30*(15*sqrt(d^2*e - c*d*f)*((4*(b^2*c^2*d^2 - a*b*c*d^3)*e*f^2 - (5*b^2 
*c^3*d - 6*a*b*c^2*d^2 + a^2*c*d^3)*f^3)*g - (2*(3*b^2*c^3*d - 4*a*b*c^2*d 
^2 + a^2*c*d^3)*e*f^2 - (7*b^2*c^4 - 10*a*b*c^3*d + 3*a^2*c^2*d^2)*f^3)*h 
+ ((4*(b^2*c*d^3 - a*b*d^4)*e*f^2 - (5*b^2*c^2*d^2 - 6*a*b*c*d^3 + a^2*d^4 
)*f^3)*g - (2*(3*b^2*c^2*d^2 - 4*a*b*c*d^3 + a^2*d^4)*e*f^2 - (7*b^2*c^3*d 
 - 10*a*b*c^2*d^2 + 3*a^2*c*d^3)*f^3)*h)*x)*log((d*f*x + 2*d*e - c*f + 2*s 
qrt(d^2*e - c*d*f)*sqrt(f*x + e))/(d*x + c)) + 2*(6*(b^2*d^5*e*f^2 - b^2*c 
*d^4*f^3)*h*x^3 + 2*(5*(b^2*d^5*e*f^2 - b^2*c*d^4*f^3)*g + (b^2*d^5*e^2*f 
- 2*(4*b^2*c*d^4 - 5*a*b*d^5)*e*f^2 + (7*b^2*c^2*d^3 - 10*a*b*c*d^4)*f^3)* 
h)*x^2 + 5*(2*b^2*c*d^4*e^2*f - (17*b^2*c^2*d^3 - 18*a*b*c*d^4 + 3*a^2*d^5 
)*e*f^2 + 3*(5*b^2*c^3*d^2 - 6*a*b*c^2*d^3 + a^2*c*d^4)*f^3)*g - (4*b^2*c* 
d^4*e^3 + 4*(4*b^2*c^2*d^3 - 5*a*b*c*d^4)*e^2*f - 5*(25*b^2*c^3*d^2 - 34*a 
*b*c^2*d^3 + 9*a^2*c*d^4)*e*f^2 + 15*(7*b^2*c^4*d - 10*a*b*c^3*d^2 + 3*a^2 
*c^2*d^3)*f^3)*h + 2*(5*(b^2*d^5*e^2*f - 6*(b^2*c*d^4 - a*b*d^5)*e*f^2 + ( 
5*b^2*c^2*d^3 - 6*a*b*c*d^4)*f^3)*g - (2*b^2*d^5*e^3 + (7*b^2*c*d^4 - 10*a 
*b*d^5)*e^2*f - (44*b^2*c^2*d^3 - 60*a*b*c*d^4 + 15*a^2*d^5)*e*f^2 + 5*(7* 
b^2*c^3*d^2 - 10*a*b*c^2*d^3 + 3*a^2*c*d^4)*f^3)*h)*x)*sqrt(f*x + e))/(c*d 
^6*e*f^2 - c^2*d^5*f^3 + (d^7*e*f^2 - c*d^6*f^3)*x), -1/15*(15*sqrt(-d^2*e 
 + c*d*f)*((4*(b^2*c^2*d^2 - a*b*c*d^3)*e*f^2 - (5*b^2*c^3*d - 6*a*b*c^2*d 
^2 + a^2*c*d^3)*f^3)*g - (2*(3*b^2*c^3*d - 4*a*b*c^2*d^2 + a^2*c*d^3)*e...
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F(-2)]

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

integrate((b*x+a)^2*(f*x+e)^(1/2)*(h*x+g)/(d*x+c)^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. 484 vs. \(2 (225) = 450\).

Time = 0.14 (sec) , antiderivative size = 484, normalized size of antiderivative = 1.96 \[ \int \frac {(a+b x)^2 \sqrt {e+f x} (g+h x)}{(c+d x)^2} \, dx=-\frac {{\left (4 \, b^{2} c d^{2} e g - 4 \, a b d^{3} e g - 5 \, b^{2} c^{2} d f g + 6 \, a b c d^{2} f g - 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 + 7 \, b^{2} c^{3} f h - 10 \, a b c^{2} d f h + 3 \, a^{2} c d^{2} f 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^{4}} - \frac {\sqrt {f x + e} b^{2} c^{2} d f g - 2 \, \sqrt {f x + e} a b c d^{2} f g + \sqrt {f x + e} a^{2} d^{3} f g - \sqrt {f x + e} b^{2} c^{3} f h + 2 \, \sqrt {f x + e} a b c^{2} d f h - \sqrt {f x + e} a^{2} c d^{2} f h}{{\left ({\left (f x + e\right )} d - d e + c f\right )} d^{4}} + \frac {2 \, {\left (5 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{2} d^{8} f^{9} g - 30 \, \sqrt {f x + e} b^{2} c d^{7} f^{10} g + 30 \, \sqrt {f x + e} a b d^{8} f^{10} g + 3 \, {\left (f x + e\right )}^{\frac {5}{2}} b^{2} d^{8} f^{8} h - 5 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{2} d^{8} e f^{8} h - 10 \, {\left (f x + e\right )}^{\frac {3}{2}} b^{2} c d^{7} f^{9} h + 10 \, {\left (f x + e\right )}^{\frac {3}{2}} a b d^{8} f^{9} h + 45 \, \sqrt {f x + e} b^{2} c^{2} d^{6} f^{10} h - 60 \, \sqrt {f x + e} a b c d^{7} f^{10} h + 15 \, \sqrt {f x + e} a^{2} d^{8} f^{10} h\right )}}{15 \, d^{10} f^{10}} \] Input:

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

Output:

-(4*b^2*c*d^2*e*g - 4*a*b*d^3*e*g - 5*b^2*c^2*d*f*g + 6*a*b*c*d^2*f*g - 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 + 7*b^2*c^3* 
f*h - 10*a*b*c^2*d*f*h + 3*a^2*c*d^2*f*h)*arctan(sqrt(f*x + e)*d/sqrt(-d^2 
*e + c*d*f))/(sqrt(-d^2*e + c*d*f)*d^4) - (sqrt(f*x + e)*b^2*c^2*d*f*g - 2 
*sqrt(f*x + e)*a*b*c*d^2*f*g + sqrt(f*x + e)*a^2*d^3*f*g - sqrt(f*x + e)*b 
^2*c^3*f*h + 2*sqrt(f*x + e)*a*b*c^2*d*f*h - sqrt(f*x + e)*a^2*c*d^2*f*h)/ 
(((f*x + e)*d - d*e + c*f)*d^4) + 2/15*(5*(f*x + e)^(3/2)*b^2*d^8*f^9*g - 
30*sqrt(f*x + e)*b^2*c*d^7*f^10*g + 30*sqrt(f*x + e)*a*b*d^8*f^10*g + 3*(f 
*x + e)^(5/2)*b^2*d^8*f^8*h - 5*(f*x + e)^(3/2)*b^2*d^8*e*f^8*h - 10*(f*x 
+ e)^(3/2)*b^2*c*d^7*f^9*h + 10*(f*x + e)^(3/2)*a*b*d^8*f^9*h + 45*sqrt(f* 
x + e)*b^2*c^2*d^6*f^10*h - 60*sqrt(f*x + e)*a*b*c*d^7*f^10*h + 15*sqrt(f* 
x + e)*a^2*d^8*f^10*h)/(d^10*f^10)
 

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

( - 45*sqrt(d)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - 
d*e)))*a**2*c**2*d**2*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**2*c*d**3*e*f**2*h + 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**3*f* 
*3*g - 45*sqrt(d)*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 + 30*sqrt(d)*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 + 15*sqrt(d)*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 + 150*sqrt(d)*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 - 120*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**2*e*f**2*h - 90*sqrt(d)*s 
qrt(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*g + 150*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**2*f**3*h*x + 60*sqrt(d)*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 - 120*sq 
rt(d)*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 - 90*sqrt(d)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(s 
qrt(d)*sqrt(c*f - d*e)))*a*b*c*d**3*f**3*g*x + 60*sqrt(d)*sqrt(c*f - d*e)* 
atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*a*b*d**4*e*f**2*g*x - 10 
5*sqrt(d)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*...