### 3.285 $$\int \frac{d+e x+f x^2+g x^3}{x^3 \sqrt{a+b x+c x^2}} \, dx$$

Optimal. Leaf size=159 $-\frac{\tanh ^{-1}\left (\frac{2 a+b x}{2 \sqrt{a} \sqrt{a+b x+c x^2}}\right ) \left (8 a^2 f-4 a b e-4 a c d+3 b^2 d\right )}{8 a^{5/2}}+\frac{\sqrt{a+b x+c x^2} (3 b d-4 a e)}{4 a^2 x}-\frac{d \sqrt{a+b x+c x^2}}{2 a x^2}+\frac{g \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right )}{\sqrt{c}}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.244307, antiderivative size = 159, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 33, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.152, Rules used = {1650, 843, 621, 206, 724} $-\frac{\tanh ^{-1}\left (\frac{2 a+b x}{2 \sqrt{a} \sqrt{a+b x+c x^2}}\right ) \left (8 a^2 f-4 a b e-4 a c d+3 b^2 d\right )}{8 a^{5/2}}+\frac{\sqrt{a+b x+c x^2} (3 b d-4 a e)}{4 a^2 x}-\frac{d \sqrt{a+b x+c x^2}}{2 a x^2}+\frac{g \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right )}{\sqrt{c}}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 1650

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = Polynomia
lQuotient[Pq, d + e*x, x], R = PolynomialRemainder[Pq, d + e*x, x]}, Simp[(e*R*(d + e*x)^(m + 1)*(a + b*x + c*
x^2)^(p + 1))/((m + 1)*(c*d^2 - b*d*e + a*e^2)), x] + Dist[1/((m + 1)*(c*d^2 - b*d*e + a*e^2)), Int[(d + e*x)^
(m + 1)*(a + b*x + c*x^2)^p*ExpandToSum[(m + 1)*(c*d^2 - b*d*e + a*e^2)*Q + c*d*R*(m + 1) - b*e*R*(m + p + 2)
- c*e*R*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, c, d, e, p}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] &&
NeQ[c*d^2 - b*d*e + a*e^2, 0] && LtQ[m, -1]

Rule 843

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dis
t[g/e, Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + b*x + c*x^
2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]
&&  !IGtQ[m, 0]

Rule 621

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
/; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 724

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{d+e x+f x^2+g x^3}{x^3 \sqrt{a+b x+c x^2}} \, dx &=-\frac{d \sqrt{a+b x+c x^2}}{2 a x^2}-\frac{\int \frac{\frac{1}{2} (3 b d-4 a e)+(c d-2 a f) x-2 a g x^2}{x^2 \sqrt{a+b x+c x^2}} \, dx}{2 a}\\ &=-\frac{d \sqrt{a+b x+c x^2}}{2 a x^2}+\frac{(3 b d-4 a e) \sqrt{a+b x+c x^2}}{4 a^2 x}+\frac{\int \frac{\frac{1}{4} \left (3 b^2 d-4 a b e-4 a (c d-2 a f)\right )+2 a^2 g x}{x \sqrt{a+b x+c x^2}} \, dx}{2 a^2}\\ &=-\frac{d \sqrt{a+b x+c x^2}}{2 a x^2}+\frac{(3 b d-4 a e) \sqrt{a+b x+c x^2}}{4 a^2 x}+\frac{\left (3 b^2 d-4 a c d-4 a b e+8 a^2 f\right ) \int \frac{1}{x \sqrt{a+b x+c x^2}} \, dx}{8 a^2}+g \int \frac{1}{\sqrt{a+b x+c x^2}} \, dx\\ &=-\frac{d \sqrt{a+b x+c x^2}}{2 a x^2}+\frac{(3 b d-4 a e) \sqrt{a+b x+c x^2}}{4 a^2 x}-\frac{\left (3 b^2 d-4 a c d-4 a b e+8 a^2 f\right ) \operatorname{Subst}\left (\int \frac{1}{4 a-x^2} \, dx,x,\frac{2 a+b x}{\sqrt{a+b x+c x^2}}\right )}{4 a^2}+(2 g) \operatorname{Subst}\left (\int \frac{1}{4 c-x^2} \, dx,x,\frac{b+2 c x}{\sqrt{a+b x+c x^2}}\right )\\ &=-\frac{d \sqrt{a+b x+c x^2}}{2 a x^2}+\frac{(3 b d-4 a e) \sqrt{a+b x+c x^2}}{4 a^2 x}-\frac{\left (3 b^2 d-4 a c d-4 a b e+8 a^2 f\right ) \tanh ^{-1}\left (\frac{2 a+b x}{2 \sqrt{a} \sqrt{a+b x+c x^2}}\right )}{8 a^{5/2}}+\frac{g \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right )}{\sqrt{c}}\\ \end{align*}

