3.1.13 \(\int \frac {-x^2-\log (x)+2 \log ^2(x)}{-x^2 \log (x)+\log ^3(x)} \, dx\) [13]

Optimal. Leaf size=23 \[ -\frac {1}{2} \log (x-\log (x))+\frac {1}{2} \log (x+\log (x))+\text {li}(x) \]

[Out]

Li(x)-1/2*ln(x-ln(x))+1/2*ln(x+ln(x))

________________________________________________________________________________________

Rubi [A]
time = 0.15, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {6873, 6874, 6816, 2335} \begin {gather*} \text {li}(x)-\frac {1}{2} \log (x-\log (x))+\frac {1}{2} \log (x+\log (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-x^2 - Log[x] + 2*Log[x]^2)/(-(x^2*Log[x]) + Log[x]^3),x]

[Out]

-1/2*Log[x - Log[x]] + Log[x + Log[x]]/2 + LogIntegral[x]

Rule 2335

Int[Log[(c_.)*(x_)]^(-1), x_Symbol] :> Simp[LogIntegral[c*x]/c, x] /; FreeQ[c, x]

Rule 6816

Int[(u_)/(y_), x_Symbol] :> With[{q = DerivativeDivides[y, u, x]}, Simp[q*Log[RemoveContent[y, x]], x] /;  !Fa
lseQ[q]]

Rule 6873

Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =!= u]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

\begin {align*} \int \frac {-x^2-\log (x)+2 \log ^2(x)}{-x^2 \log (x)+\log ^3(x)} \, dx &=\int \frac {x^2+\log (x)-2 \log ^2(x)}{\log (x) \left (x^2-\log ^2(x)\right )} \, dx\\ &=\int \left (\frac {1-x}{2 x (x-\log (x))}+\frac {1}{\log (x)}+\frac {1+x}{2 x (x+\log (x))}\right ) \, dx\\ &=\frac {1}{2} \int \frac {1-x}{x (x-\log (x))} \, dx+\frac {1}{2} \int \frac {1+x}{x (x+\log (x))} \, dx+\int \frac {1}{\log (x)} \, dx\\ &=-\frac {1}{2} \log (x-\log (x))+\frac {1}{2} \log (x+\log (x))+\text {li}(x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 23, normalized size = 1.00 \begin {gather*} -\frac {1}{2} \log (x-\log (x))+\frac {1}{2} \log (x+\log (x))+\text {li}(x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-x^2 - Log[x] + 2*Log[x]^2)/(-(x^2*Log[x]) + Log[x]^3),x]

[Out]

-1/2*Log[x - Log[x]] + Log[x + Log[x]]/2 + LogIntegral[x]

________________________________________________________________________________________

Mathics [C] Result contains higher order function than in optimal. Order 9 vs. order 4 in optimal.
time = 1.93, size = 19, normalized size = 0.83 \begin {gather*} -\frac {\text {Log}\left [-x+\text {Log}\left [x\right ]\right ]}{2}+\frac {\text {Log}\left [x+\text {Log}\left [x\right ]\right ]}{2}+\text {li}\left [x\right ] \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[(2*Log[x]^2 - Log[x] - x^2)/(Log[x]^3 - x^2*Log[x]),x]')

[Out]

-Log[-x + Log[x]] / 2 + Log[x + Log[x]] / 2 + li[x]

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 26, normalized size = 1.13

method result size
default \(-\expIntegral \left (1, -\ln \left (x \right )\right )-\frac {\ln \left (x -\ln \left (x \right )\right )}{2}+\frac {\ln \left (x +\ln \left (x \right )\right )}{2}\) \(26\)
risch \(-\expIntegral \left (1, -\ln \left (x \right )\right )-\frac {\ln \left (x -\ln \left (x \right )\right )}{2}+\frac {\ln \left (x +\ln \left (x \right )\right )}{2}\) \(26\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-x^2-ln(x)+2*ln(x)^2)/(-x^2*ln(x)+ln(x)^3),x,method=_RETURNVERBOSE)

[Out]

-Ei(1,-ln(x))-1/2*ln(x-ln(x))+1/2*ln(x+ln(x))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2-log(x)+2*log(x)^2)/(-x^2*log(x)+log(x)^3),x, algorithm="maxima")

[Out]

integrate(1/log(x), x) + 1/2*log(x + log(x)) - 1/2*log(-x + log(x))

________________________________________________________________________________________

Fricas [A]
time = 0.33, size = 19, normalized size = 0.83 \begin {gather*} \frac {1}{2} \, \log \left (x + \log \left (x\right )\right ) - \frac {1}{2} \, \log \left (-x + \log \left (x\right )\right ) + \operatorname {log\_integral}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2-log(x)+2*log(x)^2)/(-x^2*log(x)+log(x)^3),x, algorithm="fricas")

[Out]

1/2*log(x + log(x)) - 1/2*log(-x + log(x)) + log_integral(x)

________________________________________________________________________________________

Sympy [A]
time = 0.30, size = 19, normalized size = 0.83 \begin {gather*} - \frac {\log {\left (- x + \log {\left (x \right )} \right )}}{2} + \frac {\log {\left (x + \log {\left (x \right )} \right )}}{2} + \operatorname {li}{\left (x \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x**2-ln(x)+2*ln(x)**2)/(-x**2*ln(x)+ln(x)**3),x)

[Out]

-log(-x + log(x))/2 + log(x + log(x))/2 + li(x)

________________________________________________________________________________________

Giac [A]
time = 0.01, size = 24, normalized size = 1.04 \begin {gather*} \frac {\ln \left (-x-\ln x\right )}{2}-\frac {\ln \left (x-\ln x\right )}{2}+\mathrm {Ei}\left (\ln x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2-log(x)+2*log(x)^2)/(-x^2*log(x)+log(x)^3),x)

[Out]

Ei(log(x)) - 1/2*log(x - log(x)) + 1/2*log(-x - log(x))

________________________________________________________________________________________

Mupad [B]
time = 0.27, size = 19, normalized size = 0.83 \begin {gather*} \frac {\ln \left (x+\ln \left (x\right )\right )}{2}-\frac {\ln \left (x-\ln \left (x\right )\right )}{2}+\mathrm {logint}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((log(x) - 2*log(x)^2 + x^2)/(x^2*log(x) - log(x)^3),x)

[Out]

log(x + log(x))/2 - log(x - log(x))/2 + logint(x)

________________________________________________________________________________________