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

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

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

Mathematica [A] (verified)

Time = 0.17 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.90 \[ \int \frac {(c+d x) (g+h x)}{(a+b 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 b^2 f^2}+\frac {2 (b c-a d) (b g-a h) \arctan \left (\frac {\sqrt {b} \sqrt {e+f x}}{\sqrt {-b e+a f}}\right )}{b^{5/2} \sqrt {-b e+a f}} \] Input:

Integrate[((c + d*x)*(g + h*x))/((a + b*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 
*b^2*f^2) + (2*(b*c - a*d)*(b*g - a*h)*ArcTan[(Sqrt[b]*Sqrt[e + f*x])/Sqrt 
[-(b*e) + a*f]])/(b^(5/2)*Sqrt[-(b*e) + a*f])
 

Rubi [A] (verified)

Time = 0.24 (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 {(c+d x) (g+h x)}{(a+b x) \sqrt {e+f x}} \, dx\)

\(\Big \downarrow \) 164

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

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

Input:

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

Output:

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

method result size
risch \(-\frac {2 \left (-h f d b x +3 a d f h -3 b c f h +2 b d e h -3 b d f g \right ) \sqrt {f x +e}}{3 f^{2} b^{2}}+\frac {2 \left (a^{2} d h -a b c h -a b d g +b^{2} c g \right ) \arctan \left (\frac {b \sqrt {f x +e}}{\sqrt {\left (a f -b e \right ) b}}\right )}{b^{2} \sqrt {\left (a f -b e \right ) b}}\) \(113\)
pseudoelliptic \(-\frac {2 \left (-f^{2} \left (a h -b g \right ) \left (a d -b c \right ) \arctan \left (\frac {b \sqrt {f x +e}}{\sqrt {\left (a f -b e \right ) b}}\right )+\sqrt {\left (a f -b e \right ) b}\, \sqrt {f x +e}\, \left (\left (\left (\left (-\frac {h x}{3}-g \right ) d -c h \right ) f +\frac {2 d e h}{3}\right ) b +a d f h \right )\right )}{\sqrt {\left (a f -b e \right ) b}\, f^{2} b^{2}}\) \(116\)
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 )}{b^{2}}+\frac {2 f^{2} \left (a^{2} d h -a b c h -a b d g +b^{2} c g \right ) \arctan \left (\frac {b \sqrt {f x +e}}{\sqrt {\left (a f -b e \right ) b}}\right )}{b^{2} \sqrt {\left (a f -b e \right ) b}}}{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 )}{b^{2}}+\frac {2 f^{2} \left (a^{2} d h -a b c h -a b d g +b^{2} c g \right ) \arctan \left (\frac {b \sqrt {f x +e}}{\sqrt {\left (a f -b e \right ) b}}\right )}{b^{2} \sqrt {\left (a f -b e \right ) b}}}{f^{2}}\) \(141\)

Input:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [A] (verification not implemented)

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

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

Output:

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

Maxima [F(-2)]

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

integrate((d*x+c)*(h*x+g)/(b*x+a)/(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(a*f-b*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 {(c+d x) (g+h x)}{(a+b x) \sqrt {e+f x}} \, dx=\frac {2 \, {\left (b^{2} c g - a b d g - a b c h + a^{2} d h\right )} \arctan \left (\frac {\sqrt {f x + e} b}{\sqrt {-b^{2} e + a b f}}\right )}{\sqrt {-b^{2} e + a b f} b^{2}} + \frac {2 \, {\left (3 \, \sqrt {f x + e} b^{2} d f^{5} g + {\left (f x + e\right )}^{\frac {3}{2}} b^{2} d f^{4} h - 3 \, \sqrt {f x + e} b^{2} d e f^{4} h + 3 \, \sqrt {f x + e} b^{2} c f^{5} h - 3 \, \sqrt {f x + e} a b d f^{5} h\right )}}{3 \, b^{3} f^{6}} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

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