\(\int \frac {\log (x)}{x^2 (a+b x+c x^2)} \, dx\) [356]

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

Optimal result

Integrand size = 18, antiderivative size = 251 \[ \int \frac {\log (x)}{x^2 \left (a+b x+c x^2\right )} \, dx=-\frac {1}{a x}-\frac {\log (x)}{a x}-\frac {b \log ^2(x)}{2 a^2}+\frac {\left (b+\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \log (x) \log \left (1+\frac {2 c x}{b-\sqrt {b^2-4 a c}}\right )}{2 a^2}+\frac {\left (b-\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \log (x) \log \left (1+\frac {2 c x}{b+\sqrt {b^2-4 a c}}\right )}{2 a^2}+\frac {\left (b+\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \operatorname {PolyLog}\left (2,-\frac {2 c x}{b-\sqrt {b^2-4 a c}}\right )}{2 a^2}+\frac {\left (b-\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \operatorname {PolyLog}\left (2,-\frac {2 c x}{b+\sqrt {b^2-4 a c}}\right )}{2 a^2} \] Output:

-1/a/x-ln(x)/a/x-1/2*b*ln(x)^2/a^2+1/2*(b+(-2*a*c+b^2)/(-4*a*c+b^2)^(1/2)) 
*ln(x)*ln(1+2*c*x/(b-(-4*a*c+b^2)^(1/2)))/a^2+1/2*(b-(-2*a*c+b^2)/(-4*a*c+ 
b^2)^(1/2))*ln(x)*ln(1+2*c*x/(b+(-4*a*c+b^2)^(1/2)))/a^2+1/2*(b+(-2*a*c+b^ 
2)/(-4*a*c+b^2)^(1/2))*polylog(2,-2*c*x/(b-(-4*a*c+b^2)^(1/2)))/a^2+1/2*(b 
-(-2*a*c+b^2)/(-4*a*c+b^2)^(1/2))*polylog(2,-2*c*x/(b+(-4*a*c+b^2)^(1/2))) 
/a^2
 

Mathematica [A] (verified)

Time = 0.41 (sec) , antiderivative size = 255, normalized size of antiderivative = 1.02 \[ \int \frac {\log (x)}{x^2 \left (a+b x+c x^2\right )} \, dx=\frac {-\frac {2 a}{x}-\frac {2 a \log (x)}{x}-b \log ^2(x)+\left (b+\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \log (x) \log \left (\frac {b-\sqrt {b^2-4 a c}+2 c x}{b-\sqrt {b^2-4 a c}}\right )+\left (b+\frac {-b^2+2 a c}{\sqrt {b^2-4 a c}}\right ) \log (x) \log \left (\frac {b+\sqrt {b^2-4 a c}+2 c x}{b+\sqrt {b^2-4 a c}}\right )+\left (b+\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \operatorname {PolyLog}\left (2,\frac {2 c x}{-b+\sqrt {b^2-4 a c}}\right )+\left (b+\frac {-b^2+2 a c}{\sqrt {b^2-4 a c}}\right ) \operatorname {PolyLog}\left (2,-\frac {2 c x}{b+\sqrt {b^2-4 a c}}\right )}{2 a^2} \] Input:

Integrate[Log[x]/(x^2*(a + b*x + c*x^2)),x]
 

Output:

((-2*a)/x - (2*a*Log[x])/x - b*Log[x]^2 + (b + (b^2 - 2*a*c)/Sqrt[b^2 - 4* 
a*c])*Log[x]*Log[(b - Sqrt[b^2 - 4*a*c] + 2*c*x)/(b - Sqrt[b^2 - 4*a*c])] 
+ (b + (-b^2 + 2*a*c)/Sqrt[b^2 - 4*a*c])*Log[x]*Log[(b + Sqrt[b^2 - 4*a*c] 
 + 2*c*x)/(b + Sqrt[b^2 - 4*a*c])] + (b + (b^2 - 2*a*c)/Sqrt[b^2 - 4*a*c]) 
*PolyLog[2, (2*c*x)/(-b + Sqrt[b^2 - 4*a*c])] + (b + (-b^2 + 2*a*c)/Sqrt[b 
^2 - 4*a*c])*PolyLog[2, (-2*c*x)/(b + Sqrt[b^2 - 4*a*c])])/(2*a^2)
 

Rubi [A] (verified)

Time = 0.99 (sec) , antiderivative size = 251, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2804, 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 {\log (x)}{x^2 \left (a+b x+c x^2\right )} \, dx\)

\(\Big \downarrow \) 2804

\(\displaystyle \int \left (\frac {\log (x) \left (-a c+b^2+b c x\right )}{a^2 \left (a+b x+c x^2\right )}-\frac {b \log (x)}{a^2 x}+\frac {\log (x)}{a x^2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\left (\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}+b\right ) \operatorname {PolyLog}\left (2,-\frac {2 c x}{b-\sqrt {b^2-4 a c}}\right )}{2 a^2}+\frac {\left (b-\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \operatorname {PolyLog}\left (2,-\frac {2 c x}{b+\sqrt {b^2-4 a c}}\right )}{2 a^2}+\frac {\log (x) \left (\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}+b\right ) \log \left (\frac {2 c x}{b-\sqrt {b^2-4 a c}}+1\right )}{2 a^2}+\frac {\log (x) \left (b-\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \log \left (\frac {2 c x}{\sqrt {b^2-4 a c}+b}+1\right )}{2 a^2}-\frac {b \log ^2(x)}{2 a^2}-\frac {1}{a x}-\frac {\log (x)}{a x}\)

Input:

Int[Log[x]/(x^2*(a + b*x + c*x^2)),x]
 

Output:

-(1/(a*x)) - Log[x]/(a*x) - (b*Log[x]^2)/(2*a^2) + ((b + (b^2 - 2*a*c)/Sqr 
t[b^2 - 4*a*c])*Log[x]*Log[1 + (2*c*x)/(b - Sqrt[b^2 - 4*a*c])])/(2*a^2) + 
 ((b - (b^2 - 2*a*c)/Sqrt[b^2 - 4*a*c])*Log[x]*Log[1 + (2*c*x)/(b + Sqrt[b 
^2 - 4*a*c])])/(2*a^2) + ((b + (b^2 - 2*a*c)/Sqrt[b^2 - 4*a*c])*PolyLog[2, 
 (-2*c*x)/(b - Sqrt[b^2 - 4*a*c])])/(2*a^2) + ((b - (b^2 - 2*a*c)/Sqrt[b^2 
 - 4*a*c])*PolyLog[2, (-2*c*x)/(b + Sqrt[b^2 - 4*a*c])])/(2*a^2)
 

Defintions of rubi rules used

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

rule 2804
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{ 
u = ExpandIntegrand[(a + b*Log[c*x^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] / 
; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(551\) vs. \(2(225)=450\).

Time = 2.09 (sec) , antiderivative size = 552, normalized size of antiderivative = 2.20

method result size
default \(\frac {-\frac {\ln \left (x \right )}{x}-\frac {1}{x}}{a}+\frac {\frac {\ln \left (x \right ) \left (\sqrt {-4 a c +b^{2}}\, \ln \left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) b -2 \ln \left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) a c +\ln \left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) b^{2}+\ln \left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) \sqrt {-4 a c +b^{2}}\, b +2 \ln \left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) a c -\ln \left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) b^{2}\right )}{2 \sqrt {-4 a c +b^{2}}}+\frac {\sqrt {-4 a c +b^{2}}\, \operatorname {dilog}\left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) b -2 \operatorname {dilog}\left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) a c +\operatorname {dilog}\left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) b^{2}+\sqrt {-4 a c +b^{2}}\, \operatorname {dilog}\left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) b +2 \operatorname {dilog}\left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) a c -\operatorname {dilog}\left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) b^{2}}{2 \sqrt {-4 a c +b^{2}}}}{a^{2}}-\frac {b \ln \left (x \right )^{2}}{2 a^{2}}\) \(552\)
risch \(-\frac {\ln \left (x \right )}{a x}-\frac {1}{a x}+\frac {\ln \left (x \right ) \ln \left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) b}{2 a^{2}}-\frac {\ln \left (x \right ) \ln \left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) c}{a \sqrt {-4 a c +b^{2}}}+\frac {\ln \left (x \right ) \ln \left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) b^{2}}{2 a^{2} \sqrt {-4 a c +b^{2}}}+\frac {\ln \left (x \right ) \ln \left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) b}{2 a^{2}}+\frac {\ln \left (x \right ) \ln \left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) c}{a \sqrt {-4 a c +b^{2}}}-\frac {\ln \left (x \right ) \ln \left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) b^{2}}{2 a^{2} \sqrt {-4 a c +b^{2}}}+\frac {\operatorname {dilog}\left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) b}{2 a^{2}}-\frac {\operatorname {dilog}\left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) c}{a \sqrt {-4 a c +b^{2}}}+\frac {\operatorname {dilog}\left (\frac {-2 x c +\sqrt {-4 a c +b^{2}}-b}{-b +\sqrt {-4 a c +b^{2}}}\right ) b^{2}}{2 a^{2} \sqrt {-4 a c +b^{2}}}+\frac {\operatorname {dilog}\left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) b}{2 a^{2}}+\frac {\operatorname {dilog}\left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) c}{a \sqrt {-4 a c +b^{2}}}-\frac {\operatorname {dilog}\left (\frac {b +\sqrt {-4 a c +b^{2}}+2 x c}{b +\sqrt {-4 a c +b^{2}}}\right ) b^{2}}{2 a^{2} \sqrt {-4 a c +b^{2}}}-\frac {b \ln \left (x \right )^{2}}{2 a^{2}}\) \(608\)