Mathematica [A]  time = 0.371441, size = 137, normalized size = 0.86 $\frac{\tanh ^{-1}\left (\frac{2 a+b x}{2 \sqrt{a} \sqrt{a+x (b+c x)}}\right ) \left (4 a b e+4 a (c d-2 a f)-3 b^2 d\right )}{8 a^{5/2}}+\frac{\sqrt{a+x (b+c x)} (3 b d x-2 a (d+2 e x))}{4 a^2 x^2}+\frac{g \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+x (b+c x)}}\right )}{\sqrt{c}}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.056, size = 241, normalized size = 1.5 \begin{align*}{g\ln \left ({ \left ({\frac{b}{2}}+cx \right ){\frac{1}{\sqrt{c}}}}+\sqrt{c{x}^{2}+bx+a} \right ){\frac{1}{\sqrt{c}}}}-{f\ln \left ({\frac{1}{x} \left ( 2\,a+bx+2\,\sqrt{a}\sqrt{c{x}^{2}+bx+a} \right ) } \right ){\frac{1}{\sqrt{a}}}}-{\frac{d}{2\,a{x}^{2}}\sqrt{c{x}^{2}+bx+a}}+{\frac{3\,bd}{4\,{a}^{2}x}\sqrt{c{x}^{2}+bx+a}}-{\frac{3\,{b}^{2}d}{8}\ln \left ({\frac{1}{x} \left ( 2\,a+bx+2\,\sqrt{a}\sqrt{c{x}^{2}+bx+a} \right ) } \right ){a}^{-{\frac{5}{2}}}}+{\frac{cd}{2}\ln \left ({\frac{1}{x} \left ( 2\,a+bx+2\,\sqrt{a}\sqrt{c{x}^{2}+bx+a} \right ) } \right ){a}^{-{\frac{3}{2}}}}-{\frac{e}{ax}\sqrt{c{x}^{2}+bx+a}}+{\frac{be}{2}\ln \left ({\frac{1}{x} \left ( 2\,a+bx+2\,\sqrt{a}\sqrt{c{x}^{2}+bx+a} \right ) } \right ){a}^{-{\frac{3}{2}}}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 18.345, size = 1837, normalized size = 11.55 \begin{align*} \text{result too large to display} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

[1/16*(8*a^3*sqrt(c)*g*x^2*log(-8*c^2*x^2 - 8*b*c*x - b^2 - 4*sqrt(c*x^2 + b*x + a)*(2*c*x + b)*sqrt(c) - 4*a*
c) - (4*a*b*c*e - 8*a^2*c*f - (3*b^2*c - 4*a*c^2)*d)*sqrt(a)*x^2*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*(2*a^2*c*d - (3*a*b*c*d - 4*a^2*c*e)*x)*sqrt(c*x^2 + b*x
+ a))/(a^3*c*x^2), -1/16*(16*a^3*sqrt(-c)*g*x^2*arctan(1/2*sqrt(c*x^2 + b*x + a)*(2*c*x + b)*sqrt(-c)/(c^2*x^2
+ b*c*x + a*c)) + (4*a*b*c*e - 8*a^2*c*f - (3*b^2*c - 4*a*c^2)*d)*sqrt(a)*x^2*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*(2*a^2*c*d - (3*a*b*c*d - 4*a^2*c*e)*x)*sqr
t(c*x^2 + b*x + a))/(a^3*c*x^2), 1/8*(4*a^3*sqrt(c)*g*x^2*log(-8*c^2*x^2 - 8*b*c*x - b^2 - 4*sqrt(c*x^2 + b*x
+ a)*(2*c*x + b)*sqrt(c) - 4*a*c) - (4*a*b*c*e - 8*a^2*c*f - (3*b^2*c - 4*a*c^2)*d)*sqrt(-a)*x^2*arctan(1/2*sq
rt(c*x^2 + b*x + a)*(b*x + 2*a)*sqrt(-a)/(a*c*x^2 + a*b*x + a^2)) - 2*(2*a^2*c*d - (3*a*b*c*d - 4*a^2*c*e)*x)*
sqrt(c*x^2 + b*x + a))/(a^3*c*x^2), -1/8*(8*a^3*sqrt(-c)*g*x^2*arctan(1/2*sqrt(c*x^2 + b*x + a)*(2*c*x + b)*sq
rt(-c)/(c^2*x^2 + b*c*x + a*c)) + (4*a*b*c*e - 8*a^2*c*f - (3*b^2*c - 4*a*c^2)*d)*sqrt(-a)*x^2*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)) + 2*(2*a^2*c*d - (3*a*b*c*d - 4*a^2*c*e)*x)*sq
rt(c*x^2 + b*x + a))/(a^3*c*x^2)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{d + e x + f x^{2} + g x^{3}}{x^{3} \sqrt{a + b x + c x^{2}}}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral((d + e*x + f*x**2 + g*x**3)/(x**3*sqrt(a + b*x + c*x**2)), x)

