Optimal. Leaf size=22 \[ (5-\log (x)) \left (-1+\log \left (4+\frac {2}{x}+2 x^2\right )\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.76, antiderivative size = 31, normalized size of antiderivative = 1.41, number of steps used = 20, number of rules used = 7, integrand size = 59, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.119, Rules used = {1594, 6742, 1587, 2357, 2301, 2524, 1593} \begin {gather*} 5 \log \left (x^3+2 x+1\right )-\log \left (2 \left (x^2+\frac {1}{x}+2\right )\right ) \log (x)-4 \log (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 1587
Rule 1593
Rule 1594
Rule 2301
Rule 2357
Rule 2524
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-4+2 x+11 x^3+\left (1-2 x^3\right ) \log (x)+\left (-1-2 x-x^3\right ) \log \left (\frac {2+4 x+2 x^3}{x}\right )}{x \left (1+2 x+x^3\right )} \, dx\\ &=\int \left (\frac {-4+2 x+11 x^3+\log (x)-2 x^3 \log (x)}{x \left (1+2 x+x^3\right )}-\frac {\log \left (2 \left (2+\frac {1}{x}+x^2\right )\right )}{x}\right ) \, dx\\ &=\int \frac {-4+2 x+11 x^3+\log (x)-2 x^3 \log (x)}{x \left (1+2 x+x^3\right )} \, dx-\int \frac {\log \left (2 \left (2+\frac {1}{x}+x^2\right )\right )}{x} \, dx\\ &=-\log (x) \log \left (2 \left (2+\frac {1}{x}+x^2\right )\right )+\int \frac {\left (-\frac {1}{x^2}+2 x\right ) \log (x)}{2+\frac {1}{x}+x^2} \, dx+\int \left (\frac {-4+2 x+11 x^3}{x \left (1+2 x+x^3\right )}+\frac {\left (1-2 x^3\right ) \log (x)}{x \left (1+2 x+x^3\right )}\right ) \, dx\\ &=-\log (x) \log \left (2 \left (2+\frac {1}{x}+x^2\right )\right )+\int \frac {-4+2 x+11 x^3}{x \left (1+2 x+x^3\right )} \, dx+\int \frac {\left (1-2 x^3\right ) \log (x)}{x \left (1+2 x+x^3\right )} \, dx+\int \frac {\left (-1+2 x^3\right ) \log (x)}{x^2 \left (2+\frac {1}{x}+x^2\right )} \, dx\\ &=-\log (x) \log \left (2 \left (2+\frac {1}{x}+x^2\right )\right )+\int \left (-\frac {4}{x}+\frac {5 \left (2+3 x^2\right )}{1+2 x+x^3}\right ) \, dx+\int \left (\frac {\log (x)}{x}+\frac {\left (-2-3 x^2\right ) \log (x)}{1+2 x+x^3}\right ) \, dx+\int \left (-\frac {\log (x)}{x}+\frac {\left (2+3 x^2\right ) \log (x)}{1+2 x+x^3}\right ) \, dx\\ &=-4 \log (x)-\log (x) \log \left (2 \left (2+\frac {1}{x}+x^2\right )\right )+5 \int \frac {2+3 x^2}{1+2 x+x^3} \, dx+\int \frac {\left (-2-3 x^2\right ) \log (x)}{1+2 x+x^3} \, dx+\int \frac {\left (2+3 x^2\right ) \log (x)}{1+2 x+x^3} \, dx\\ &=-4 \log (x)-\log (x) \log \left (2 \left (2+\frac {1}{x}+x^2\right )\right )+5 \log \left (1+2 x+x^3\right )+\int \left (-\frac {2 \log (x)}{1+2 x+x^3}-\frac {3 x^2 \log (x)}{1+2 x+x^3}\right ) \, dx+\int \left (\frac {2 \log (x)}{1+2 x+x^3}+\frac {3 x^2 \log (x)}{1+2 x+x^3}\right ) \, dx\\ &=-4 \log (x)-\log (x) \log \left (2 \left (2+\frac {1}{x}+x^2\right )\right )+5 \log \left (1+2 x+x^3\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.19, size = 31, normalized size = 1.41 \begin {gather*} -4 \log (x)-\log (x) \log \left (2 \left (2+\frac {1}{x}+x^2\right )\right )+5 \log \left (1+2 x+x^3\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.55, size = 23, normalized size = 1.05 \begin {gather*} -{\left (\log \relax (x) - 5\right )} \log \left (\frac {2 \, {\left (x^{3} + 2 \, x + 1\right )}}{x}\right ) + \log \relax (x) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 35, normalized size = 1.59 \begin {gather*} -\log \left (2 \, x^{3} + 4 \, x + 2\right ) \log \relax (x) + \log \relax (x)^{2} + 5 \, \log \left (x^{3} + 2 \, x + 1\right ) - 4 \, \log \relax (x) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.49, size = 40, normalized size = 1.82
method | result | size |
default | \(5 \ln \left (x^{3}+2 x +1\right )-4 \ln \relax (x )-\ln \relax (x ) \ln \left (\frac {x^{3}+2 x +1}{x}\right )-\ln \relax (2) \ln \relax (x )\) | \(40\) |
risch | \(-\ln \relax (x ) \ln \left (x^{3}+2 x +1\right )+\ln \relax (x )^{2}+\frac {i \pi \ln \left (\left (59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )-59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}-59 \pi \,\mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}+59 \pi \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{3}+118 i \ln \relax (2)+1062 i\right ) x \right ) \mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )}{2}-\frac {i \pi \ln \left (\left (59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )-59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}-59 \pi \,\mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}+59 \pi \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{3}+118 i \ln \relax (2)+1062 i\right ) x \right ) \mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}}{2}-\frac {i \pi \ln \left (\left (59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )-59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}-59 \pi \,\mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}+59 \pi \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{3}+118 i \ln \relax (2)+1062 i\right ) x \right ) \mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}}{2}+\frac {i \pi \ln \left (\left (59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )-59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}-59 \pi \,\mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}+59 \pi \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{3}+118 i \ln \relax (2)+1062 i\right ) x \right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{3}}{2}-\ln \relax (2) \ln \left (\left (59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )-59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}-59 \pi \,\mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}+59 \pi \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{3}+118 i \ln \relax (2)+1062 i\right ) x \right )-4 \ln \left (\left (59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )-59 \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}-59 \pi \,\mathrm {csgn}\left (i \left (x^{3}+2 x +1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{2}+59 \pi \mathrm {csgn}\left (\frac {i \left (x^{3}+2 x +1\right )}{x}\right )^{3}+118 i \ln \relax (2)+1062 i\right ) x \right )+5 \ln \left (x^{3}+2 x +1\right )\) | \(918\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.44, size = 28, normalized size = 1.27 \begin {gather*} -{\left (\log \relax (x) - 5\right )} \log \left (x^{3} + 2 \, x + 1\right ) - {\left (\log \relax (2) + 4\right )} \log \relax (x) + \log \relax (x)^{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.80, size = 35, normalized size = 1.59 \begin {gather*} 5\,\ln \left (x^3+2\,x+1\right )-4\,\ln \relax (x)-\ln \left (\frac {2\,x^3+4\,x+2}{x}\right )\,\ln \relax (x) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.36, size = 32, normalized size = 1.45 \begin {gather*} - \log {\relax (x )} \log {\left (\frac {2 x^{3} + 4 x + 2}{x} \right )} - 4 \log {\relax (x )} + 5 \log {\left (x^{3} + 2 x + 1 \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________