\(\int \frac {A+B x}{x^2 (d+e x) \sqrt {a+b x+c x^2}} \, dx\) [18]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [F]
Giac [A] (verification not implemented)
Mupad [F(-1)]
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 30, antiderivative size = 177 \[ \int \frac {A+B x}{x^2 (d+e x) \sqrt {a+b x+c x^2}} \, dx=-\frac {A \sqrt {a+b x+c x^2}}{a d x}+\frac {(A b d-2 a B d+2 a A e) \text {arctanh}\left (\frac {2 a+b x}{2 \sqrt {a} \sqrt {a+b x+c x^2}}\right )}{2 a^{3/2} d^2}-\frac {e (B d-A e) \text {arctanh}\left (\frac {b d-2 a e+(2 c d-b e) x}{2 \sqrt {c d^2-b d e+a e^2} \sqrt {a+b x+c x^2}}\right )}{d^2 \sqrt {c d^2-b d e+a e^2}} \] Output:

-A*(c*x^2+b*x+a)^(1/2)/a/d/x+1/2*(2*A*a*e+A*b*d-2*B*a*d)*arctanh(1/2*(b*x+ 
2*a)/a^(1/2)/(c*x^2+b*x+a)^(1/2))/a^(3/2)/d^2-e*(-A*e+B*d)*arctanh(1/2*(b* 
d-2*a*e+(-b*e+2*c*d)*x)/(a*e^2-b*d*e+c*d^2)^(1/2)/(c*x^2+b*x+a)^(1/2))/d^2 
/(a*e^2-b*d*e+c*d^2)^(1/2)
 

Mathematica [A] (verified)

Time = 1.50 (sec) , antiderivative size = 213, normalized size of antiderivative = 1.20 \[ \int \frac {A+B x}{x^2 (d+e x) \sqrt {a+b x+c x^2}} \, dx=-\frac {\frac {2 A d \sqrt {a+x (b+c x)}}{a x}+\frac {4 e (B d-A e) \sqrt {-c d^2+e (b d-a e)} \arctan \left (\frac {\sqrt {-c d^2+e (b d-a e)} x}{\sqrt {a} (d+e x)-d \sqrt {a+x (b+c x)}}\right )}{c d^2+e (-b d+a e)}-\frac {(A b d-2 a B d+2 a A e) \log (x)}{a^{3/2}}+\frac {(A b d-2 a B d+2 a A e) \log \left (a d^2 \left (2 a+b x-2 \sqrt {a} \sqrt {a+x (b+c x)}\right )\right )}{a^{3/2}}}{2 d^2} \] Input:

Integrate[(A + B*x)/(x^2*(d + e*x)*Sqrt[a + b*x + c*x^2]),x]
 

Output:

-1/2*((2*A*d*Sqrt[a + x*(b + c*x)])/(a*x) + (4*e*(B*d - A*e)*Sqrt[-(c*d^2) 
 + e*(b*d - a*e)]*ArcTan[(Sqrt[-(c*d^2) + e*(b*d - a*e)]*x)/(Sqrt[a]*(d + 
e*x) - d*Sqrt[a + x*(b + c*x)])])/(c*d^2 + e*(-(b*d) + a*e)) - ((A*b*d - 2 
*a*B*d + 2*a*A*e)*Log[x])/a^(3/2) + ((A*b*d - 2*a*B*d + 2*a*A*e)*Log[a*d^2 
*(2*a + b*x - 2*Sqrt[a]*Sqrt[a + x*(b + c*x)])])/a^(3/2))/d^2
 

Rubi [A] (verified)

Time = 0.93 (sec) , antiderivative size = 213, normalized size of antiderivative = 1.20, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {2153, 2009}

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}{x^2 (d+e x) \sqrt {a+b x+c x^2}} \, dx\)

\(\Big \downarrow \) 2153

\(\displaystyle \int \left (\frac {B d-A e}{d^2 x \sqrt {a+b x+c x^2}}-\frac {e (B d-A e)}{d^2 (d+e x) \sqrt {a+b x+c x^2}}+\frac {A}{d x^2 \sqrt {a+b x+c x^2}}\right )dx\)

\(\Big \downarrow \) 2009

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

Input:

Int[(A + B*x)/(x^2*(d + e*x)*Sqrt[a + b*x + c*x^2]),x]
 