________________________________________________________________________________________

Giac [B]  time = 1.29618, size = 475, normalized size = 2.99 \begin{align*} -\frac{g \log \left ({\left | -2 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )} c - b \sqrt{c} \right |}\right )}{\sqrt{c}} + \frac{{\left (3 \, b^{2} d - 4 \, a c d + 8 \, a^{2} f - 4 \, a b e\right )} \arctan \left (-\frac{\sqrt{c} x - \sqrt{c x^{2} + b x + a}}{\sqrt{-a}}\right )}{4 \, \sqrt{-a} a^{2}} - \frac{3 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )}^{3} b^{2} d - 4 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )}^{3} a c d - 4 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )}^{3} a b e - 8 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )}^{2} a^{2} \sqrt{c} e - 5 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )} a b^{2} d - 4 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )} a^{2} c d + 4 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )} a^{2} b e - 8 \, a^{2} b \sqrt{c} d + 8 \, a^{3} \sqrt{c} e}{4 \,{\left ({\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )}^{2} - a\right )}^{2} a^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-g*log(abs(-2*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))*c - b*sqrt(c)))/sqrt(c) + 1/4*(3*b^2*d - 4*a*c*d + 8*a^2*f -
4*a*b*e)*arctan(-(sqrt(c)*x - sqrt(c*x^2 + b*x + a))/sqrt(-a))/(sqrt(-a)*a^2) - 1/4*(3*(sqrt(c)*x - sqrt(c*x^
2 + b*x + a))^3*b^2*d - 4*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))^3*a*c*d - 4*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))^
3*a*b*e - 8*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))^2*a^2*sqrt(c)*e - 5*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))*a*b^2*
d - 4*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))*a^2*c*d + 4*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))*a^2*b*e - 8*a^2*b*sq
rt(c)*d + 8*a^3*sqrt(c)*e)/(((sqrt(c)*x - sqrt(c*x^2 + b*x + a))^2 - a)^2*a^2)