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

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.57 (sec) , antiderivative size = 334, normalized size of antiderivative = 1.10, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {166, 27, 168, 27, 174, 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 {\sqrt {e+f x} (g+h x)}{(a+b x)^2 (c+d x)^2} \, dx\)

\(\Big \downarrow \) 166

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 168

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 174

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

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

Input:

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

Output:

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

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 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 168
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 + 1)*((e + f*x)^(p + 1)/((m + 1)*(b*c - a*d)*(b*e - a*f))), x] + S 
imp[1/((m + 1)*(b*c - a*d)*(b*e - a*f))   Int[(a + b*x)^(m + 1)*(c + d*x)^n 
*(e + f*x)^p*Simp[(a*d*f*g - b*(d*e + c*f)*g + b*c*e*h)*(m + 1) - (b*g - a* 
h)*(d*e*(n + 1) + c*f*(p + 1)) - d*f*(b*g - a*h)*(m + n + p + 3)*x, x], x], 
 x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x] && ILtQ[m, -1]
 

rule 174
Int[(((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)))/(((a_.) + (b_.)*(x_))* 
((c_.) + (d_.)*(x_))), x_] :> Simp[(b*g - a*h)/(b*c - a*d)   Int[(e + f*x)^ 
p/(a + b*x), x], x] - Simp[(d*g - c*h)/(b*c - a*d)   Int[(e + f*x)^p/(c + d 
*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, h}, x]
 

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.67 (sec) , antiderivative size = 306, normalized size of antiderivative = 1.01

method result size
pseudoelliptic \(\frac {\left (\left (-2 c e h -c f g +4 d e g \right ) b^{2}+3 a \left (\left (-\frac {2 e h}{3}-f g \right ) d +c f h \right ) b +a^{2} d f h \right ) \left (x d +c \right ) \sqrt {\left (c f -d e \right ) d}\, \left (b x +a \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}\, \left (-\frac {3 \left (x d +c \right ) \left (\left (\frac {4 d^{2} e g}{3}+c \left (-\frac {2 e h}{3}-f g \right ) d +\frac {c^{2} f h}{3}\right ) b +a d \left (\frac {\left (-2 e h -f g \right ) d}{3}+c f h \right )\right ) \left (b x +a \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )}{2}+\left (a d -b c \right ) \sqrt {\left (c f -d e \right ) d}\, \sqrt {f x +e}\, \left (\left (-d g x -\frac {c \left (-h x +g \right )}{2}\right ) b +a \left (\frac {\left (h x -g \right ) d}{2}+c h \right )\right )\right )}{\left (b x +a \right ) \left (a d -b c \right )^{3} \sqrt {\left (a f -b e \right ) b}\, \left (x d +c \right ) \sqrt {\left (c f -d e \right ) d}}\) \(306\)
derivativedivides \(2 f^{2} \left (-\frac {\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 +b \,c^{2} f h -2 b c d e h -3 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}}}{f^{2} \left (a d -b c \right )^{3}}+\frac {\frac {\left (\frac {1}{2} a^{2} d f h -\frac {1}{2} a b c f h -\frac {1}{2} a b d f g +\frac {1}{2} b^{2} c f g \right ) \sqrt {f x +e}}{\left (f x +e \right ) b +a f -b e}+\frac {\left (a^{2} d f h +3 a b c f h -2 a b d e h -3 a b d f g -2 b^{2} c e h -b^{2} c f g +4 b^{2} 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}}}{f^{2} \left (a d -b c \right )^{3}}\right )\) \(328\)
default \(2 f^{2} \left (-\frac {\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 +b \,c^{2} f h -2 b c d e h -3 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}}}{f^{2} \left (a d -b c \right )^{3}}+\frac {\frac {\left (\frac {1}{2} a^{2} d f h -\frac {1}{2} a b c f h -\frac {1}{2} a b d f g +\frac {1}{2} b^{2} c f g \right ) \sqrt {f x +e}}{\left (f x +e \right ) b +a f -b e}+\frac {\left (a^{2} d f h +3 a b c f h -2 a b d e h -3 a b d f g -2 b^{2} c e h -b^{2} c f g +4 b^{2} 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}}}{f^{2} \left (a d -b c \right )^{3}}\right )\) \(328\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2029 vs. \(2 (280) = 560\).

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

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

Output:

Too large to include
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F(-2)]

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

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

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 7.46 (sec) , antiderivative size = 26654, normalized size of antiderivative = 87.68 \[ \int \frac {\sqrt {e+f x} (g+h x)}{(a+b x)^2 (c+d x)^2} \, dx=\text {Too large to display} \] 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)*(a*d*f*h + b*c*f*h - 2*b*d*f*g))/(a^2*d^2 + b^2*c^2 - 2* 
a*b*c*d) - ((e + f*x)^(1/2)*(a*d*f^2*g - 2*a*c*f^2*h + b*c*f^2*g + a*d*e*f 
*h + b*c*e*f*h - 2*b*d*e*f*g))/(a^2*d^2 + b^2*c^2 - 2*a*b*c*d))/((e + f*x) 
*(a*d*f + b*c*f - 2*b*d*e) + b*d*(e + f*x)^2 + a*c*f^2 + b*d*e^2 - a*d*e*f 
 - b*c*e*f) - atan(((((20*a*b^8*c^6*d^3*f^4*g - 4*b^9*c^7*d^2*f^4*g - 4*a^ 
7*b^2*d^9*f^4*g + 20*a^6*b^3*c*d^8*f^4*g + 8*a*b^8*c^7*d^2*f^4*h + 8*a^7*b 
^2*c*d^8*f^4*h + 8*a^6*b^3*d^9*e*f^3*g - 4*a^7*b^2*d^9*e*f^3*h + 8*b^9*c^6 
*d^3*e*f^3*g - 4*b^9*c^7*d^2*e*f^3*h - 36*a^2*b^7*c^5*d^4*f^4*g + 20*a^3*b 
^6*c^4*d^5*f^4*g + 20*a^4*b^5*c^3*d^6*f^4*g - 36*a^5*b^4*c^2*d^7*f^4*g - 4 
8*a^2*b^7*c^6*d^3*f^4*h + 120*a^3*b^6*c^5*d^4*f^4*h - 160*a^4*b^5*c^4*d^5* 
f^4*h + 120*a^5*b^4*c^3*d^6*f^4*h - 48*a^6*b^3*c^2*d^7*f^4*h - 48*a*b^8*c^ 
5*d^4*e*f^3*g - 48*a^5*b^4*c*d^8*e*f^3*g + 20*a*b^8*c^6*d^3*e*f^3*h + 20*a 
^6*b^3*c*d^8*e*f^3*h + 120*a^2*b^7*c^4*d^5*e*f^3*g - 160*a^3*b^6*c^3*d^6*e 
*f^3*g + 120*a^4*b^5*c^2*d^7*e*f^3*g - 36*a^2*b^7*c^5*d^4*e*f^3*h + 20*a^3 
*b^6*c^4*d^5*e*f^3*h + 20*a^4*b^5*c^3*d^6*e*f^3*h - 36*a^5*b^4*c^2*d^7*e*f 
^3*h)/(a^6*d^6 + b^6*c^6 + 15*a^2*b^4*c^4*d^2 - 20*a^3*b^3*c^3*d^3 + 15*a^ 
4*b^2*c^2*d^4 - 6*a*b^5*c^5*d - 6*a^5*b*c*d^5) - (2*(e + f*x)^(1/2)*((4*a^ 
2*d^4*e^2*h^2 + a^2*d^4*f^2*g^2 + 16*b^2*d^4*e^2*g^2 + b^2*c^4*f^2*h^2 + 9 
*a^2*c^2*d^2*f^2*h^2 + 4*b^2*c^2*d^2*e^2*h^2 + 9*b^2*c^2*d^2*f^2*g^2 - 8*a 
*b*d^4*e*f*g^2 - 16*a*b*d^4*e^2*g*h + 4*a^2*d^4*e*f*g*h + 8*a*b*c*d^3*e...
 

Reduce [B] (verification not implemented)

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

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

Output:

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