Output:

-((A*Sqrt[a + b*x + c*x^2])/(a*d*x)) + (A*b*ArcTanh[(2*a + b*x)/(2*Sqrt[a] 
*Sqrt[a + b*x + c*x^2])])/(2*a^(3/2)*d) - ((B*d - A*e)*ArcTanh[(2*a + b*x) 
/(2*Sqrt[a]*Sqrt[a + b*x + c*x^2])])/(Sqrt[a]*d^2) - (e*(B*d - A*e)*ArcTan 
h[(b*d - 2*a*e + (2*c*d - b*e)*x)/(2*Sqrt[c*d^2 - b*d*e + a*e^2]*Sqrt[a + 
b*x + c*x^2])])/(d^2*Sqrt[c*d^2 - b*d*e + a*e^2])
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2153
Int[(Px_)*((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.)*((a_.) + (b 
_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Px*(d + e* 
x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, 
 m, n, p}, x] && PolyQ[Px, x] && (IntegerQ[p] || (IntegerQ[2*p] && IntegerQ 
[m] && ILtQ[n, 0])) &&  !(IGtQ[m, 0] && IGtQ[n, 0])
 
Maple [A] (verified)

Time = 0.63 (sec) , antiderivative size = 252, normalized size of antiderivative = 1.42

method result size
risch \(-\frac {A \sqrt {c \,x^{2}+b x +a}}{a d x}-\frac {-\frac {\left (2 A a e +A b d -2 B a d \right ) \ln \left (\frac {2 a +b x +2 \sqrt {a}\, \sqrt {c \,x^{2}+b x +a}}{x}\right )}{d \sqrt {a}}+\frac {2 a \left (A e -B d \right ) \ln \left (\frac {\frac {2 a \,e^{2}-2 b d e +2 c \,d^{2}}{e^{2}}+\frac {\left (b e -2 c d \right ) \left (x +\frac {d}{e}\right )}{e}+2 \sqrt {\frac {a \,e^{2}-b d e +c \,d^{2}}{e^{2}}}\, \sqrt {\left (x +\frac {d}{e}\right )^{2} c +\frac {\left (b e -2 c d \right ) \left (x +\frac {d}{e}\right )}{e}+\frac {a \,e^{2}-b d e +c \,d^{2}}{e^{2}}}}{x +\frac {d}{e}}\right )}{d \sqrt {\frac {a \,e^{2}-b d e +c \,d^{2}}{e^{2}}}}}{2 a d}\) \(252\)
default \(\frac {A \left (-\frac {\sqrt {c \,x^{2}+b x +a}}{a x}+\frac {b \ln \left (\frac {2 a +b x +2 \sqrt {a}\, \sqrt {c \,x^{2}+b x +a}}{x}\right )}{2 a^{\frac {3}{2}}}\right )}{d}+\frac {\left (A e -B d \right ) \ln \left (\frac {2 a +b x +2 \sqrt {a}\, \sqrt {c \,x^{2}+b x +a}}{x}\right )}{d^{2} \sqrt {a}}-\frac {\left (A e -B d \right ) \ln \left (\frac {\frac {2 a \,e^{2}-2 b d e +2 c \,d^{2}}{e^{2}}+\frac {\left (b e -2 c d \right ) \left (x +\frac {d}{e}\right )}{e}+2 \sqrt {\frac {a \,e^{2}-b d e +c \,d^{2}}{e^{2}}}\, \sqrt {\left (x +\frac {d}{e}\right )^{2} c +\frac {\left (b e -2 c d \right ) \left (x +\frac {d}{e}\right )}{e}+\frac {a \,e^{2}-b d e +c \,d^{2}}{e^{2}}}}{x +\frac {d}{e}}\right )}{d^{2} \sqrt {\frac {a \,e^{2}-b d e +c \,d^{2}}{e^{2}}}}\) \(271\)

Input:

int((B*x+A)/x^2/(e*x+d)/(c*x^2+b*x+a)^(1/2),x,method=_RETURNVERBOSE)
 

Output:

-A*(c*x^2+b*x+a)^(1/2)/a/d/x-1/2/a/d*(-(2*A*a*e+A*b*d-2*B*a*d)/d/a^(1/2)*l 
n((2*a+b*x+2*a^(1/2)*(c*x^2+b*x+a)^(1/2))/x)+2*a*(A*e-B*d)/d/((a*e^2-b*d*e 
+c*d^2)/e^2)^(1/2)*ln((2*(a*e^2-b*d*e+c*d^2)/e^2+(b*e-2*c*d)/e*(x+d/e)+2*( 
(a*e^2-b*d*e+c*d^2)/e^2)^(1/2)*((x+d/e)^2*c+(b*e-2*c*d)/e*(x+d/e)+(a*e^2-b 
*d*e+c*d^2)/e^2)^(1/2))/(x+d/e)))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 351 vs. \(2 (158) = 316\).

Time = 8.25 (sec) , antiderivative size = 1504, normalized size of antiderivative = 8.50 \[ \int \frac {A+B x}{x^2 (d+e x) \sqrt {a+b x+c x^2}} \, dx=\text {Too large to display} \] Input:

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

Output:

[-1/4*(2*(B*a^2*d*e - A*a^2*e^2)*sqrt(c*d^2 - b*d*e + a*e^2)*x*log((8*a*b* 
d*e - 8*a^2*e^2 - (b^2 + 4*a*c)*d^2 - (8*c^2*d^2 - 8*b*c*d*e + (b^2 + 4*a* 
c)*e^2)*x^2 - 4*sqrt(c*d^2 - b*d*e + a*e^2)*sqrt(c*x^2 + b*x + a)*(b*d - 2 
*a*e + (2*c*d - b*e)*x) - 2*(4*b*c*d^2 + 4*a*b*e^2 - (3*b^2 + 4*a*c)*d*e)* 
x)/(e^2*x^2 + 2*d*e*x + d^2)) - (2*A*a^2*e^3 - (2*B*a - A*b)*c*d^3 + (2*B* 
a*b - A*b^2 + 2*A*a*c)*d^2*e - (2*B*a^2 + A*a*b)*d*e^2)*sqrt(a)*x*log(-(8* 
a*b*x + (b^2 + 4*a*c)*x^2 + 4*sqrt(c*x^2 + b*x + a)*(b*x + 2*a)*sqrt(a) + 
8*a^2)/x^2) + 4*(A*a*c*d^3 - A*a*b*d^2*e + A*a^2*d*e^2)*sqrt(c*x^2 + b*x + 
 a))/((a^2*c*d^4 - a^2*b*d^3*e + a^3*d^2*e^2)*x), -1/4*(4*(B*a^2*d*e - A*a 
^2*e^2)*sqrt(-c*d^2 + b*d*e - a*e^2)*x*arctan(-1/2*sqrt(-c*d^2 + b*d*e - a 
*e^2)*sqrt(c*x^2 + b*x + a)*(b*d - 2*a*e + (2*c*d - b*e)*x)/(a*c*d^2 - a*b 
*d*e + a^2*e^2 + (c^2*d^2 - b*c*d*e + a*c*e^2)*x^2 + (b*c*d^2 - b^2*d*e + 
a*b*e^2)*x)) - (2*A*a^2*e^3 - (2*B*a - A*b)*c*d^3 + (2*B*a*b - A*b^2 + 2*A 
*a*c)*d^2*e - (2*B*a^2 + A*a*b)*d*e^2)*sqrt(a)*x*log(-(8*a*b*x + (b^2 + 4* 
a*c)*x^2 + 4*sqrt(c*x^2 + b*x + a)*(b*x + 2*a)*sqrt(a) + 8*a^2)/x^2) + 4*( 
A*a*c*d^3 - A*a*b*d^2*e + A*a^2*d*e^2)*sqrt(c*x^2 + b*x + a))/((a^2*c*d^4 
- a^2*b*d^3*e + a^3*d^2*e^2)*x), -1/2*((2*A*a^2*e^3 - (2*B*a - A*b)*c*d^3 
+ (2*B*a*b - A*b^2 + 2*A*a*c)*d^2*e - (2*B*a^2 + A*a*b)*d*e^2)*sqrt(-a)*x* 
arctan(1/2*sqrt(c*x^2 + b*x + a)*(b*x + 2*a)*sqrt(-a)/(a*c*x^2 + a*b*x + a 
^2)) + (B*a^2*d*e - A*a^2*e^2)*sqrt(c*d^2 - b*d*e + a*e^2)*x*log((8*a*b...
 

Sympy [F]

\[ \int \frac {A+B x}{x^2 (d+e x) \sqrt {a+b x+c x^2}} \, dx=\int \frac {A + B x}{x^{2} \left (d + e x\right ) \sqrt {a + b x + c x^{2}}}\, dx \] Input:

integrate((B*x+A)/x**2/(e*x+d)/(c*x**2+b*x+a)**(1/2),x)
 

Output:

Integral((A + B*x)/(x**2*(d + e*x)*sqrt(a + b*x + c*x**2)), x)
 

Maxima [F]

\[ \int \frac {A+B x}{x^2 (d+e x) \sqrt {a+b x+c x^2}} \, dx=\int { \frac {B x + A}{\sqrt {c x^{2} + b x + a} {\left (e x + d\right )} x^{2}} \,d x } \] Input:

integrate((B*x+A)/x^2/(e*x+d)/(c*x^2+b*x+a)^(1/2),x, algorithm="maxima")
 

Output:

integrate((B*x + A)/(sqrt(c*x^2 + b*x + a)*(e*x + d)*x^2), x)
 

Giac [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 208, normalized size of antiderivative = 1.18 \[ \int \frac {A+B x}{x^2 (d+e x) \sqrt {a+b x+c x^2}} \, dx=-\frac {2 \, {\left (B d e - A e^{2}\right )} \arctan \left (-\frac {{\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} e + \sqrt {c} d}{\sqrt {-c d^{2} + b d e - a e^{2}}}\right )}{\sqrt {-c d^{2} + b d e - a e^{2}} d^{2}} + \frac {{\left (2 \, B a d - A b d - 2 \, A a e\right )} \arctan \left (-\frac {\sqrt {c} x - \sqrt {c x^{2} + b x + a}}{\sqrt {-a}}\right )}{\sqrt {-a} a d^{2}} + \frac {{\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} A b + 2 \, A a \sqrt {c}}{{\left ({\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} - a\right )} a d} \] Input:

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

Output:

-2*(B*d*e - A*e^2)*arctan(-((sqrt(c)*x - sqrt(c*x^2 + b*x + a))*e + sqrt(c 
)*d)/sqrt(-c*d^2 + b*d*e - a*e^2))/(sqrt(-c*d^2 + b*d*e - a*e^2)*d^2) + (2 
*B*a*d - A*b*d - 2*A*a*e)*arctan(-(sqrt(c)*x - sqrt(c*x^2 + b*x + a))/sqrt 
(-a))/(sqrt(-a)*a*d^2) + ((sqrt(c)*x - sqrt(c*x^2 + b*x + a))*A*b + 2*A*a* 
sqrt(c))/(((sqrt(c)*x - sqrt(c*x^2 + b*x + a))^2 - a)*a*d)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {A+B x}{x^2 (d+e x) \sqrt {a+b x+c x^2}} \, dx=\int \frac {A+B\,x}{x^2\,\left (d+e\,x\right )\,\sqrt {c\,x^2+b\,x+a}} \,d x \] Input:

int((A + B*x)/(x^2*(d + e*x)*(a + b*x + c*x^2)^(1/2)),x)
 

Output:

int((A + B*x)/(x^2*(d + e*x)*(a + b*x + c*x^2)^(1/2)), x)
 

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 535, normalized size of antiderivative = 3.02 \[ \int \frac {A+B x}{x^2 (d+e x) \sqrt {a+b x+c x^2}} \, dx=\frac {2 \sqrt {a \,e^{2}-b d e +c \,d^{2}}\, \mathrm {log}\left (2 \sqrt {c \,x^{2}+b x +a}\, \sqrt {a \,e^{2}-b d e +c \,d^{2}}-2 a e +b d -b e x +2 c d x \right ) a^{2} e^{2} x -2 \sqrt {a \,e^{2}-b d e +c \,d^{2}}\, \mathrm {log}\left (2 \sqrt {c \,x^{2}+b x +a}\, \sqrt {a \,e^{2}-b d e +c \,d^{2}}-2 a e +b d -b e x +2 c d x \right ) a b d e x -2 \sqrt {a \,e^{2}-b d e +c \,d^{2}}\, \mathrm {log}\left (e x +d \right ) a^{2} e^{2} x +2 \sqrt {a \,e^{2}-b d e +c \,d^{2}}\, \mathrm {log}\left (e x +d \right ) a b d e x -2 \sqrt {c \,x^{2}+b x +a}\, a^{2} d \,e^{2}+2 \sqrt {c \,x^{2}+b x +a}\, a b \,d^{2} e -2 \sqrt {c \,x^{2}+b x +a}\, a c \,d^{3}+2 \sqrt {a}\, \mathrm {log}\left (-2 \sqrt {a}\, \sqrt {c \,x^{2}+b x +a}-2 a -b x \right ) a^{2} e^{3} x -3 \sqrt {a}\, \mathrm {log}\left (-2 \sqrt {a}\, \sqrt {c \,x^{2}+b x +a}-2 a -b x \right ) a b d \,e^{2} x +2 \sqrt {a}\, \mathrm {log}\left (-2 \sqrt {a}\, \sqrt {c \,x^{2}+b x +a}-2 a -b x \right ) a c \,d^{2} e x +\sqrt {a}\, \mathrm {log}\left (-2 \sqrt {a}\, \sqrt {c \,x^{2}+b x +a}-2 a -b x \right ) b^{2} d^{2} e x -\sqrt {a}\, \mathrm {log}\left (-2 \sqrt {a}\, \sqrt {c \,x^{2}+b x +a}-2 a -b x \right ) b c \,d^{3} x -2 \sqrt {a}\, \mathrm {log}\left (x \right ) a^{2} e^{3} x +3 \sqrt {a}\, \mathrm {log}\left (x \right ) a b d \,e^{2} x -2 \sqrt {a}\, \mathrm {log}\left (x \right ) a c \,d^{2} e x -\sqrt {a}\, \mathrm {log}\left (x \right ) b^{2} d^{2} e x +\sqrt {a}\, \mathrm {log}\left (x \right ) b c \,d^{3} x}{2 a \,d^{2} x \left (a \,e^{2}-b d e +c \,d^{2}\right )} \] Input:

int((B*x+A)/x^2/(e*x+d)/(c*x^2+b*x+a)^(1/2),x)
 

Output:

(2*sqrt(a*e**2 - b*d*e + c*d**2)*log(2*sqrt(a + b*x + c*x**2)*sqrt(a*e**2 
- b*d*e + c*d**2) - 2*a*e + b*d - b*e*x + 2*c*d*x)*a**2*e**2*x - 2*sqrt(a* 
e**2 - b*d*e + c*d**2)*log(2*sqrt(a + b*x + c*x**2)*sqrt(a*e**2 - b*d*e + 
c*d**2) - 2*a*e + b*d - b*e*x + 2*c*d*x)*a*b*d*e*x - 2*sqrt(a*e**2 - b*d*e 
 + c*d**2)*log(d + e*x)*a**2*e**2*x + 2*sqrt(a*e**2 - b*d*e + c*d**2)*log( 
d + e*x)*a*b*d*e*x - 2*sqrt(a + b*x + c*x**2)*a**2*d*e**2 + 2*sqrt(a + b*x 
 + c*x**2)*a*b*d**2*e - 2*sqrt(a + b*x + c*x**2)*a*c*d**3 + 2*sqrt(a)*log( 
 - 2*sqrt(a)*sqrt(a + b*x + c*x**2) - 2*a - b*x)*a**2*e**3*x - 3*sqrt(a)*l 
og( - 2*sqrt(a)*sqrt(a + b*x + c*x**2) - 2*a - b*x)*a*b*d*e**2*x + 2*sqrt( 
a)*log( - 2*sqrt(a)*sqrt(a + b*x + c*x**2) - 2*a - b*x)*a*c*d**2*e*x + sqr 
t(a)*log( - 2*sqrt(a)*sqrt(a + b*x + c*x**2) - 2*a - b*x)*b**2*d**2*e*x - 
sqrt(a)*log( - 2*sqrt(a)*sqrt(a + b*x + c*x**2) - 2*a - b*x)*b*c*d**3*x - 
2*sqrt(a)*log(x)*a**2*e**3*x + 3*sqrt(a)*log(x)*a*b*d*e**2*x - 2*sqrt(a)*l 
og(x)*a*c*d**2*e*x - sqrt(a)*log(x)*b**2*d**2*e*x + sqrt(a)*log(x)*b*c*d** 
3*x)/(2*a*d**2*x*(a*e**2 - b*d*e + c*d**2))