Optimal. Leaf size=25 \[ \log (x) \left (3-x \left (x-\frac {e^x (1+x) \log \left (x^2\right )}{x}\right )\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 1.86, antiderivative size = 33, normalized size of antiderivative = 1.32, number
of steps used = 50, number of rules used = 13, integrand size = 55, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.236, Rules
used = {14, 2341, 6820, 6874, 2230, 2225, 2209, 2634, 6618, 6610, 2207, 12, 2637}
\begin {gather*} x^2 (-\log (x))+e^x x \log (x) \log \left (x^2\right )+e^x \log (x) \log \left (x^2\right )+3 \log (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 14
Rule 2207
Rule 2209
Rule 2225
Rule 2230
Rule 2341
Rule 2634
Rule 2637
Rule 6610
Rule 6618
Rule 6820
Rule 6874
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (\frac {3-x^2-2 x^2 \log (x)}{x}+\frac {e^x \left (2 \log (x)+2 x \log (x)+\log \left (x^2\right )+x \log \left (x^2\right )+2 x \log (x) \log \left (x^2\right )+x^2 \log (x) \log \left (x^2\right )\right )}{x}\right ) \, dx\\ &=\int \frac {3-x^2-2 x^2 \log (x)}{x} \, dx+\int \frac {e^x \left (2 \log (x)+2 x \log (x)+\log \left (x^2\right )+x \log \left (x^2\right )+2 x \log (x) \log \left (x^2\right )+x^2 \log (x) \log \left (x^2\right )\right )}{x} \, dx\\ &=\int \left (\frac {3-x^2}{x}-2 x \log (x)\right ) \, dx+\int \frac {e^x \left ((1+x) \log \left (x^2\right )+\log (x) \left (2 (1+x)+x (2+x) \log \left (x^2\right )\right )\right )}{x} \, dx\\ &=-(2 \int x \log (x) \, dx)+\int \frac {3-x^2}{x} \, dx+\int \left (\frac {2 e^x (1+x) \log (x)}{x}+\frac {e^x \left (1+x+2 x \log (x)+x^2 \log (x)\right ) \log \left (x^2\right )}{x}\right ) \, dx\\ &=\frac {x^2}{2}-x^2 \log (x)+2 \int \frac {e^x (1+x) \log (x)}{x} \, dx+\int \left (\frac {3}{x}-x\right ) \, dx+\int \frac {e^x \left (1+x+2 x \log (x)+x^2 \log (x)\right ) \log \left (x^2\right )}{x} \, dx\\ &=3 \log (x)+2 e^x \log (x)-x^2 \log (x)+2 \text {Ei}(x) \log (x)-2 \int \frac {e^x+\text {Ei}(x)}{x} \, dx+\int \frac {e^x (1+x+x (2+x) \log (x)) \log \left (x^2\right )}{x} \, dx\\ &=3 \log (x)+2 e^x \log (x)-x^2 \log (x)+2 \text {Ei}(x) \log (x)-2 \int \left (\frac {e^x}{x}+\frac {\text {Ei}(x)}{x}\right ) \, dx+\int \left (e^x \log \left (x^2\right )+\frac {e^x \log \left (x^2\right )}{x}+2 e^x \log (x) \log \left (x^2\right )+e^x x \log (x) \log \left (x^2\right )\right ) \, dx\\ &=3 \log (x)+2 e^x \log (x)-x^2 \log (x)+2 \text {Ei}(x) \log (x)-2 \int \frac {e^x}{x} \, dx-2 \int \frac {\text {Ei}(x)}{x} \, dx+2 \int e^x \log (x) \log \left (x^2\right ) \, dx+\int e^x \log \left (x^2\right ) \, dx+\int \frac {e^x \log \left (x^2\right )}{x} \, dx+\int e^x x \log (x) \log \left (x^2\right ) \, dx\\ &=-2 \text {Ei}(x)+3 \log (x)+2 e^x \log (x)-x^2 \log (x)+2 \text {Ei}(x) \log (x)-2 (E_1(-x)+\text {Ei}(x)) \log (x)+e^x \log \left (x^2\right )+\text {Ei}(x) \log \left (x^2\right )+e^x \log (x) \log \left (x^2\right )+e^x x \log (x) \log \left (x^2\right )+2 \int \frac {E_1(-x)}{x} \, dx-2 \int \frac {2 e^x \log (x)}{x} \, dx-2 \int \frac {e^x \log \left (x^2\right )}{x} \, dx-\int \frac {2 e^x}{x} \, dx-\int \frac {2 \text {Ei}(x)}{x} \, dx-\int \frac {2 e^x (-1+x) \log (x)}{x} \, dx-\int \frac {e^x (-1+x) \log \left (x^2\right )}{x} \, dx\\ &=-2 \text {Ei}(x)-2 x \, _3F_3(1,1,1;2,2,2;x)-\log ^2(-x)+3 \log (x)+2 e^x \log (x)-2 \gamma \log (x)-x^2 \log (x)+2 \text {Ei}(x) \log (x)-2 (E_1(-x)+\text {Ei}(x)) \log (x)+e^x \log (x) \log \left (x^2\right )+e^x x \log (x) \log \left (x^2\right )-2 \int \frac {e^x}{x} \, dx-2 \int \frac {\text {Ei}(x)}{x} \, dx+2 \int \frac {2 \text {Ei}(x)}{x} \, dx-2 \int \frac {e^x (-1+x) \log (x)}{x} \, dx-4 \int \frac {e^x \log (x)}{x} \, dx+\int \frac {2 \left (e^x-\text {Ei}(x)\right )}{x} \, dx\\ &=-4 \text {Ei}(x)-2 x \, _3F_3(1,1,1;2,2,2;x)-\log ^2(-x)+3 \log (x)-2 \gamma \log (x)-x^2 \log (x)-4 (E_1(-x)+\text {Ei}(x)) \log (x)+e^x \log (x) \log \left (x^2\right )+e^x x \log (x) \log \left (x^2\right )+2 \int \frac {E_1(-x)}{x} \, dx+2 \left (2 \int \frac {e^x-\text {Ei}(x)}{x} \, dx\right )+2 \left (4 \int \frac {\text {Ei}(x)}{x} \, dx\right )\\ &=-4 \text {Ei}(x)-4 x \, _3F_3(1,1,1;2,2,2;x)-2 \log ^2(-x)+3 \log (x)-4 \gamma \log (x)-x^2 \log (x)-4 (E_1(-x)+\text {Ei}(x)) \log (x)+e^x \log (x) \log \left (x^2\right )+e^x x \log (x) \log \left (x^2\right )+2 \left (2 \int \left (\frac {e^x}{x}-\frac {\text {Ei}(x)}{x}\right ) \, dx\right )+2 \left (4 (E_1(-x)+\text {Ei}(x)) \log (x)-4 \int \frac {E_1(-x)}{x} \, dx\right )\\ &=-4 \text {Ei}(x)-4 x \, _3F_3(1,1,1;2,2,2;x)-2 \log ^2(-x)+3 \log (x)-4 \gamma \log (x)-x^2 \log (x)-4 (E_1(-x)+\text {Ei}(x)) \log (x)+2 \left (4 x \, _3F_3(1,1,1;2,2,2;x)+2 \log ^2(-x)+4 \gamma \log (x)+4 (E_1(-x)+\text {Ei}(x)) \log (x)\right )+e^x \log (x) \log \left (x^2\right )+e^x x \log (x) \log \left (x^2\right )+2 \left (2 \int \frac {e^x}{x} \, dx-2 \int \frac {\text {Ei}(x)}{x} \, dx\right )\\ &=-4 \text {Ei}(x)-4 x \, _3F_3(1,1,1;2,2,2;x)-2 \log ^2(-x)+3 \log (x)-4 \gamma \log (x)-x^2 \log (x)-4 (E_1(-x)+\text {Ei}(x)) \log (x)+2 \left (4 x \, _3F_3(1,1,1;2,2,2;x)+2 \log ^2(-x)+4 \gamma \log (x)+4 (E_1(-x)+\text {Ei}(x)) \log (x)\right )+e^x \log (x) \log \left (x^2\right )+e^x x \log (x) \log \left (x^2\right )+2 \left (2 \text {Ei}(x)-2 (E_1(-x)+\text {Ei}(x)) \log (x)+2 \int \frac {E_1(-x)}{x} \, dx\right )\\ &=-4 \text {Ei}(x)-4 x \, _3F_3(1,1,1;2,2,2;x)-2 \log ^2(-x)+3 \log (x)-4 \gamma \log (x)-x^2 \log (x)-4 (E_1(-x)+\text {Ei}(x)) \log (x)+2 \left (2 \text {Ei}(x)-2 x \, _3F_3(1,1,1;2,2,2;x)-\log ^2(-x)-2 \gamma \log (x)-2 (E_1(-x)+\text {Ei}(x)) \log (x)\right )+2 \left (4 x \, _3F_3(1,1,1;2,2,2;x)+2 \log ^2(-x)+4 \gamma \log (x)+4 (E_1(-x)+\text {Ei}(x)) \log (x)\right )+e^x \log (x) \log \left (x^2\right )+e^x x \log (x) \log \left (x^2\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 0.13, size = 21, normalized size = 0.84 \begin {gather*} -\log (x) \left (-3+x^2-e^x (1+x) \log \left (x^2\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(58\) vs.
\(2(24)=48\).
time = 0.14, size = 59, normalized size = 2.36
method | result | size |
default | \(\left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right ) {\mathrm e}^{x} \ln \left (x \right )+x \left (\ln \left (x^{2}\right )-2 \ln \left (x \right )\right ) {\mathrm e}^{x} \ln \left (x \right )+2 \,{\mathrm e}^{x} \ln \left (x \right )^{2}+2 x \,{\mathrm e}^{x} \ln \left (x \right )^{2}-x^{2} \ln \left (x \right )+3 \ln \left (x \right )\) | \(59\) |
risch | \(2 \left (x +1\right ) {\mathrm e}^{x} \ln \left (x \right )^{2}+\left (-x^{2}-\frac {i \pi x \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right ) {\mathrm e}^{x}}{2}+i \pi x \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2} {\mathrm e}^{x}-\frac {i \pi x \mathrm {csgn}\left (i x^{2}\right )^{3} {\mathrm e}^{x}}{2}-\frac {i \pi \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right ) {\mathrm e}^{x}}{2}+i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2} {\mathrm e}^{x}-\frac {i \pi \mathrm {csgn}\left (i x^{2}\right )^{3} {\mathrm e}^{x}}{2}\right ) \ln \left (x \right )+3 \ln \left (x \right )\) | \(139\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 21, normalized size = 0.84 \begin {gather*} 2 \, {\left (x + 1\right )} e^{x} \log \left (x\right )^{2} - {\left (x^{2} - 3\right )} \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.13, size = 29, normalized size = 1.16 \begin {gather*} - x^{2} \log {\left (x \right )} + \left (2 x \log {\left (x \right )}^{2} + 2 \log {\left (x \right )}^{2}\right ) e^{x} + 3 \log {\left (x \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 29, normalized size = 1.16 \begin {gather*} 2 \, x e^{x} \log \left (x\right )^{2} - x^{2} \log \left (x\right ) + 2 \, e^{x} \log \left (x\right )^{2} + 3 \, \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.21, size = 25, normalized size = 1.00 \begin {gather*} \ln \left (x\right )\,\left (\ln \left (x^2\right )\,{\mathrm {e}}^x-x^2+x\,\ln \left (x^2\right )\,{\mathrm {e}}^x+3\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________