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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (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 = 27, antiderivative size = 124 \[ \int \frac {(a+b x) (g+h x)}{(c+d x) \sqrt {e+f x}} \, dx=-\frac {2 (b (d e+c f) h-d f (b g+a h)) \sqrt {e+f x}}{d^2 f^2}+\frac {2 b h (e+f x)^{3/2}}{3 d f^2}+\frac {2 (b c-a d) (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}} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.25 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.92, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {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) (g+h x)}{(c+d x) \sqrt {e+f x}} \, dx\)

\(\Big \downarrow \) 164

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

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

Input:

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

Output:

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

Defintions of rubi rules used

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 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.39 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.90

method result size
risch \(\frac {2 \left (h b d f x +3 a d f h -3 b c f h -2 b d e h +3 b g d f \right ) \sqrt {f x +e}}{3 f^{2} d^{2}}-\frac {2 \left (a c d h -a \,d^{2} g -b \,c^{2} h +b c d g \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )}{d^{2} \sqrt {\left (c f -d e \right ) d}}\) \(112\)
pseudoelliptic \(\frac {-2 f^{2} \left (c h -d g \right ) \left (a d -b c \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )+2 \left (\left (\left (\left (\frac {h x}{3}+g \right ) b +a h \right ) f -\frac {2 e h b}{3}\right ) d -b c f h \right ) \sqrt {f x +e}\, \sqrt {\left (c f -d e \right ) d}}{f^{2} d^{2} \sqrt {\left (c f -d e \right ) d}}\) \(114\)
derivativedivides \(\frac {\frac {2 \left (\frac {d h \left (f x +e \right )^{\frac {3}{2}} b}{3}+a d f h \sqrt {f x +e}-b c f h \sqrt {f x +e}-b d e h \sqrt {f x +e}+b d f g \sqrt {f x +e}\right )}{d^{2}}-\frac {2 f^{2} \left (a c d h -a \,d^{2} g -b \,c^{2} h +b c d g \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )}{d^{2} \sqrt {\left (c f -d e \right ) d}}}{f^{2}}\) \(141\)
default \(\frac {\frac {2 \left (\frac {d h \left (f x +e \right )^{\frac {3}{2}} b}{3}+a d f h \sqrt {f x +e}-b c f h \sqrt {f x +e}-b d e h \sqrt {f x +e}+b d f g \sqrt {f x +e}\right )}{d^{2}}-\frac {2 f^{2} \left (a c d h -a \,d^{2} g -b \,c^{2} h +b c d g \right ) \arctan \left (\frac {d \sqrt {f x +e}}{\sqrt {\left (c f -d e \right ) d}}\right )}{d^{2} \sqrt {\left (c f -d e \right ) d}}}{f^{2}}\) \(141\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [A] (verification not implemented)

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

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

Output:

Piecewise((2*(b*h*(e + f*x)**(3/2)/(3*d*f) + sqrt(e + f*x)*(a*d*f*h - b*c* 
f*h - b*d*e*h + b*d*f*g)/(d**2*f) - f*(a*d - b*c)*(c*h - d*g)*atan(sqrt(e 
+ f*x)/sqrt((c*f - d*e)/d))/(d**3*sqrt((c*f - d*e)/d)))/f, Ne(f, 0)), ((b* 
h*x**2/(2*d) + x*(a*d*h - b*c*h + b*d*g)/d**2 - (a*d - b*c)*(c*h - d*g)*Pi 
ecewise((x/c, Eq(d, 0)), (log(c + d*x)/d, True))/d**2)/sqrt(e), True))
 

Maxima [F(-2)]

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

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

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

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

(2*( - 3*sqrt(d)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f 
- d*e)))*a*c*d*f**2*h + 3*sqrt(d)*sqrt(c*f - d*e)*atan((sqrt(e + f*x)*d)/( 
sqrt(d)*sqrt(c*f - d*e)))*a*d**2*f**2*g + 3*sqrt(d)*sqrt(c*f - d*e)*atan(( 
sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*b*c**2*f**2*h - 3*sqrt(d)*sqrt 
(c*f - d*e)*atan((sqrt(e + f*x)*d)/(sqrt(d)*sqrt(c*f - d*e)))*b*c*d*f**2*g 
 + 3*sqrt(e + f*x)*a*c*d**2*f**2*h - 3*sqrt(e + f*x)*a*d**3*e*f*h - 3*sqrt 
(e + f*x)*b*c**2*d*f**2*h + sqrt(e + f*x)*b*c*d**2*e*f*h + 3*sqrt(e + f*x) 
*b*c*d**2*f**2*g + sqrt(e + f*x)*b*c*d**2*f**2*h*x + 2*sqrt(e + f*x)*b*d** 
3*e**2*h - 3*sqrt(e + f*x)*b*d**3*e*f*g - sqrt(e + f*x)*b*d**3*e*f*h*x))/( 
3*d**3*f**2*(c*f - d*e))