Optimal. Leaf size=32 \[ \frac {\left (4+\frac {2 \left (-e+e^{x^2}\right )}{x}\right ) (7+(5-x) \log (x))}{-2+x} \]
________________________________________________________________________________________
Rubi [B] time = 3.48, antiderivative size = 124, normalized size of antiderivative = 3.88, number of steps used = 43, number of rules used = 15, integrand size = 106, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.142, Rules used = {1594, 27, 6742, 44, 43, 893, 2314, 31, 2357, 2304, 2220, 2204, 2214, 2210, 2554} \begin {gather*} -\frac {7 e^{x^2}}{2-x}-\frac {7 e^{x^2}}{x}-\frac {3 e^{x^2} \log (x)}{2-x}-\frac {5 e^{x^2} \log (x)}{x}+\frac {7 e}{2-x}-\frac {28}{2-x}+\frac {7 e}{x}+\frac {3 e x \log (x)}{2 (2-x)}-\frac {6 x \log (x)}{2-x}+\frac {5 e \log (x)}{x}+\frac {3}{2} e \log (x)-10 \log (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 31
Rule 43
Rule 44
Rule 893
Rule 1594
Rule 2204
Rule 2210
Rule 2214
Rule 2220
Rule 2304
Rule 2314
Rule 2357
Rule 2554
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-40 x-4 x^3+e \left (-8+14 x+2 x^2\right )+e^{x^2} \left (8-14 x-58 x^2+28 x^3\right )+\left (-12 x^2+e \left (-20+20 x-2 x^2\right )+e^{x^2} \left (20-20 x-38 x^2+28 x^3-4 x^4\right )\right ) \log (x)}{x^2 \left (4-4 x+x^2\right )} \, dx\\ &=\int \frac {-40 x-4 x^3+e \left (-8+14 x+2 x^2\right )+e^{x^2} \left (8-14 x-58 x^2+28 x^3\right )+\left (-12 x^2+e \left (-20+20 x-2 x^2\right )+e^{x^2} \left (20-20 x-38 x^2+28 x^3-4 x^4\right )\right ) \log (x)}{(-2+x)^2 x^2} \, dx\\ &=\int \left (-\frac {40}{(-2+x)^2 x}-\frac {4 x}{(-2+x)^2}+\frac {2 e \left (-4+7 x+x^2\right )}{(-2+x)^2 x^2}-\frac {12 \log (x)}{(-2+x)^2}-\frac {2 e \left (10-10 x+x^2\right ) \log (x)}{(-2+x)^2 x^2}-\frac {2 e^{x^2} \left (-4+7 x+29 x^2-14 x^3-10 \log (x)+10 x \log (x)+19 x^2 \log (x)-14 x^3 \log (x)+2 x^4 \log (x)\right )}{(-2+x)^2 x^2}\right ) \, dx\\ &=-\left (2 \int \frac {e^{x^2} \left (-4+7 x+29 x^2-14 x^3-10 \log (x)+10 x \log (x)+19 x^2 \log (x)-14 x^3 \log (x)+2 x^4 \log (x)\right )}{(-2+x)^2 x^2} \, dx\right )-4 \int \frac {x}{(-2+x)^2} \, dx-12 \int \frac {\log (x)}{(-2+x)^2} \, dx-40 \int \frac {1}{(-2+x)^2 x} \, dx+(2 e) \int \frac {-4+7 x+x^2}{(-2+x)^2 x^2} \, dx-(2 e) \int \frac {\left (10-10 x+x^2\right ) \log (x)}{(-2+x)^2 x^2} \, dx\\ &=-\frac {6 x \log (x)}{2-x}-2 \int \left (\frac {29 e^{x^2}}{(-2+x)^2}-\frac {4 e^{x^2}}{(-2+x)^2 x^2}+\frac {7 e^{x^2}}{(-2+x)^2 x}-\frac {14 e^{x^2} x}{(-2+x)^2}+\frac {e^{x^2} \left (-10+10 x+19 x^2-14 x^3+2 x^4\right ) \log (x)}{(-2+x)^2 x^2}\right ) \, dx-4 \int \left (\frac {2}{(-2+x)^2}+\frac {1}{-2+x}\right ) \, dx-6 \int \frac {1}{-2+x} \, dx-40 \int \left (\frac {1}{2 (-2+x)^2}-\frac {1}{4 (-2+x)}+\frac {1}{4 x}\right ) \, dx+(2 e) \int \left (\frac {7}{2 (-2+x)^2}-\frac {3}{4 (-2+x)}-\frac {1}{x^2}+\frac {3}{4 x}\right ) \, dx-(2 e) \int \left (-\frac {3 \log (x)}{2 (-2+x)^2}+\frac {5 \log (x)}{2 x^2}\right ) \, dx\\ &=-\frac {28}{2-x}+\frac {7 e}{2-x}+\frac {2 e}{x}-\frac {3}{2} e \log (2-x)-10 \log (x)+\frac {3}{2} e \log (x)-\frac {6 x \log (x)}{2-x}-2 \int \frac {e^{x^2} \left (-10+10 x+19 x^2-14 x^3+2 x^4\right ) \log (x)}{(-2+x)^2 x^2} \, dx+8 \int \frac {e^{x^2}}{(-2+x)^2 x^2} \, dx-14 \int \frac {e^{x^2}}{(-2+x)^2 x} \, dx+28 \int \frac {e^{x^2} x}{(-2+x)^2} \, dx-58 \int \frac {e^{x^2}}{(-2+x)^2} \, dx+(3 e) \int \frac {\log (x)}{(-2+x)^2} \, dx-(5 e) \int \frac {\log (x)}{x^2} \, dx\\ &=-\frac {28}{2-x}+\frac {7 e}{2-x}-\frac {58 e^{x^2}}{2-x}+\frac {7 e}{x}-\frac {3}{2} e \log (2-x)-10 \log (x)+\frac {3}{2} e \log (x)-\frac {3 e^{x^2} \log (x)}{2-x}+\frac {5 e \log (x)}{x}-\frac {5 e^{x^2} \log (x)}{x}-\frac {6 x \log (x)}{2-x}+\frac {3 e x \log (x)}{2 (2-x)}+2 \int \frac {e^{x^2} (5-x)}{(2-x) x^2} \, dx+8 \int \left (\frac {e^{x^2}}{4 (-2+x)^2}-\frac {e^{x^2}}{4 (-2+x)}+\frac {e^{x^2}}{4 x^2}+\frac {e^{x^2}}{4 x}\right ) \, dx-14 \int \left (\frac {e^{x^2}}{2 (-2+x)^2}-\frac {e^{x^2}}{4 (-2+x)}+\frac {e^{x^2}}{4 x}\right ) \, dx+28 \int \left (\frac {2 e^{x^2}}{(-2+x)^2}+\frac {e^{x^2}}{-2+x}\right ) \, dx-116 \int e^{x^2} \, dx-232 \int \frac {e^{x^2}}{-2+x} \, dx+\frac {1}{2} (3 e) \int \frac {1}{-2+x} \, dx\\ &=-\frac {28}{2-x}+\frac {7 e}{2-x}-\frac {58 e^{x^2}}{2-x}+\frac {7 e}{x}-58 \sqrt {\pi } \text {erfi}(x)-10 \log (x)+\frac {3}{2} e \log (x)-\frac {3 e^{x^2} \log (x)}{2-x}+\frac {5 e \log (x)}{x}-\frac {5 e^{x^2} \log (x)}{x}-\frac {6 x \log (x)}{2-x}+\frac {3 e x \log (x)}{2 (2-x)}+2 \int \left (-\frac {3 e^{x^2}}{4 (-2+x)}+\frac {5 e^{x^2}}{2 x^2}+\frac {3 e^{x^2}}{4 x}\right ) \, dx+2 \int \frac {e^{x^2}}{(-2+x)^2} \, dx-2 \int \frac {e^{x^2}}{-2+x} \, dx+2 \int \frac {e^{x^2}}{x^2} \, dx+2 \int \frac {e^{x^2}}{x} \, dx+\frac {7}{2} \int \frac {e^{x^2}}{-2+x} \, dx-\frac {7}{2} \int \frac {e^{x^2}}{x} \, dx-7 \int \frac {e^{x^2}}{(-2+x)^2} \, dx+28 \int \frac {e^{x^2}}{-2+x} \, dx+56 \int \frac {e^{x^2}}{(-2+x)^2} \, dx-232 \int \frac {e^{x^2}}{-2+x} \, dx\\ &=-\frac {28}{2-x}+\frac {7 e}{2-x}-\frac {7 e^{x^2}}{2-x}+\frac {7 e}{x}-\frac {2 e^{x^2}}{x}-58 \sqrt {\pi } \text {erfi}(x)-\frac {3 \text {Ei}\left (x^2\right )}{4}-10 \log (x)+\frac {3}{2} e \log (x)-\frac {3 e^{x^2} \log (x)}{2-x}+\frac {5 e \log (x)}{x}-\frac {5 e^{x^2} \log (x)}{x}-\frac {6 x \log (x)}{2-x}+\frac {3 e x \log (x)}{2 (2-x)}-\frac {3}{2} \int \frac {e^{x^2}}{-2+x} \, dx+\frac {3}{2} \int \frac {e^{x^2}}{x} \, dx-2 \int \frac {e^{x^2}}{-2+x} \, dx+\frac {7}{2} \int \frac {e^{x^2}}{-2+x} \, dx+2 \left (4 \int e^{x^2} \, dx\right )+5 \int \frac {e^{x^2}}{x^2} \, dx+8 \int \frac {e^{x^2}}{-2+x} \, dx-14 \int e^{x^2} \, dx+112 \int e^{x^2} \, dx+224 \int \frac {e^{x^2}}{-2+x} \, dx-232 \int \frac {e^{x^2}}{-2+x} \, dx\\ &=-\frac {28}{2-x}+\frac {7 e}{2-x}-\frac {7 e^{x^2}}{2-x}+\frac {7 e}{x}-\frac {7 e^{x^2}}{x}-5 \sqrt {\pi } \text {erfi}(x)-10 \log (x)+\frac {3}{2} e \log (x)-\frac {3 e^{x^2} \log (x)}{2-x}+\frac {5 e \log (x)}{x}-\frac {5 e^{x^2} \log (x)}{x}-\frac {6 x \log (x)}{2-x}+\frac {3 e x \log (x)}{2 (2-x)}-\frac {3}{2} \int \frac {e^{x^2}}{-2+x} \, dx-2 \int \frac {e^{x^2}}{-2+x} \, dx+\frac {7}{2} \int \frac {e^{x^2}}{-2+x} \, dx+8 \int \frac {e^{x^2}}{-2+x} \, dx+10 \int e^{x^2} \, dx+224 \int \frac {e^{x^2}}{-2+x} \, dx-232 \int \frac {e^{x^2}}{-2+x} \, dx\\ &=-\frac {28}{2-x}+\frac {7 e}{2-x}-\frac {7 e^{x^2}}{2-x}+\frac {7 e}{x}-\frac {7 e^{x^2}}{x}-10 \log (x)+\frac {3}{2} e \log (x)-\frac {3 e^{x^2} \log (x)}{2-x}+\frac {5 e \log (x)}{x}-\frac {5 e^{x^2} \log (x)}{x}-\frac {6 x \log (x)}{2-x}+\frac {3 e x \log (x)}{2 (2-x)}-\frac {3}{2} \int \frac {e^{x^2}}{-2+x} \, dx-2 \int \frac {e^{x^2}}{-2+x} \, dx+\frac {7}{2} \int \frac {e^{x^2}}{-2+x} \, dx+8 \int \frac {e^{x^2}}{-2+x} \, dx+224 \int \frac {e^{x^2}}{-2+x} \, dx-232 \int \frac {e^{x^2}}{-2+x} \, dx\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.10, size = 30, normalized size = 0.94 \begin {gather*} -\frac {2 \left (-e+e^{x^2}+2 x\right ) (-7+(-5+x) \log (x))}{(-2+x) x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.53, size = 52, normalized size = 1.62 \begin {gather*} -\frac {2 \, {\left ({\left (2 \, x^{2} - {\left (x - 5\right )} e + {\left (x - 5\right )} e^{\left (x^{2}\right )} - 10 \, x\right )} \log \relax (x) - 14 \, x + 7 \, e - 7 \, e^{\left (x^{2}\right )}\right )}}{x^{2} - 2 \, x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.22, size = 66, normalized size = 2.06 \begin {gather*} -\frac {2 \, {\left (2 \, x^{2} \log \relax (x) - x e \log \relax (x) + x e^{\left (x^{2}\right )} \log \relax (x) - 10 \, x \log \relax (x) + 5 \, e \log \relax (x) - 5 \, e^{\left (x^{2}\right )} \log \relax (x) - 14 \, x + 7 \, e - 7 \, e^{\left (x^{2}\right )}\right )}}{x^{2} - 2 \, x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.15, size = 64, normalized size = 2.00
method | result | size |
norman | \(\frac {28 x -4 x^{2} \ln \relax (x )+\left (2 \,{\mathrm e}+20\right ) x \ln \relax (x )-10 \,{\mathrm e} \ln \relax (x )+10 \,{\mathrm e}^{x^{2}} \ln \relax (x )-2 x \,{\mathrm e}^{x^{2}} \ln \relax (x )-14 \,{\mathrm e}+14 \,{\mathrm e}^{x^{2}}}{\left (x -2\right ) x}\) | \(64\) |
risch | \(\frac {2 \left (x \,{\mathrm e}-{\mathrm e}^{x^{2}} x -5 \,{\mathrm e}+6 x +5 \,{\mathrm e}^{x^{2}}\right ) \ln \relax (x )}{\left (x -2\right ) x}-\frac {2 \left (2 x^{2} \ln \relax (x )-4 x \ln \relax (x )+7 \,{\mathrm e}-14 x -7 \,{\mathrm e}^{x^{2}}\right )}{\left (x -2\right ) x}\) | \(75\) |
default | \(\frac {10 \,{\mathrm e}^{x^{2}} \ln \relax (x )-2 x \,{\mathrm e}^{x^{2}} \ln \relax (x )+14 \,{\mathrm e}^{x^{2}}}{x \left (x -2\right )}+\frac {3 \,{\mathrm e} \ln \relax (x )}{2}-10 \ln \relax (x )+\frac {7 \,{\mathrm e}}{x}-\frac {7 \,{\mathrm e}}{x -2}+\frac {28}{x -2}+\frac {5 \,{\mathrm e} \ln \relax (x )}{x}-\frac {3 \,{\mathrm e} \ln \relax (x ) x}{2 \left (x -2\right )}+\frac {6 \ln \relax (x ) x}{x -2}\) | \(99\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.44, size = 142, normalized size = 4.44 \begin {gather*} 2 \, {\left (\frac {2 \, {\left (x - 1\right )}}{x^{2} - 2 \, x} + \log \left (x - 2\right ) - \log \relax (x)\right )} e - \frac {7}{2} \, {\left (\frac {2}{x - 2} + \log \left (x - 2\right ) - \log \relax (x)\right )} e + \frac {3}{2} \, {\left (e - 4\right )} \log \left (x - 2\right ) + \frac {10 \, x e - 4 \, {\left ({\left (x - 5\right )} \log \relax (x) - 7\right )} e^{\left (x^{2}\right )} - {\left (3 \, x^{2} {\left (e - 4\right )} - 10 \, x e + 20 \, e\right )} \log \relax (x) - 20 \, e}{2 \, {\left (x^{2} - 2 \, x\right )}} - \frac {2 \, e}{x - 2} + \frac {28}{x - 2} + 6 \, \log \left (x - 2\right ) - 10 \, \log \relax (x) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int -\frac {40\,x-\mathrm {e}\,\left (2\,x^2+14\,x-8\right )+{\mathrm {e}}^{x^2}\,\left (-28\,x^3+58\,x^2+14\,x-8\right )+\ln \relax (x)\,\left (\mathrm {e}\,\left (2\,x^2-20\,x+20\right )+{\mathrm {e}}^{x^2}\,\left (4\,x^4-28\,x^3+38\,x^2+20\,x-20\right )+12\,x^2\right )+4\,x^3}{x^4-4\,x^3+4\,x^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.74, size = 70, normalized size = 2.19 \begin {gather*} - \frac {- 28 x + 14 e}{x^{2} - 2 x} - 4 \log {\relax (x )} + \frac {\left (2 e x + 12 x - 10 e\right ) \log {\relax (x )}}{x^{2} - 2 x} + \frac {\left (- 2 x \log {\relax (x )} + 10 \log {\relax (x )} + 14\right ) e^{x^{2}}}{x^{2} - 2 x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________