Input:

int(ln(x)/x^2/(c*x^2+b*x+a),x,method=_RETURNVERBOSE)
 

Output:

(-ln(x)/x-1/x)/a+(1/2*ln(x)*((-4*a*c+b^2)^(1/2)*ln((-2*x*c+(-4*a*c+b^2)^(1 
/2)-b)/(-b+(-4*a*c+b^2)^(1/2)))*b-2*ln((-2*x*c+(-4*a*c+b^2)^(1/2)-b)/(-b+( 
-4*a*c+b^2)^(1/2)))*a*c+ln((-2*x*c+(-4*a*c+b^2)^(1/2)-b)/(-b+(-4*a*c+b^2)^ 
(1/2)))*b^2+ln((b+(-4*a*c+b^2)^(1/2)+2*x*c)/(b+(-4*a*c+b^2)^(1/2)))*(-4*a* 
c+b^2)^(1/2)*b+2*ln((b+(-4*a*c+b^2)^(1/2)+2*x*c)/(b+(-4*a*c+b^2)^(1/2)))*a 
*c-ln((b+(-4*a*c+b^2)^(1/2)+2*x*c)/(b+(-4*a*c+b^2)^(1/2)))*b^2)/(-4*a*c+b^ 
2)^(1/2)+1/2*((-4*a*c+b^2)^(1/2)*dilog((-2*x*c+(-4*a*c+b^2)^(1/2)-b)/(-b+( 
-4*a*c+b^2)^(1/2)))*b-2*dilog((-2*x*c+(-4*a*c+b^2)^(1/2)-b)/(-b+(-4*a*c+b^ 
2)^(1/2)))*a*c+dilog((-2*x*c+(-4*a*c+b^2)^(1/2)-b)/(-b+(-4*a*c+b^2)^(1/2)) 
)*b^2+(-4*a*c+b^2)^(1/2)*dilog((b+(-4*a*c+b^2)^(1/2)+2*x*c)/(b+(-4*a*c+b^2 
)^(1/2)))*b+2*dilog((b+(-4*a*c+b^2)^(1/2)+2*x*c)/(b+(-4*a*c+b^2)^(1/2)))*a 
*c-dilog((b+(-4*a*c+b^2)^(1/2)+2*x*c)/(b+(-4*a*c+b^2)^(1/2)))*b^2)/(-4*a*c 
+b^2)^(1/2))/a^2-1/2*b*ln(x)^2/a^2
 

