Optimal. Leaf size=33 \[ \frac {x-x^2+2 \left (-5+\frac {3}{x}-x^2-\log (2)+\log (1+x)\right )}{x} \]
________________________________________________________________________________________
Rubi [A] time = 0.33, antiderivative size = 27, normalized size of antiderivative = 0.82, number of steps used = 9, number of rules used = 7, integrand size = 56, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {1593, 6742, 1620, 2395, 36, 29, 31} \begin {gather*} \frac {6}{x^2}-3 x+\frac {2 \log (x+1)}{x}-\frac {10+\log (4)}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 29
Rule 31
Rule 36
Rule 1593
Rule 1620
Rule 2395
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-12-2 x+12 x^2-3 x^3-3 x^4+\left (2 x+2 x^2\right ) \log (2)+\left (-2 x-2 x^2\right ) \log (1+x)}{x^3 (1+x)} \, dx\\ &=\int \left (\frac {-12-3 x^3-3 x^4-x (2-\log (4))+x^2 (12+\log (4))}{x^3 (1+x)}-\frac {2 \log (1+x)}{x^2}\right ) \, dx\\ &=-\left (2 \int \frac {\log (1+x)}{x^2} \, dx\right )+\int \frac {-12-3 x^3-3 x^4-x (2-\log (4))+x^2 (12+\log (4))}{x^3 (1+x)} \, dx\\ &=\frac {2 \log (1+x)}{x}-2 \int \frac {1}{x (1+x)} \, dx+\int \left (-3-\frac {12}{x^3}+\frac {2}{x}-\frac {2}{1+x}+\frac {10+\log (4)}{x^2}\right ) \, dx\\ &=\frac {6}{x^2}-3 x-\frac {10+\log (4)}{x}+2 \log (x)-2 \log (1+x)+\frac {2 \log (1+x)}{x}-2 \int \frac {1}{x} \, dx+2 \int \frac {1}{1+x} \, dx\\ &=\frac {6}{x^2}-3 x-\frac {10+\log (4)}{x}+\frac {2 \log (1+x)}{x}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.08, size = 30, normalized size = 0.91 \begin {gather*} \frac {6}{x^2}-\frac {10}{x}-3 x-\frac {2 \log (2)}{x}+\frac {2 \log (1+x)}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.52, size = 27, normalized size = 0.82 \begin {gather*} -\frac {3 \, x^{3} + 2 \, x \log \relax (2) - 2 \, x \log \left (x + 1\right ) + 10 \, x - 6}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 27, normalized size = 0.82 \begin {gather*} -3 \, x + \frac {2 \, \log \left (x + 1\right )}{x} - \frac {2 \, {\left (x \log \relax (2) + 5 \, x - 3\right )}}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.38, size = 27, normalized size = 0.82
method | result | size |
norman | \(\frac {6+\left (-10-2 \ln \relax (2)\right ) x -3 x^{3}+2 \ln \left (x +1\right ) x}{x^{2}}\) | \(27\) |
risch | \(\frac {2 \ln \left (x +1\right )}{x}-\frac {3 x^{3}+2 x \ln \relax (2)+10 x -6}{x^{2}}\) | \(31\) |
derivativedivides | \(-\frac {2 \ln \relax (2)}{x}+\frac {2 \ln \left (x +1\right ) \left (x +1\right )}{x}-3 x -3-2 \ln \left (x +1\right )+\frac {6}{x^{2}}-\frac {10}{x}\) | \(41\) |
default | \(-\frac {2 \ln \relax (2)}{x}+\frac {2 \ln \left (x +1\right ) \left (x +1\right )}{x}-3 x -3-2 \ln \left (x +1\right )+\frac {6}{x^{2}}-\frac {10}{x}\) | \(41\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.39, size = 66, normalized size = 2.00 \begin {gather*} -2 \, {\left (\frac {1}{x} - \log \left (x + 1\right ) + \log \relax (x)\right )} \log \relax (2) - 2 \, {\left (\log \left (x + 1\right ) - \log \relax (x)\right )} \log \relax (2) - 3 \, x + \frac {2 \, {\left (x + 1\right )} \log \left (x + 1\right )}{x} - \frac {6 \, {\left (2 \, x - 1\right )}}{x^{2}} + \frac {2}{x} - 2 \, \log \left (x + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.19, size = 25, normalized size = 0.76 \begin {gather*} -3\,x-\frac {x\,\left (2\,\ln \relax (2)-2\,\ln \left (x+1\right )+10\right )-6}{x^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.18, size = 24, normalized size = 0.73 \begin {gather*} - 3 x + \frac {2 \log {\left (x + 1 \right )}}{x} - \frac {x \left (2 \log {\relax (2 )} + 10\right ) - 6}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________