Optimal. Leaf size=24 \[ 2-x+\frac {3 \log \left (\frac {3 e^x (-3+x)}{x^2}\right )}{1+x} \]
________________________________________________________________________________________
Rubi [A] time = 0.52, 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 = {6741, 6742, 44, 72, 77, 88, 2551, 1612} \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 44
Rule 72
Rule 77
Rule 88
Rule 1612
Rule 2551
Rule 6741
Rule 6742
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.10, 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]
________________________________________________________________________________________
fricas [A] time = 1.16, 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]
________________________________________________________________________________________
giac [A] time = 0.54, 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]
________________________________________________________________________________________
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 {-6 i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i 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 (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}+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}+3 i \pi \mathrm {csgn}\left (i x^{2}\right )^{3}+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 (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 (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 {\mathrm e}^{x}\right ) \mathrm {csgn}\left (i {\mathrm e}^{x} \left (x -3\right )\right )^{2}-3 i \pi \mathrm {csgn}\left (\frac {i \left (x -3\right ) {\mathrm e}^{x}}{x^{2}}\right )^{3}-2 x^{2}+6 \ln \relax (3)-2 x -12 \ln \relax (x )+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.66, size = 40, normalized size = 1.67 \begin {gather*} -x - \frac {3 \, {\left ({\left (x - 3\right )} \log \left (x - 3\right ) - 8 \, x \log \relax (x) - 4 \, \log \relax (3) + 4\right )}}{4 \, {\left (x + 1\right )}} + \frac {3}{4} \, \log \left (x - 3\right ) - 6 \, \log \relax (x) \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]
________________________________________________________________________________________
sympy [A] time = 0.21, 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]
________________________________________________________________________________________