Optimal. Leaf size=26 \[ -x^2+\frac {1}{5} \left (-x+9 x^2\right ) \log \left (-3+x+x^2\right ) \]
________________________________________________________________________________________
Rubi [B] time = 0.21, antiderivative size = 124, normalized size of antiderivative = 4.77, number of steps used = 13, number of rules used = 6, integrand size = 50, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {6728, 1628, 632, 31, 2525, 800} \begin {gather*} -x^2+\frac {1}{180} (1-18 x)^2 \log \left (x^2+x-3\right )+\frac {1}{5} \left (32-5 \sqrt {13}\right ) \log \left (2 x-\sqrt {13}+1\right )-\frac {1}{180} \left (1153-180 \sqrt {13}\right ) \log \left (2 x-\sqrt {13}+1\right )-\frac {1}{180} \left (1153+180 \sqrt {13}\right ) \log \left (2 x+\sqrt {13}+1\right )+\frac {1}{5} \left (32+5 \sqrt {13}\right ) \log \left (2 x+\sqrt {13}+1\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 632
Rule 800
Rule 1628
Rule 2525
Rule 6728
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (\frac {x \left (29-3 x+8 x^2\right )}{5 \left (-3+x+x^2\right )}+\frac {1}{5} (-1+18 x) \log \left (-3+x+x^2\right )\right ) \, dx\\ &=\frac {1}{5} \int \frac {x \left (29-3 x+8 x^2\right )}{-3+x+x^2} \, dx+\frac {1}{5} \int (-1+18 x) \log \left (-3+x+x^2\right ) \, dx\\ &=\frac {1}{180} (1-18 x)^2 \log \left (-3+x+x^2\right )-\frac {1}{180} \int \frac {(1+2 x) (-1+18 x)^2}{-3+x+x^2} \, dx+\frac {1}{5} \int \left (-11+8 x-\frac {33-64 x}{-3+x+x^2}\right ) \, dx\\ &=-\frac {11 x}{5}+\frac {4 x^2}{5}+\frac {1}{180} (1-18 x)^2 \log \left (-3+x+x^2\right )-\frac {1}{180} \int \left (-396+648 x-\frac {1187-2306 x}{-3+x+x^2}\right ) \, dx-\frac {1}{5} \int \frac {33-64 x}{-3+x+x^2} \, dx\\ &=-x^2+\frac {1}{180} (1-18 x)^2 \log \left (-3+x+x^2\right )+\frac {1}{180} \int \frac {1187-2306 x}{-3+x+x^2} \, dx-\frac {1}{5} \left (-32-5 \sqrt {13}\right ) \int \frac {1}{\frac {1}{2}+\frac {\sqrt {13}}{2}+x} \, dx-\frac {1}{5} \left (-32+5 \sqrt {13}\right ) \int \frac {1}{\frac {1}{2}-\frac {\sqrt {13}}{2}+x} \, dx\\ &=-x^2+\frac {1}{5} \left (32-5 \sqrt {13}\right ) \log \left (1-\sqrt {13}+2 x\right )+\frac {1}{5} \left (32+5 \sqrt {13}\right ) \log \left (1+\sqrt {13}+2 x\right )+\frac {1}{180} (1-18 x)^2 \log \left (-3+x+x^2\right )+\frac {1}{180} \left (-1153-180 \sqrt {13}\right ) \int \frac {1}{\frac {1}{2}+\frac {\sqrt {13}}{2}+x} \, dx+\frac {1}{180} \left (-1153+180 \sqrt {13}\right ) \int \frac {1}{\frac {1}{2}-\frac {\sqrt {13}}{2}+x} \, dx\\ &=-x^2-\frac {1}{180} \left (1153-180 \sqrt {13}\right ) \log \left (1-\sqrt {13}+2 x\right )+\frac {1}{5} \left (32-5 \sqrt {13}\right ) \log \left (1-\sqrt {13}+2 x\right )+\frac {1}{5} \left (32+5 \sqrt {13}\right ) \log \left (1+\sqrt {13}+2 x\right )-\frac {1}{180} \left (1153+180 \sqrt {13}\right ) \log \left (1+\sqrt {13}+2 x\right )+\frac {1}{180} (1-18 x)^2 \log \left (-3+x+x^2\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.10, size = 32, normalized size = 1.23 \begin {gather*} \frac {1}{5} \left (-5 x^2-x \log \left (-3+x+x^2\right )+9 x^2 \log \left (-3+x+x^2\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.70, size = 24, normalized size = 0.92 \begin {gather*} -x^{2} + \frac {1}{5} \, {\left (9 \, x^{2} - x\right )} \log \left (x^{2} + x - 3\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 24, normalized size = 0.92 \begin {gather*} -x^{2} + \frac {1}{5} \, {\left (9 \, x^{2} - x\right )} \log \left (x^{2} + x - 3\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.15, size = 24, normalized size = 0.92
method | result | size |
risch | \(\left (\frac {9}{5} x^{2}-\frac {1}{5} x \right ) \ln \left (x^{2}+x -3\right )-x^{2}\) | \(24\) |
default | \(\frac {9 \ln \left (x^{2}+x -3\right ) x^{2}}{5}-x^{2}-\frac {\ln \left (x^{2}+x -3\right ) x}{5}\) | \(29\) |
norman | \(\frac {9 \ln \left (x^{2}+x -3\right ) x^{2}}{5}-x^{2}-\frac {\ln \left (x^{2}+x -3\right ) x}{5}\) | \(29\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.53, size = 34, normalized size = 1.31 \begin {gather*} -x^{2} + \frac {1}{5} \, {\left (9 \, x^{2} - x - 32\right )} \log \left (x^{2} + x - 3\right ) + \frac {32}{5} \, \log \left (x^{2} + x - 3\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.24, size = 26, normalized size = 1.00 \begin {gather*} x^2\,\left (\frac {9\,\ln \left (x^2+x-3\right )}{5}-1\right )-\frac {x\,\ln \left (x^2+x-3\right )}{5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.15, size = 20, normalized size = 0.77 \begin {gather*} - x^{2} + \left (\frac {9 x^{2}}{5} - \frac {x}{5}\right ) \log {\left (x^{2} + x - 3 \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________