Optimal. Leaf size=31 \[ -2-e^x-\frac {5}{3-x}-x-\frac {(-2+x) \log \left (x^2\right )}{x^2} \]
________________________________________________________________________________________
Rubi [A] time = 0.73, antiderivative size = 42, normalized size of antiderivative = 1.35, number of steps used = 19, number of rules used = 9, integrand size = 80, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.112, Rules used = {1594, 27, 6742, 2194, 44, 43, 37, 2334, 12} \begin {gather*} \frac {(4-x)^2 \log \left (x^2\right )}{8 x^2}-e^x-x-\frac {5}{3-x}-\frac {\log (x)}{4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 27
Rule 37
Rule 43
Rule 44
Rule 1594
Rule 2194
Rule 2334
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {36-42 x+16 x^2-16 x^3+6 x^4-x^5+e^x \left (-9 x^3+6 x^4-x^5\right )+\left (-36+33 x-10 x^2+x^3\right ) \log \left (x^2\right )}{x^3 \left (9-6 x+x^2\right )} \, dx\\ &=\int \frac {36-42 x+16 x^2-16 x^3+6 x^4-x^5+e^x \left (-9 x^3+6 x^4-x^5\right )+\left (-36+33 x-10 x^2+x^3\right ) \log \left (x^2\right )}{(-3+x)^2 x^3} \, dx\\ &=\int \left (-e^x-\frac {16}{(-3+x)^2}+\frac {36}{(-3+x)^2 x^3}-\frac {42}{(-3+x)^2 x^2}+\frac {16}{(-3+x)^2 x}+\frac {6 x}{(-3+x)^2}-\frac {x^2}{(-3+x)^2}+\frac {(-4+x) \log \left (x^2\right )}{x^3}\right ) \, dx\\ &=-\frac {16}{3-x}+6 \int \frac {x}{(-3+x)^2} \, dx+16 \int \frac {1}{(-3+x)^2 x} \, dx+36 \int \frac {1}{(-3+x)^2 x^3} \, dx-42 \int \frac {1}{(-3+x)^2 x^2} \, dx-\int e^x \, dx-\int \frac {x^2}{(-3+x)^2} \, dx+\int \frac {(-4+x) \log \left (x^2\right )}{x^3} \, dx\\ &=-e^x-\frac {16}{3-x}+\frac {(4-x)^2 \log \left (x^2\right )}{8 x^2}-2 \int \frac {(4-x)^2}{8 x^3} \, dx+6 \int \left (\frac {3}{(-3+x)^2}+\frac {1}{-3+x}\right ) \, dx+16 \int \left (\frac {1}{3 (-3+x)^2}-\frac {1}{9 (-3+x)}+\frac {1}{9 x}\right ) \, dx+36 \int \left (\frac {1}{27 (-3+x)^2}-\frac {1}{27 (-3+x)}+\frac {1}{9 x^3}+\frac {2}{27 x^2}+\frac {1}{27 x}\right ) \, dx-42 \int \left (\frac {1}{9 (-3+x)^2}-\frac {2}{27 (-3+x)}+\frac {1}{9 x^2}+\frac {2}{27 x}\right ) \, dx-\int \left (1+\frac {9}{(-3+x)^2}+\frac {6}{-3+x}\right ) \, dx\\ &=-e^x-\frac {5}{3-x}-\frac {2}{x^2}+\frac {2}{x}-x+\frac {(4-x)^2 \log \left (x^2\right )}{8 x^2}-\frac {1}{4} \int \frac {(4-x)^2}{x^3} \, dx\\ &=-e^x-\frac {5}{3-x}-\frac {2}{x^2}+\frac {2}{x}-x+\frac {(4-x)^2 \log \left (x^2\right )}{8 x^2}-\frac {1}{4} \int \left (\frac {16}{x^3}-\frac {8}{x^2}+\frac {1}{x}\right ) \, dx\\ &=-e^x-\frac {5}{3-x}-x-\frac {\log (x)}{4}+\frac {(4-x)^2 \log \left (x^2\right )}{8 x^2}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.21, size = 28, normalized size = 0.90 \begin {gather*} -e^x+\frac {5}{-3+x}-x-\frac {(-2+x) \log \left (x^2\right )}{x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.48, size = 52, normalized size = 1.68 \begin {gather*} -\frac {x^{4} - 3 \, x^{3} - 5 \, x^{2} + {\left (x^{3} - 3 \, x^{2}\right )} e^{x} + {\left (x^{2} - 5 \, x + 6\right )} \log \left (x^{2}\right )}{x^{3} - 3 \, x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.81, size = 61, normalized size = 1.97 \begin {gather*} -\frac {x^{4} + x^{3} e^{x} - 3 \, x^{3} - 3 \, x^{2} e^{x} + x^{2} \log \left (x^{2}\right ) - 5 \, x^{2} - 5 \, x \log \left (x^{2}\right ) + 6 \, \log \left (x^{2}\right )}{x^{3} - 3 \, x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.10, size = 34, normalized size = 1.10
method | result | size |
default | \(-\frac {\ln \left (x^{2}\right )}{x}+\frac {2 \ln \left (x^{2}\right )}{x^{2}}-x +\frac {5}{x -3}-{\mathrm e}^{x}\) | \(34\) |
risch | \(-\frac {2 \left (x -2\right ) \ln \relax (x )}{x^{2}}-\frac {-i \pi \,x^{2} \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right )+2 i \pi \,x^{2} \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2}-i \pi \,x^{2} \mathrm {csgn}\left (i x^{2}\right )^{3}+5 i \pi x \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right )-10 i \pi x \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2}+5 i \pi x \mathrm {csgn}\left (i x^{2}\right )^{3}-6 i \pi \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right )+12 i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2}-6 i \pi \mathrm {csgn}\left (i x^{2}\right )^{3}+2 x^{4}+2 \,{\mathrm e}^{x} x^{3}-6 x^{3}-6 \,{\mathrm e}^{x} x^{2}-10 x^{2}}{2 x^{2} \left (x -3\right )}\) | \(211\) |
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*} -x + \frac {9 \, e^{3} E_{2}\left (-x + 3\right )}{x - 3} - \frac {2 \, {\left (2 \, x^{2} - 3 \, x - 3\right )}}{x^{3} - 3 \, x^{2}} + \frac {14 \, {\left (2 \, x - 3\right )}}{3 \, {\left (x^{2} - 3 \, x\right )}} + \frac {5}{3 \, {\left (x - 3\right )}} - \frac {2 \, {\left ({\left (x - 2\right )} \log \relax (x) + x - 1\right )}}{x^{2}} - \int \frac {{\left (x^{2} - 6 \, x\right )} e^{x}}{x^{2} - 6 \, x + 9}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.71, size = 27, normalized size = 0.87 \begin {gather*} \frac {5}{x-3}-{\mathrm {e}}^x-x-\frac {\ln \left (x^2\right )\,\left (x-2\right )}{x^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.38, size = 20, normalized size = 0.65 \begin {gather*} - x - e^{x} + \frac {5}{x - 3} + \frac {\left (2 - x\right ) \log {\left (x^{2} \right )}}{x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________