Optimal. Leaf size=24 \[ 2-x+\frac {3 \log \left (\frac {3 e^x (-3+x)}{x^2}\right )}{1+x} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.34, antiderivative size = 25, normalized size of antiderivative = 1.04, number of steps
used = 16, number of rules used = 8, integrand size = 63, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.127, Rules used = {6873, 6874,
46, 84, 78, 90, 2631, 1626} \begin {gather*} \frac {3 \log \left (-\frac {3 e^x (3-x)}{x^2}\right )}{x+1}-x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 78
Rule 84
Rule 90
Rule 1626
Rule 2631
Rule 6873
Rule 6874
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-18-9 x+4 x^2-4 x^3+x^4-\left (9 x-3 x^2\right ) \log \left (\frac {e^x (-9+3 x)}{x^2}\right )}{x \left (3+5 x+x^2-x^3\right )} \, dx\\ &=\int \left (\frac {9}{(-3+x) (1+x)^2}+\frac {18}{(-3+x) x (1+x)^2}-\frac {4 x}{(-3+x) (1+x)^2}+\frac {4 x^2}{(-3+x) (1+x)^2}-\frac {x^3}{(-3+x) (1+x)^2}-\frac {3 \log \left (\frac {3 e^x (-3+x)}{x^2}\right )}{(1+x)^2}\right ) \, dx\\ &=-\left (3 \int \frac {\log \left (\frac {3 e^x (-3+x)}{x^2}\right )}{(1+x)^2} \, dx\right )-4 \int \frac {x}{(-3+x) (1+x)^2} \, dx+4 \int \frac {x^2}{(-3+x) (1+x)^2} \, dx+9 \int \frac {1}{(-3+x) (1+x)^2} \, dx+18 \int \frac {1}{(-3+x) x (1+x)^2} \, dx-\int \frac {x^3}{(-3+x) (1+x)^2} \, dx\\ &=\frac {3 \log \left (-\frac {3 e^x (3-x)}{x^2}\right )}{1+x}-3 \int \frac {-6+4 x-x^2}{(3-x) x (1+x)} \, dx-4 \int \left (\frac {3}{16 (-3+x)}+\frac {1}{4 (1+x)^2}-\frac {3}{16 (1+x)}\right ) \, dx+4 \int \left (\frac {9}{16 (-3+x)}-\frac {1}{4 (1+x)^2}+\frac {7}{16 (1+x)}\right ) \, dx+9 \int \left (\frac {1}{16 (-3+x)}-\frac {1}{4 (1+x)^2}-\frac {1}{16 (1+x)}\right ) \, dx+18 \int \left (\frac {1}{48 (-3+x)}-\frac {1}{3 x}+\frac {1}{4 (1+x)^2}+\frac {5}{16 (1+x)}\right ) \, dx-\int \left (1+\frac {27}{16 (-3+x)}+\frac {1}{4 (1+x)^2}-\frac {11}{16 (1+x)}\right ) \, dx\\ &=-x+\frac {3}{4} \log (3-x)+\frac {3 \log \left (-\frac {3 e^x (3-x)}{x^2}\right )}{1+x}-6 \log (x)+\frac {33}{4} \log (1+x)-3 \int \left (\frac {1}{4 (-3+x)}-\frac {2}{x}+\frac {11}{4 (1+x)}\right ) \, dx\\ &=-x+\frac {3 \log \left (-\frac {3 e^x (3-x)}{x^2}\right )}{1+x}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 25, normalized size = 1.04 \begin {gather*} -x+\frac {3 \log \left (-\frac {3 e^x (3-x)}{x^2}\right )}{1+x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 24, normalized size = 1.00
method | result | size |
default | \(\frac {3 \ln \left (\frac {\left (3 x -9\right ) {\mathrm e}^{x}}{x^{2}}\right )}{x +1}-x\) | \(24\) |
norman | \(\frac {-x^{2}+3 \ln \left (\frac {\left (3 x -9\right ) {\mathrm e}^{x}}{x^{2}}\right )+1}{x +1}\) | \(28\) |
risch | \(\frac {3 \ln \left ({\mathrm e}^{x}\right )}{x +1}+\frac {-3 i \pi \,\mathrm {csgn}\left (i \left (x -3\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{x}\right ) \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right )-3 i \pi \mathrm {csgn}\left (\frac {i \left (x -3\right ) {\mathrm e}^{x}}{x^{2}}\right )^{3}+3 i \pi \,\mathrm {csgn}\left (i \left (x -3\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right )^{2}+3 i \pi \mathrm {csgn}\left (i x^{2}\right )^{3}+3 i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{x}\right ) \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right )^{2}+3 i \pi \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right )-3 i \pi \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right )^{3}-6 i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2}+3 i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right ) \mathrm {csgn}\left (\frac {i \left (x -3\right ) {\mathrm e}^{x}}{x^{2}}\right )^{2}-3 i \pi \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right ) \mathrm {csgn}\left (\frac {i \left (x -3\right ) {\mathrm e}^{x}}{x^{2}}\right )+3 i \pi \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (\frac {i \left (x -3\right ) {\mathrm e}^{x}}{x^{2}}\right )^{2}-2 x^{2}+6 \ln \left (3\right )-2 x -12 \ln \left (x \right )+6 \ln \left (x -3\right )}{2 x +2}\) | \(277\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.56, size = 40, normalized size = 1.67 \begin {gather*} -x - \frac {3 \, {\left ({\left (x - 3\right )} \log \left (x - 3\right ) - 8 \, x \log \left (x\right ) - 4 \, \log \left (3\right ) + 4\right )}}{4 \, {\left (x + 1\right )}} + \frac {3}{4} \, \log \left (x - 3\right ) - 6 \, \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.31, size = 25, normalized size = 1.04 \begin {gather*} -\frac {x^{2} + x - 3 \, \log \left (\frac {3 \, {\left (x - 3\right )} e^{x}}{x^{2}}\right )}{x + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.11, size = 19, normalized size = 0.79 \begin {gather*} - x + \frac {3 \log {\left (\frac {\left (3 x - 9\right ) e^{x}}{x^{2}} \right )}}{x + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 27, normalized size = 1.12 \begin {gather*} -x + \frac {3 \, \log \left (\frac {3 \, {\left (x - 3\right )}}{x^{2}}\right )}{x + 1} - \frac {3}{x + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.58, size = 23, normalized size = 0.96 \begin {gather*} \frac {3\,\ln \left (\frac {{\mathrm {e}}^x\,\left (3\,x-9\right )}{x^2}\right )}{x+1}-x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________