Fricas [F]

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

integrate(log(x)/x^2/(c*x^2+b*x+a),x, algorithm="fricas")
 

Output:

integral(log(x)/(c*x^4 + b*x^3 + a*x^2), x)
 

Sympy [F(-1)]

Timed out. \[ \int \frac {\log (x)}{x^2 \left (a+b x+c x^2\right )} \, dx=\text {Timed out} \] Input:

integrate(ln(x)/x**2/(c*x**2+b*x+a),x)
 

Output:

Timed out
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {\log (x)}{x^2 \left (a+b x+c x^2\right )} \, dx=\text {Exception raised: ValueError} \] Input:

integrate(log(x)/x^2/(c*x^2+b*x+a),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(4*a*c-b^2>0)', see `assume?` for 
 more deta
 

Giac [F]

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

integrate(log(x)/x^2/(c*x^2+b*x+a),x, algorithm="giac")
 

Output:

integrate(log(x)/((c*x^2 + b*x + a)*x^2), x)
                                                                                    
                                                                                    
 

Mupad [F(-1)]

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

int(log(x)/(x^2*(a + b*x + c*x^2)),x)
 

Output:

int(log(x)/(x^2*(a + b*x + c*x^2)), x)
 

Reduce [F]

\[ \int \frac {\log (x)}{x^2 \left (a+b x+c x^2\right )} \, dx=\frac {-\left (\int \frac {\mathrm {log}\left (x \right )}{c \,x^{3}+b \,x^{2}+a x}d x \right ) b x -\left (\int \frac {\mathrm {log}\left (x \right )}{c \,x^{2}+b x +a}d x \right ) c x -\mathrm {log}\left (x \right )-1}{a x} \] Input:

int(log(x)/x^2/(c*x^2+b*x+a),x)
 

Output:

( - (int(log(x)/(a*x + b*x**2 + c*x**3),x)*b*x + int(log(x)/(a + b*x + c*x 
**2),x)*c*x + log(x) + 1))/(a*x)