Optimal. Leaf size=25 \[ -2+\frac {x}{-x+\frac {x}{\frac {2}{x}+x}}+x \log (x) \]
________________________________________________________________________________________
Rubi [B] time = 0.31, antiderivative size = 119, normalized size of antiderivative = 4.76, number of steps used = 26, number of rules used = 13, integrand size = 60, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {6688, 6742, 614, 618, 204, 638, 722, 738, 773, 634, 628, 800, 2295} \begin {gather*} \frac {2 (4-x) x^2}{7 \left (x^2-x+2\right )}-\frac {x^2}{7}-\frac {6 (4-x) x}{7 \left (x^2-x+2\right )}-\frac {2 (1-2 x)}{7 \left (x^2-x+2\right )}+\frac {4 (4-x)}{7 \left (x^2-x+2\right )}-\frac {(4-x) x^3}{7 \left (x^2-x+2\right )}+\frac {5 x}{7}+x \log (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 614
Rule 618
Rule 628
Rule 634
Rule 638
Rule 722
Rule 738
Rule 773
Rule 800
Rule 2295
Rule 6688
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {2-4 x+6 x^2-2 x^3+x^4+\left (2-x+x^2\right )^2 \log (x)}{\left (2-x+x^2\right )^2} \, dx\\ &=\int \left (\frac {2}{\left (2-x+x^2\right )^2}-\frac {4 x}{\left (2-x+x^2\right )^2}+\frac {6 x^2}{\left (2-x+x^2\right )^2}-\frac {2 x^3}{\left (2-x+x^2\right )^2}+\frac {x^4}{\left (2-x+x^2\right )^2}+\log (x)\right ) \, dx\\ &=2 \int \frac {1}{\left (2-x+x^2\right )^2} \, dx-2 \int \frac {x^3}{\left (2-x+x^2\right )^2} \, dx-4 \int \frac {x}{\left (2-x+x^2\right )^2} \, dx+6 \int \frac {x^2}{\left (2-x+x^2\right )^2} \, dx+\int \frac {x^4}{\left (2-x+x^2\right )^2} \, dx+\int \log (x) \, dx\\ &=-x-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}+x \log (x)+\frac {1}{7} \int \frac {(12-2 x) x^2}{2-x+x^2} \, dx-\frac {2}{7} \int \frac {(8-x) x}{2-x+x^2} \, dx+\frac {24}{7} \int \frac {1}{2-x+x^2} \, dx\\ &=-\frac {5 x}{7}-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}+x \log (x)+\frac {1}{7} \int \left (10-2 x-\frac {2 (10-7 x)}{2-x+x^2}\right ) \, dx-\frac {2}{7} \int \frac {2+7 x}{2-x+x^2} \, dx-\frac {48}{7} \operatorname {Subst}\left (\int \frac {1}{-7-x^2} \, dx,x,-1+2 x\right )\\ &=\frac {5 x}{7}-\frac {x^2}{7}-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}-\frac {48 \tan ^{-1}\left (\frac {1-2 x}{\sqrt {7}}\right )}{7 \sqrt {7}}+x \log (x)-\frac {2}{7} \int \frac {10-7 x}{2-x+x^2} \, dx-\frac {11}{7} \int \frac {1}{2-x+x^2} \, dx-\int \frac {-1+2 x}{2-x+x^2} \, dx\\ &=\frac {5 x}{7}-\frac {x^2}{7}-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}-\frac {48 \tan ^{-1}\left (\frac {1-2 x}{\sqrt {7}}\right )}{7 \sqrt {7}}+x \log (x)-\log \left (2-x+x^2\right )-\frac {13}{7} \int \frac {1}{2-x+x^2} \, dx+\frac {22}{7} \operatorname {Subst}\left (\int \frac {1}{-7-x^2} \, dx,x,-1+2 x\right )+\int \frac {-1+2 x}{2-x+x^2} \, dx\\ &=\frac {5 x}{7}-\frac {x^2}{7}-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}-\frac {26 \tan ^{-1}\left (\frac {1-2 x}{\sqrt {7}}\right )}{7 \sqrt {7}}+x \log (x)+\frac {26}{7} \operatorname {Subst}\left (\int \frac {1}{-7-x^2} \, dx,x,-1+2 x\right )\\ &=\frac {5 x}{7}-\frac {x^2}{7}-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}+x \log (x)\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.08, size = 15, normalized size = 0.60 \begin {gather*} x \left (\frac {1}{-2+x-x^2}+\log (x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.70, size = 30, normalized size = 1.20 \begin {gather*} \frac {{\left (x^{3} - x^{2} + 2 \, x\right )} \log \relax (x) - x}{x^{2} - x + 2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 18, normalized size = 0.72 \begin {gather*} x \log \relax (x) - \frac {x}{x^{2} - x + 2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.03, size = 19, normalized size = 0.76
method | result | size |
default | \(-\frac {x}{x^{2}-x +2}+x \ln \relax (x )\) | \(19\) |
risch | \(-\frac {x}{x^{2}-x +2}+x \ln \relax (x )\) | \(19\) |
norman | \(\frac {x^{3} \ln \relax (x )-x +2 x \ln \relax (x )-x^{2} \ln \relax (x )}{x^{2}-x +2}\) | \(34\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.62, size = 86, normalized size = 3.44 \begin {gather*} x \log \relax (x) + \frac {2 \, {\left (5 \, x - 6\right )}}{7 \, {\left (x^{2} - x + 2\right )}} - \frac {6 \, {\left (3 \, x + 2\right )}}{7 \, {\left (x^{2} - x + 2\right )}} + \frac {2 \, {\left (2 \, x - 1\right )}}{7 \, {\left (x^{2} - x + 2\right )}} + \frac {x + 10}{7 \, {\left (x^{2} - x + 2\right )}} - \frac {4 \, {\left (x - 4\right )}}{7 \, {\left (x^{2} - x + 2\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.21, size = 18, normalized size = 0.72 \begin {gather*} x\,\ln \relax (x)-\frac {x}{x^2-x+2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.13, size = 12, normalized size = 0.48 \begin {gather*} x \log {\relax (x )} - \frac {x}{x^{2} - x + 2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________