Optimal. Leaf size=24 \[ x+x^2 \left (1+e^x-x+\log \left (\frac {x}{1+x}\right )\right )^2 \]
________________________________________________________________________________________
Rubi [B] time = 1.49, antiderivative size = 94, normalized size of antiderivative = 3.92, number of steps used = 68, number of rules used = 14, integrand size = 125, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.112, Rules used = {6742, 43, 2196, 2176, 2194, 2514, 2486, 31, 2447, 2492, 6688, 2199, 2178, 2554} \begin {gather*} x^4-2 e^x x^3-2 x^3-2 x^3 \log \left (\frac {x}{x+1}\right )+2 e^x x^2+e^{2 x} x^2+x^2+x^2 \log ^2\left (\frac {x}{x+1}\right )+2 e^x x^2 \log \left (\frac {x}{x+1}\right )+2 x^2 \log \left (\frac {x}{x+1}\right )+x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 43
Rule 2176
Rule 2178
Rule 2194
Rule 2196
Rule 2199
Rule 2447
Rule 2486
Rule 2492
Rule 2514
Rule 2554
Rule 6688
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (\frac {1}{1+x}+\frac {5 x}{1+x}-\frac {6 x^2}{1+x}-\frac {2 x^3}{1+x}+\frac {4 x^4}{1+x}+2 e^{2 x} x (1+x)+\frac {6 x \log \left (\frac {x}{1+x}\right )}{1+x}-\frac {2 x^2 \log \left (\frac {x}{1+x}\right )}{1+x}-\frac {6 x^3 \log \left (\frac {x}{1+x}\right )}{1+x}+2 x \log ^2\left (\frac {x}{1+x}\right )-\frac {2 e^x x \left (-3+3 x^2+x^3-2 \log \left (\frac {x}{1+x}\right )-3 x \log \left (\frac {x}{1+x}\right )-x^2 \log \left (\frac {x}{1+x}\right )\right )}{1+x}\right ) \, dx\\ &=\log (1+x)-2 \int \frac {x^3}{1+x} \, dx+2 \int e^{2 x} x (1+x) \, dx-2 \int \frac {x^2 \log \left (\frac {x}{1+x}\right )}{1+x} \, dx+2 \int x \log ^2\left (\frac {x}{1+x}\right ) \, dx-2 \int \frac {e^x x \left (-3+3 x^2+x^3-2 \log \left (\frac {x}{1+x}\right )-3 x \log \left (\frac {x}{1+x}\right )-x^2 \log \left (\frac {x}{1+x}\right )\right )}{1+x} \, dx+4 \int \frac {x^4}{1+x} \, dx+5 \int \frac {x}{1+x} \, dx-6 \int \frac {x^2}{1+x} \, dx+6 \int \frac {x \log \left (\frac {x}{1+x}\right )}{1+x} \, dx-6 \int \frac {x^3 \log \left (\frac {x}{1+x}\right )}{1+x} \, dx\\ &=x^2 \log ^2\left (\frac {x}{1+x}\right )+\log (1+x)-2 \int \left (1+\frac {1}{-1-x}-x+x^2\right ) \, dx+2 \int \left (e^{2 x} x+e^{2 x} x^2\right ) \, dx-2 \int \frac {x \log \left (\frac {x}{1+x}\right )}{1+x} \, dx-2 \int \left (-\log \left (\frac {x}{1+x}\right )+x \log \left (\frac {x}{1+x}\right )+\frac {\log \left (\frac {x}{1+x}\right )}{1+x}\right ) \, dx-2 \int \frac {e^x x \left (-3+3 x^2+x^3-\left (2+3 x+x^2\right ) \log \left (\frac {x}{1+x}\right )\right )}{1+x} \, dx+4 \int \left (-1+x-x^2+x^3+\frac {1}{1+x}\right ) \, dx+5 \int \left (1+\frac {1}{-1-x}\right ) \, dx-6 \int \left (-1+x+\frac {1}{1+x}\right ) \, dx+6 \int \left (\log \left (\frac {x}{1+x}\right )+\frac {\log \left (\frac {x}{1+x}\right )}{-1-x}\right ) \, dx-6 \int \left (\log \left (\frac {x}{1+x}\right )+\frac {\log \left (\frac {x}{1+x}\right )}{-1-x}-x \log \left (\frac {x}{1+x}\right )+x^2 \log \left (\frac {x}{1+x}\right )\right ) \, dx\\ &=5 x-2 x^3+x^4+x^2 \log ^2\left (\frac {x}{1+x}\right )-4 \log (1+x)+2 \int e^{2 x} x \, dx+2 \int e^{2 x} x^2 \, dx+2 \int \log \left (\frac {x}{1+x}\right ) \, dx-2 \int x \log \left (\frac {x}{1+x}\right ) \, dx-2 \int \frac {\log \left (\frac {x}{1+x}\right )}{1+x} \, dx-2 \int \left (\log \left (\frac {x}{1+x}\right )+\frac {\log \left (\frac {x}{1+x}\right )}{-1-x}\right ) \, dx-2 \int \left (\frac {e^x x \left (-3+3 x^2+x^3\right )}{1+x}-e^x x (2+x) \log \left (\frac {x}{1+x}\right )\right ) \, dx+6 \int x \log \left (\frac {x}{1+x}\right ) \, dx-6 \int x^2 \log \left (\frac {x}{1+x}\right ) \, dx\\ &=5 x+e^{2 x} x+e^{2 x} x^2-2 x^3+x^4+2 x \log \left (\frac {x}{1+x}\right )+2 x^2 \log \left (\frac {x}{1+x}\right )-2 x^3 \log \left (\frac {x}{1+x}\right )+x^2 \log ^2\left (\frac {x}{1+x}\right )-4 \log (1+x)-2 \text {Li}_2\left (1-\frac {x}{1+x}\right )-2 \int e^{2 x} x \, dx-2 \int \frac {1}{1+x} \, dx+2 \int \frac {x^2}{1+x} \, dx-2 \int \frac {e^x x \left (-3+3 x^2+x^3\right )}{1+x} \, dx-2 \int \log \left (\frac {x}{1+x}\right ) \, dx-2 \int \frac {\log \left (\frac {x}{1+x}\right )}{-1-x} \, dx+2 \int e^x x (2+x) \log \left (\frac {x}{1+x}\right ) \, dx-3 \int \frac {x}{1+x} \, dx-\int e^{2 x} \, dx+\int \frac {x}{1+x} \, dx\\ &=-\frac {e^{2 x}}{2}+5 x+e^{2 x} x^2-2 x^3+x^4+2 x^2 \log \left (\frac {x}{1+x}\right )+2 e^x x^2 \log \left (\frac {x}{1+x}\right )-2 x^3 \log \left (\frac {x}{1+x}\right )+x^2 \log ^2\left (\frac {x}{1+x}\right )-6 \log (1+x)+2 \int \frac {1}{1+x} \, dx-2 \int \frac {e^x x}{1+x} \, dx+2 \int \left (-1+x+\frac {1}{1+x}\right ) \, dx-2 \int \left (-e^x-2 e^x x+2 e^x x^2+e^x x^3+\frac {e^x}{1+x}\right ) \, dx-3 \int \left (1+\frac {1}{-1-x}\right ) \, dx+\int e^{2 x} \, dx+\int \left (1+\frac {1}{-1-x}\right ) \, dx\\ &=x+x^2+e^{2 x} x^2-2 x^3+x^4+2 x^2 \log \left (\frac {x}{1+x}\right )+2 e^x x^2 \log \left (\frac {x}{1+x}\right )-2 x^3 \log \left (\frac {x}{1+x}\right )+x^2 \log ^2\left (\frac {x}{1+x}\right )+2 \int e^x \, dx-2 \int \left (e^x+\frac {e^x}{-1-x}\right ) \, dx-2 \int e^x x^3 \, dx-2 \int \frac {e^x}{1+x} \, dx+4 \int e^x x \, dx-4 \int e^x x^2 \, dx\\ &=2 e^x+x+4 e^x x+x^2-4 e^x x^2+e^{2 x} x^2-2 x^3-2 e^x x^3+x^4-\frac {2 \text {Ei}(1+x)}{e}+2 x^2 \log \left (\frac {x}{1+x}\right )+2 e^x x^2 \log \left (\frac {x}{1+x}\right )-2 x^3 \log \left (\frac {x}{1+x}\right )+x^2 \log ^2\left (\frac {x}{1+x}\right )-2 \int e^x \, dx-2 \int \frac {e^x}{-1-x} \, dx-4 \int e^x \, dx+6 \int e^x x^2 \, dx+8 \int e^x x \, dx\\ &=-4 e^x+x+12 e^x x+x^2+2 e^x x^2+e^{2 x} x^2-2 x^3-2 e^x x^3+x^4+2 x^2 \log \left (\frac {x}{1+x}\right )+2 e^x x^2 \log \left (\frac {x}{1+x}\right )-2 x^3 \log \left (\frac {x}{1+x}\right )+x^2 \log ^2\left (\frac {x}{1+x}\right )-8 \int e^x \, dx-12 \int e^x x \, dx\\ &=-12 e^x+x+x^2+2 e^x x^2+e^{2 x} x^2-2 x^3-2 e^x x^3+x^4+2 x^2 \log \left (\frac {x}{1+x}\right )+2 e^x x^2 \log \left (\frac {x}{1+x}\right )-2 x^3 \log \left (\frac {x}{1+x}\right )+x^2 \log ^2\left (\frac {x}{1+x}\right )+12 \int e^x \, dx\\ &=x+x^2+2 e^x x^2+e^{2 x} x^2-2 x^3-2 e^x x^3+x^4+2 x^2 \log \left (\frac {x}{1+x}\right )+2 e^x x^2 \log \left (\frac {x}{1+x}\right )-2 x^3 \log \left (\frac {x}{1+x}\right )+x^2 \log ^2\left (\frac {x}{1+x}\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [B] time = 0.11, size = 57, normalized size = 2.38 \begin {gather*} x \left (1+\left (1+e^x\right )^2 x-2 \left (1+e^x\right ) x^2+x^3-2 x \left (-1-e^x+x\right ) \log \left (\frac {x}{1+x}\right )+x \log ^2\left (\frac {x}{1+x}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.56, size = 74, normalized size = 3.08 \begin {gather*} x^{4} + x^{2} \log \left (\frac {x}{x + 1}\right )^{2} - 2 \, x^{3} + x^{2} e^{\left (2 \, x\right )} + x^{2} - 2 \, {\left (x^{3} - x^{2}\right )} e^{x} - 2 \, {\left (x^{3} - x^{2} e^{x} - x^{2}\right )} \log \left (\frac {x}{x + 1}\right ) + x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.20, size = 90, normalized size = 3.75 \begin {gather*} x^{4} - 2 \, x^{3} e^{x} - 2 \, x^{3} \log \left (\frac {x}{x + 1}\right ) + 2 \, x^{2} e^{x} \log \left (\frac {x}{x + 1}\right ) + x^{2} \log \left (\frac {x}{x + 1}\right )^{2} - 2 \, x^{3} + x^{2} e^{\left (2 \, x\right )} + 2 \, x^{2} e^{x} + 2 \, x^{2} \log \left (\frac {x}{x + 1}\right ) + x^{2} + x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.32, size = 909, normalized size = 37.88
method | result | size |
risch | \(x +2 x^{2} \ln \relax (x )+2 x^{2} {\mathrm e}^{x} \ln \relax (x )+x^{2} \ln \relax (x )^{2}+x^{4}-2 x^{3}+x^{2}-2 x^{3} \ln \relax (x )+{\mathrm e}^{2 x} x^{2}+2 \,{\mathrm e}^{x} x^{2}-2 \,{\mathrm e}^{x} x^{3}+i \pi \,x^{3} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{3}-\frac {\pi ^{2} x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{4} \mathrm {csgn}\left (\frac {i}{x +1}\right )^{2}}{4}+\frac {\pi ^{2} x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{5} \mathrm {csgn}\left (i x \right )}{2}+\frac {\pi ^{2} x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{5} \mathrm {csgn}\left (\frac {i}{x +1}\right )}{2}-\frac {\pi ^{2} x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{4} \mathrm {csgn}\left (i x \right )^{2}}{4}-i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{3}+\left (-2 x^{2} \ln \relax (x )+i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{3}-i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (i x \right )-i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (\frac {i}{x +1}\right )+i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (\frac {i}{x +1}\right )+2 x^{3}-2 \,{\mathrm e}^{x} x^{2}-2 x^{2}\right ) \ln \left (x +1\right )+\ln \left (x +1\right )^{2} x^{2}+i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (i x \right )+i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (\frac {i}{x +1}\right )-i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (\frac {i}{x +1}\right ) {\mathrm e}^{x}-i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (\frac {i}{x +1}\right ) \ln \relax (x )+i \pi \,x^{3} \mathrm {csgn}\left (\frac {i x}{x +1}\right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (\frac {i}{x +1}\right )-i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (\frac {i}{x +1}\right )+i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (i x \right ) \ln \relax (x )+i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (\frac {i}{x +1}\right ) {\mathrm e}^{x}+i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (\frac {i}{x +1}\right ) \ln \relax (x )+i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (i x \right ) {\mathrm e}^{x}-\frac {\pi ^{2} x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{6}}{4}-i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{3} \ln \relax (x )-i \pi \,x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{3} {\mathrm e}^{x}+\frac {\pi ^{2} x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{3} \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (\frac {i}{x +1}\right )}{2}+\frac {\pi ^{2} x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{3} \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (\frac {i}{x +1}\right )^{2}}{2}-\frac {\pi ^{2} x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (\frac {i}{x +1}\right )^{2}}{4}-i \pi \,x^{3} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (i x \right )-i \pi \,x^{3} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{2} \mathrm {csgn}\left (\frac {i}{x +1}\right )-\pi ^{2} x^{2} \mathrm {csgn}\left (\frac {i x}{x +1}\right )^{4} \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (\frac {i}{x +1}\right )\) | \(909\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.40, size = 108, normalized size = 4.50 \begin {gather*} x^{4} + x^{2} \log \left (x + 1\right )^{2} + x^{2} \log \relax (x)^{2} - 2 \, x^{3} + x^{2} e^{\left (2 \, x\right )} + x^{2} - 2 \, {\left (x^{3} - x^{2} \log \relax (x) - x^{2}\right )} e^{x} + 2 \, {\left (x^{3} - x^{2} e^{x} - x^{2} \log \relax (x) - x^{2} + 2\right )} \log \left (x + 1\right ) - 2 \, {\left (x^{3} - x^{2}\right )} \log \relax (x) + x - 4 \, \log \left (x + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.94, size = 76, normalized size = 3.17 \begin {gather*} x+{\mathrm {e}}^x\,\left (2\,x^2-2\,x^3\right )+x^2\,{\ln \left (\frac {x}{x+1}\right )}^2+x^2\,{\mathrm {e}}^{2\,x}+\ln \left (\frac {x}{x+1}\right )\,\left (2\,x^2\,{\mathrm {e}}^x+2\,x^2-2\,x^3\right )+x^2-2\,x^3+x^4 \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.69, size = 75, normalized size = 3.12 \begin {gather*} x^{4} - 2 x^{3} + x^{2} e^{2 x} + x^{2} \log {\left (\frac {x}{x + 1} \right )}^{2} + x^{2} + x + \left (- 2 x^{3} + 2 x^{2}\right ) \log {\left (\frac {x}{x + 1} \right )} + \left (- 2 x^{3} + 2 x^{2} \log {\left (\frac {x}{x + 1} \right )} + 2 x^{2}\right ) e^{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________