Optimal. Leaf size=29 \[ -3+x+x \log (x) \left (x^2-\frac {-4+x-\log (x)}{-1+x^2}+\log (x)\right ) \]
[Out]
________________________________________________________________________________________
Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(143\) vs. \(2(29)=58\).
time = 0.29, antiderivative size = 143, normalized size of antiderivative = 4.93, number of steps
used = 38, number of rules used = 20, integrand size = 71, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.282, Rules used = {28, 6874,
205, 213, 267, 294, 272, 45, 327, 308, 2404, 2332, 2354, 2438, 2351, 31, 2352, 2341, 2333, 2355}
\begin {gather*} \frac {x^3}{2}+x^3 \log (x)-\frac {1}{2} \log \left (1-x^2\right )+\frac {x^5}{2 \left (1-x^2\right )}-\frac {x^3}{2 \left (1-x^2\right )}+x-\frac {x \log ^2(x)}{2 (1-x)}-\frac {x \log ^2(x)}{2 (x+1)}+x \log ^2(x)-\frac {3 x \log (x)}{2 (1-x)}-\frac {5 x \log (x)}{2 (x+1)}-\frac {3}{2} \log (1-x)+\frac {5}{2} \log (x+1)-4 \tanh ^{-1}(x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 28
Rule 31
Rule 45
Rule 205
Rule 213
Rule 267
Rule 272
Rule 294
Rule 308
Rule 327
Rule 2332
Rule 2333
Rule 2341
Rule 2351
Rule 2352
Rule 2354
Rule 2355
Rule 2404
Rule 2438
Rule 6874
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-3+x+3 x^2-x^3-x^4+x^6+\left (-4+2 x-3 x^2-4 x^4+3 x^6\right ) \log (x)+\left (-3 x^2+x^4\right ) \log ^2(x)}{\left (-1+x^2\right )^2} \, dx\\ &=\int \left (-\frac {3}{\left (-1+x^2\right )^2}+\frac {x}{\left (-1+x^2\right )^2}+\frac {3 x^2}{\left (-1+x^2\right )^2}-\frac {x^3}{\left (-1+x^2\right )^2}-\frac {x^4}{\left (-1+x^2\right )^2}+\frac {x^6}{\left (-1+x^2\right )^2}+\frac {\left (-4+2 x-3 x^2-4 x^4+3 x^6\right ) \log (x)}{\left (-1+x^2\right )^2}+\frac {x^2 \left (-3+x^2\right ) \log ^2(x)}{\left (-1+x^2\right )^2}\right ) \, dx\\ &=-\left (3 \int \frac {1}{\left (-1+x^2\right )^2} \, dx\right )+3 \int \frac {x^2}{\left (-1+x^2\right )^2} \, dx+\int \frac {x}{\left (-1+x^2\right )^2} \, dx-\int \frac {x^3}{\left (-1+x^2\right )^2} \, dx-\int \frac {x^4}{\left (-1+x^2\right )^2} \, dx+\int \frac {x^6}{\left (-1+x^2\right )^2} \, dx+\int \frac {\left (-4+2 x-3 x^2-4 x^4+3 x^6\right ) \log (x)}{\left (-1+x^2\right )^2} \, dx+\int \frac {x^2 \left (-3+x^2\right ) \log ^2(x)}{\left (-1+x^2\right )^2} \, dx\\ &=\frac {1}{2 \left (1-x^2\right )}-\frac {x^3}{2 \left (1-x^2\right )}+\frac {x^5}{2 \left (1-x^2\right )}-\frac {1}{2} \text {Subst}\left (\int \frac {x}{(-1+x)^2} \, dx,x,x^2\right )+2 \left (\frac {3}{2} \int \frac {1}{-1+x^2} \, dx\right )-\frac {3}{2} \int \frac {x^2}{-1+x^2} \, dx+\frac {5}{2} \int \frac {x^4}{-1+x^2} \, dx+\int \left (2 \log (x)+\frac {\log (x)}{-1-x}-\frac {3 \log (x)}{2 (-1+x)^2}+\frac {\log (x)}{-1+x}+3 x^2 \log (x)-\frac {5 \log (x)}{2 (1+x)^2}\right ) \, dx+\int \left (\log ^2(x)-\frac {\log ^2(x)}{2 (-1+x)^2}-\frac {\log ^2(x)}{2 (1+x)^2}\right ) \, dx\\ &=-\frac {3 x}{2}+\frac {1}{2 \left (1-x^2\right )}-\frac {x^3}{2 \left (1-x^2\right )}+\frac {x^5}{2 \left (1-x^2\right )}-3 \tanh ^{-1}(x)-\frac {1}{2} \int \frac {\log ^2(x)}{(-1+x)^2} \, dx-\frac {1}{2} \int \frac {\log ^2(x)}{(1+x)^2} \, dx-\frac {1}{2} \text {Subst}\left (\int \left (\frac {1}{(-1+x)^2}+\frac {1}{-1+x}\right ) \, dx,x,x^2\right )-\frac {3}{2} \int \frac {1}{-1+x^2} \, dx-\frac {3}{2} \int \frac {\log (x)}{(-1+x)^2} \, dx+2 \int \log (x) \, dx+\frac {5}{2} \int \left (1+x^2+\frac {1}{-1+x^2}\right ) \, dx-\frac {5}{2} \int \frac {\log (x)}{(1+x)^2} \, dx+3 \int x^2 \log (x) \, dx+\int \frac {\log (x)}{-1-x} \, dx+\int \frac {\log (x)}{-1+x} \, dx+\int \log ^2(x) \, dx\\ &=-x+\frac {x^3}{2}-\frac {x^3}{2 \left (1-x^2\right )}+\frac {x^5}{2 \left (1-x^2\right )}-\frac {3}{2} \tanh ^{-1}(x)+2 x \log (x)-\frac {3 x \log (x)}{2 (1-x)}+x^3 \log (x)-\frac {5 x \log (x)}{2 (1+x)}+x \log ^2(x)-\frac {x \log ^2(x)}{2 (1-x)}-\frac {x \log ^2(x)}{2 (1+x)}-\log (x) \log (1+x)-\frac {1}{2} \log \left (1-x^2\right )-\text {Li}_2(1-x)-\frac {3}{2} \int \frac {1}{-1+x} \, dx-2 \int \log (x) \, dx+\frac {5}{2} \int \frac {1}{1+x} \, dx+\frac {5}{2} \int \frac {1}{-1+x^2} \, dx-\int \frac {\log (x)}{-1+x} \, dx+\int \frac {\log (x)}{1+x} \, dx+\int \frac {\log (1+x)}{x} \, dx\\ &=x+\frac {x^3}{2}-\frac {x^3}{2 \left (1-x^2\right )}+\frac {x^5}{2 \left (1-x^2\right )}-4 \tanh ^{-1}(x)-\frac {3}{2} \log (1-x)-\frac {3 x \log (x)}{2 (1-x)}+x^3 \log (x)-\frac {5 x \log (x)}{2 (1+x)}+x \log ^2(x)-\frac {x \log ^2(x)}{2 (1-x)}-\frac {x \log ^2(x)}{2 (1+x)}+\frac {5}{2} \log (1+x)-\frac {1}{2} \log \left (1-x^2\right )-\text {Li}_2(-x)-\int \frac {\log (1+x)}{x} \, dx\\ &=x+\frac {x^3}{2}-\frac {x^3}{2 \left (1-x^2\right )}+\frac {x^5}{2 \left (1-x^2\right )}-4 \tanh ^{-1}(x)-\frac {3}{2} \log (1-x)-\frac {3 x \log (x)}{2 (1-x)}+x^3 \log (x)-\frac {5 x \log (x)}{2 (1+x)}+x \log ^2(x)-\frac {x \log ^2(x)}{2 (1-x)}-\frac {x \log ^2(x)}{2 (1+x)}+\frac {5}{2} \log (1+x)-\frac {1}{2} \log \left (1-x^2\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 0.06, size = 38, normalized size = 1.31 \begin {gather*} \frac {x \left (-1+x^2+\left (4-x-x^2+x^4\right ) \log (x)+x^2 \log ^2(x)\right )}{-1+x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.60, size = 45, normalized size = 1.55
method | result | size |
risch | \(\frac {x^{3} \ln \left (x \right )^{2}}{x^{2}-1}+\frac {\left (x^{5}-x^{3}+4 x -1\right ) \ln \left (x \right )}{x^{2}-1}+x -\ln \left (x \right )\) | \(45\) |
norman | \(\frac {x^{3}+x^{3} \ln \left (x \right )^{2}+x^{5} \ln \left (x \right )-x +4 x \ln \left (x \right )-x^{2} \ln \left (x \right )-x^{3} \ln \left (x \right )}{x^{2}-1}\) | \(49\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 75 vs.
\(2 (29) = 58\).
time = 0.32, size = 75, normalized size = 2.59 \begin {gather*} \frac {1}{3} \, x^{3} + x - \frac {x^{5} - 3 \, x^{3} \log \left (x\right )^{2} - x^{3} - 3 \, {\left (x^{5} - x^{3} + 4 \, x - 1\right )} \log \left (x\right )}{3 \, {\left (x^{2} - 1\right )}} - \frac {1}{2} \, \log \left (x^{2} - 1\right ) + \frac {1}{2} \, \log \left (x + 1\right ) + \frac {1}{2} \, \log \left (x - 1\right ) - \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 43, normalized size = 1.48 \begin {gather*} \frac {x^{3} \log \left (x\right )^{2} + x^{3} + {\left (x^{5} - x^{3} - x^{2} + 4 \, x\right )} \log \left (x\right ) - x}{x^{2} - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.10, size = 37, normalized size = 1.28 \begin {gather*} \frac {x^{3} \log {\left (x \right )}^{2}}{x^{2} - 1} + x - \log {\left (x \right )} + \frac {\left (x^{5} - x^{3} + 4 x - 1\right ) \log {\left (x \right )}}{x^{2} - 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 42, normalized size = 1.45 \begin {gather*} {\left (x + \frac {x}{x^{2} - 1}\right )} \log \left (x\right )^{2} + {\left (x^{3} + \frac {4 \, x - 1}{x^{2} - 1}\right )} \log \left (x\right ) + x - \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.28, size = 43, normalized size = 1.48 \begin {gather*} x^3\,\ln \left (x\right )-\ln \left (x\right )+x\,\left ({\ln \left (x\right )}^2+1\right )-\frac {\ln \left (x\right )-x\,\left ({\ln \left (x\right )}^2+4\,\ln \left (x\right )\right )}{x^2-1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________