Optimal. Leaf size=36 \[ \frac {1}{4} \left (\frac {e^x}{x \left (3-x+x^2\right )}+\frac {x}{x+\log \left (-\frac {1}{x}+x\right )}\right ) \]
________________________________________________________________________________________
Rubi [C] time = 7.45, antiderivative size = 523, normalized size of antiderivative = 14.53, number of steps used = 33, number of rules used = 9, integrand size = 317, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.028, Rules used = {6688, 12, 6725, 6742, 2177, 2178, 6728, 6711, 32} \begin {gather*} -\frac {1}{264} \left (11+3 i \sqrt {11}\right ) e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (2 x-i \sqrt {11}-1\right )\right )+\frac {1}{264} \left (1+i \sqrt {11}\right ) e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (2 x-i \sqrt {11}-1\right )\right )+\frac {i e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (2 x-i \sqrt {11}-1\right )\right )}{12 \sqrt {11}}+\frac {5}{132} e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (2 x-i \sqrt {11}-1\right )\right )-\frac {1}{264} \left (11-3 i \sqrt {11}\right ) e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (2 x+i \sqrt {11}-1\right )\right )+\frac {1}{264} \left (1-i \sqrt {11}\right ) e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (2 x+i \sqrt {11}-1\right )\right )-\frac {i e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (2 x+i \sqrt {11}-1\right )\right )}{12 \sqrt {11}}+\frac {5}{132} e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (2 x+i \sqrt {11}-1\right )\right )+\frac {\left (1-i \sqrt {11}\right ) e^x}{132 \left (-2 x-i \sqrt {11}+1\right )}+\frac {5 e^x}{66 \left (-2 x-i \sqrt {11}+1\right )}+\frac {\left (1+i \sqrt {11}\right ) e^x}{132 \left (-2 x+i \sqrt {11}+1\right )}+\frac {5 e^x}{66 \left (-2 x+i \sqrt {11}+1\right )}+\frac {e^x}{12 x}-\frac {1}{4 \left (\frac {x}{\log \left (x-\frac {1}{x}\right )}+1\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 32
Rule 2177
Rule 2178
Rule 6688
Rule 6711
Rule 6725
Rule 6728
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {x^2 \left (\left (1+x^2\right ) \left (3-x+x^2\right )^2-e^x \left (3-5 x+x^2+4 x^3-4 x^4+x^5\right )\right )-x \left (-1+x^2\right ) \left (x \left (3-x+x^2\right )^2+2 e^x \left (-3+5 x-4 x^2+x^3\right )\right ) \log \left (-\frac {1}{x}+x\right )-e^x \left (3-5 x+x^2+4 x^3-4 x^4+x^5\right ) \log ^2\left (-\frac {1}{x}+x\right )}{4 x^2 \left (1-x^2\right ) \left (3-x+x^2\right )^2 \left (x+\log \left (-\frac {1}{x}+x\right )\right )^2} \, dx\\ &=\frac {1}{4} \int \frac {x^2 \left (\left (1+x^2\right ) \left (3-x+x^2\right )^2-e^x \left (3-5 x+x^2+4 x^3-4 x^4+x^5\right )\right )-x \left (-1+x^2\right ) \left (x \left (3-x+x^2\right )^2+2 e^x \left (-3+5 x-4 x^2+x^3\right )\right ) \log \left (-\frac {1}{x}+x\right )-e^x \left (3-5 x+x^2+4 x^3-4 x^4+x^5\right ) \log ^2\left (-\frac {1}{x}+x\right )}{x^2 \left (1-x^2\right ) \left (3-x+x^2\right )^2 \left (x+\log \left (-\frac {1}{x}+x\right )\right )^2} \, dx\\ &=\frac {1}{4} \int \left (\frac {e^x \left (-3+5 x-4 x^2+x^3\right )}{x^2 \left (3-x+x^2\right )^2}+\frac {-1-x^2-\log \left (-\frac {1}{x}+x\right )+x^2 \log \left (-\frac {1}{x}+x\right )}{\left (-1+x^2\right ) \left (x+\log \left (-\frac {1}{x}+x\right )\right )^2}\right ) \, dx\\ &=\frac {1}{4} \int \frac {e^x \left (-3+5 x-4 x^2+x^3\right )}{x^2 \left (3-x+x^2\right )^2} \, dx+\frac {1}{4} \int \frac {-1-x^2-\log \left (-\frac {1}{x}+x\right )+x^2 \log \left (-\frac {1}{x}+x\right )}{\left (-1+x^2\right ) \left (x+\log \left (-\frac {1}{x}+x\right )\right )^2} \, dx\\ &=\frac {1}{4} \int \left (-\frac {e^x}{3 x^2}+\frac {e^x}{3 x}+\frac {e^x (-5-x)}{3 \left (3-x+x^2\right )^2}+\frac {e^x (2-x)}{3 \left (3-x+x^2\right )}\right ) \, dx+\frac {1}{4} \operatorname {Subst}\left (\int \frac {1}{(1+x)^2} \, dx,x,\frac {x}{\log \left (-\frac {1}{x}+x\right )}\right )\\ &=-\frac {1}{4 \left (1+\frac {x}{\log \left (-\frac {1}{x}+x\right )}\right )}-\frac {1}{12} \int \frac {e^x}{x^2} \, dx+\frac {1}{12} \int \frac {e^x}{x} \, dx+\frac {1}{12} \int \frac {e^x (-5-x)}{\left (3-x+x^2\right )^2} \, dx+\frac {1}{12} \int \frac {e^x (2-x)}{3-x+x^2} \, dx\\ &=\frac {e^x}{12 x}+\frac {\text {Ei}(x)}{12}-\frac {1}{4 \left (1+\frac {x}{\log \left (-\frac {1}{x}+x\right )}\right )}-\frac {1}{12} \int \frac {e^x}{x} \, dx+\frac {1}{12} \int \left (\frac {\left (-1-\frac {3 i}{\sqrt {11}}\right ) e^x}{-1-i \sqrt {11}+2 x}+\frac {\left (-1+\frac {3 i}{\sqrt {11}}\right ) e^x}{-1+i \sqrt {11}+2 x}\right ) \, dx+\frac {1}{12} \int \left (-\frac {5 e^x}{\left (3-x+x^2\right )^2}-\frac {e^x x}{\left (3-x+x^2\right )^2}\right ) \, dx\\ &=\frac {e^x}{12 x}-\frac {1}{4 \left (1+\frac {x}{\log \left (-\frac {1}{x}+x\right )}\right )}-\frac {1}{12} \int \frac {e^x x}{\left (3-x+x^2\right )^2} \, dx-\frac {5}{12} \int \frac {e^x}{\left (3-x+x^2\right )^2} \, dx+\frac {1}{132} \left (-11+3 i \sqrt {11}\right ) \int \frac {e^x}{-1+i \sqrt {11}+2 x} \, dx-\frac {1}{132} \left (11+3 i \sqrt {11}\right ) \int \frac {e^x}{-1-i \sqrt {11}+2 x} \, dx\\ &=\frac {e^x}{12 x}-\frac {1}{264} \left (11+3 i \sqrt {11}\right ) e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1-i \sqrt {11}+2 x\right )\right )-\frac {1}{264} \left (11-3 i \sqrt {11}\right ) e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1+i \sqrt {11}+2 x\right )\right )-\frac {1}{4 \left (1+\frac {x}{\log \left (-\frac {1}{x}+x\right )}\right )}-\frac {1}{12} \int \left (-\frac {2 \left (1+i \sqrt {11}\right ) e^x}{11 \left (1+i \sqrt {11}-2 x\right )^2}+\frac {2 i e^x}{11 \sqrt {11} \left (1+i \sqrt {11}-2 x\right )}-\frac {2 \left (1-i \sqrt {11}\right ) e^x}{11 \left (-1+i \sqrt {11}+2 x\right )^2}+\frac {2 i e^x}{11 \sqrt {11} \left (-1+i \sqrt {11}+2 x\right )}\right ) \, dx-\frac {5}{12} \int \left (-\frac {4 e^x}{11 \left (1+i \sqrt {11}-2 x\right )^2}+\frac {4 i e^x}{11 \sqrt {11} \left (1+i \sqrt {11}-2 x\right )}-\frac {4 e^x}{11 \left (-1+i \sqrt {11}+2 x\right )^2}+\frac {4 i e^x}{11 \sqrt {11} \left (-1+i \sqrt {11}+2 x\right )}\right ) \, dx\\ &=\frac {e^x}{12 x}-\frac {1}{264} \left (11+3 i \sqrt {11}\right ) e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1-i \sqrt {11}+2 x\right )\right )-\frac {1}{264} \left (11-3 i \sqrt {11}\right ) e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1+i \sqrt {11}+2 x\right )\right )-\frac {1}{4 \left (1+\frac {x}{\log \left (-\frac {1}{x}+x\right )}\right )}+\frac {5}{33} \int \frac {e^x}{\left (1+i \sqrt {11}-2 x\right )^2} \, dx+\frac {5}{33} \int \frac {e^x}{\left (-1+i \sqrt {11}+2 x\right )^2} \, dx-\frac {i \int \frac {e^x}{1+i \sqrt {11}-2 x} \, dx}{66 \sqrt {11}}-\frac {i \int \frac {e^x}{-1+i \sqrt {11}+2 x} \, dx}{66 \sqrt {11}}-\frac {(5 i) \int \frac {e^x}{1+i \sqrt {11}-2 x} \, dx}{33 \sqrt {11}}-\frac {(5 i) \int \frac {e^x}{-1+i \sqrt {11}+2 x} \, dx}{33 \sqrt {11}}-\frac {1}{66} \left (-1-i \sqrt {11}\right ) \int \frac {e^x}{\left (1+i \sqrt {11}-2 x\right )^2} \, dx-\frac {1}{66} \left (-1+i \sqrt {11}\right ) \int \frac {e^x}{\left (-1+i \sqrt {11}+2 x\right )^2} \, dx\\ &=\frac {5 e^x}{66 \left (1-i \sqrt {11}-2 x\right )}+\frac {\left (1-i \sqrt {11}\right ) e^x}{132 \left (1-i \sqrt {11}-2 x\right )}+\frac {5 e^x}{66 \left (1+i \sqrt {11}-2 x\right )}+\frac {\left (1+i \sqrt {11}\right ) e^x}{132 \left (1+i \sqrt {11}-2 x\right )}+\frac {e^x}{12 x}+\frac {i e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1-i \sqrt {11}+2 x\right )\right )}{12 \sqrt {11}}-\frac {1}{264} \left (11+3 i \sqrt {11}\right ) e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1-i \sqrt {11}+2 x\right )\right )-\frac {i e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1+i \sqrt {11}+2 x\right )\right )}{12 \sqrt {11}}-\frac {1}{264} \left (11-3 i \sqrt {11}\right ) e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1+i \sqrt {11}+2 x\right )\right )-\frac {1}{4 \left (1+\frac {x}{\log \left (-\frac {1}{x}+x\right )}\right )}-\frac {5}{66} \int \frac {e^x}{1+i \sqrt {11}-2 x} \, dx+\frac {5}{66} \int \frac {e^x}{-1+i \sqrt {11}+2 x} \, dx-\frac {1}{132} \left (-1+i \sqrt {11}\right ) \int \frac {e^x}{-1+i \sqrt {11}+2 x} \, dx-\frac {1}{132} \left (1+i \sqrt {11}\right ) \int \frac {e^x}{1+i \sqrt {11}-2 x} \, dx\\ &=\frac {5 e^x}{66 \left (1-i \sqrt {11}-2 x\right )}+\frac {\left (1-i \sqrt {11}\right ) e^x}{132 \left (1-i \sqrt {11}-2 x\right )}+\frac {5 e^x}{66 \left (1+i \sqrt {11}-2 x\right )}+\frac {\left (1+i \sqrt {11}\right ) e^x}{132 \left (1+i \sqrt {11}-2 x\right )}+\frac {e^x}{12 x}+\frac {5}{132} e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1-i \sqrt {11}+2 x\right )\right )+\frac {i e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1-i \sqrt {11}+2 x\right )\right )}{12 \sqrt {11}}+\frac {1}{264} \left (1+i \sqrt {11}\right ) e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1-i \sqrt {11}+2 x\right )\right )-\frac {1}{264} \left (11+3 i \sqrt {11}\right ) e^{\frac {1}{2}+\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1-i \sqrt {11}+2 x\right )\right )+\frac {5}{132} e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1+i \sqrt {11}+2 x\right )\right )-\frac {i e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1+i \sqrt {11}+2 x\right )\right )}{12 \sqrt {11}}+\frac {1}{264} \left (1-i \sqrt {11}\right ) e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1+i \sqrt {11}+2 x\right )\right )-\frac {1}{264} \left (11-3 i \sqrt {11}\right ) e^{\frac {1}{2}-\frac {i \sqrt {11}}{2}} \text {Ei}\left (\frac {1}{2} \left (-1+i \sqrt {11}+2 x\right )\right )-\frac {1}{4 \left (1+\frac {x}{\log \left (-\frac {1}{x}+x\right )}\right )}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.16, size = 37, normalized size = 1.03 \begin {gather*} \frac {1}{4} \left (\frac {e^x}{3 x-x^2+x^3}+\frac {x}{x+\log \left (-\frac {1}{x}+x\right )}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.77, size = 72, normalized size = 2.00 \begin {gather*} \frac {x^{4} - x^{3} + 3 \, x^{2} + x e^{x} + e^{x} \log \left (\frac {x^{2} - 1}{x}\right )}{4 \, {\left (x^{4} - x^{3} + 3 \, x^{2} + {\left (x^{3} - x^{2} + 3 \, x\right )} \log \left (\frac {x^{2} - 1}{x}\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 2.80, size = 91, normalized size = 2.53 \begin {gather*} \frac {x^{4} - x^{3} + 3 \, x^{2} + x e^{x} + e^{x} \log \left (\frac {x^{2} - 1}{x}\right )}{4 \, {\left (x^{4} + x^{3} \log \left (\frac {x^{2} - 1}{x}\right ) - x^{3} - x^{2} \log \left (\frac {x^{2} - 1}{x}\right ) + 3 \, x^{2} + 3 \, x \log \left (\frac {x^{2} - 1}{x}\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.20, size = 142, normalized size = 3.94
method | result | size |
risch | \(\frac {{\mathrm e}^{x}}{4 x \left (x^{2}-x +3\right )}+\frac {x}{-2 i \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x^{2}-1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}-1\right )}{x}\right )+2 i \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}-1\right )}{x}\right )^{2}+2 i \pi \,\mathrm {csgn}\left (i \left (x^{2}-1\right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}-1\right )}{x}\right )^{2}-2 i \pi \mathrm {csgn}\left (\frac {i \left (x^{2}-1\right )}{x}\right )^{3}+4 x -4 \ln \relax (x )+4 \ln \left (x^{2}-1\right )}\) | \(142\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.45, size = 105, normalized size = 2.92 \begin {gather*} \frac {x^{4} - x^{3} + 3 \, x^{2} + {\left (x - \log \relax (x)\right )} e^{x} + e^{x} \log \left (x + 1\right ) + e^{x} \log \left (x - 1\right )}{4 \, {\left (x^{4} - x^{3} + 3 \, x^{2} + {\left (x^{3} - x^{2} + 3 \, x\right )} \log \left (x + 1\right ) + {\left (x^{3} - x^{2} + 3 \, x\right )} \log \left (x - 1\right ) - {\left (x^{3} - x^{2} + 3 \, x\right )} \log \relax (x)\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.09, size = 89, normalized size = 2.47 \begin {gather*} \frac {x^2\,\ln \left (\frac {x^2-1}{x}\right )-x^3\,\ln \left (\frac {x^2-1}{x}\right )+{\mathrm {e}}^x\,\ln \left (\frac {x^2-1}{x}\right )-3\,x\,\ln \left (\frac {x^2-1}{x}\right )+x\,{\mathrm {e}}^x}{4\,x\,\left (x+\ln \left (\frac {x^2-1}{x}\right )\right )\,\left (x^2-x+3\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.61, size = 31, normalized size = 0.86 \begin {gather*} \frac {x}{4 x + 4 \log {\left (\frac {x^{2} - 1}{x} \right )}} + \frac {e^{x}}{4 x^{3} - 4 x^{2} + 12 x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________