Optimal. Leaf size=49 \[ \frac {1}{2 \left (x^2+2\right )}+\frac {1}{3} \log \left (x^2+2\right )+\frac {1}{3} \log (1-x)-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {2}}\right )}{3 \sqrt {2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {1647, 1629, 635, 203, 260} \[ \frac {1}{2 \left (x^2+2\right )}+\frac {1}{3} \log \left (x^2+2\right )+\frac {1}{3} \log (1-x)-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {2}}\right )}{3 \sqrt {2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 260
Rule 635
Rule 1629
Rule 1647
Rubi steps
\begin {align*} \int \frac {2-x+2 x^2-x^3+x^4}{(-1+x) \left (2+x^2\right )^2} \, dx &=\frac {1}{2 \left (2+x^2\right )}-\frac {1}{4} \int \frac {-4+4 x-4 x^2}{(-1+x) \left (2+x^2\right )} \, dx\\ &=\frac {1}{2 \left (2+x^2\right )}-\frac {1}{4} \int \left (-\frac {4}{3 (-1+x)}-\frac {4 (-1+2 x)}{3 \left (2+x^2\right )}\right ) \, dx\\ &=\frac {1}{2 \left (2+x^2\right )}+\frac {1}{3} \log (1-x)+\frac {1}{3} \int \frac {-1+2 x}{2+x^2} \, dx\\ &=\frac {1}{2 \left (2+x^2\right )}+\frac {1}{3} \log (1-x)-\frac {1}{3} \int \frac {1}{2+x^2} \, dx+\frac {2}{3} \int \frac {x}{2+x^2} \, dx\\ &=\frac {1}{2 \left (2+x^2\right )}-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {2}}\right )}{3 \sqrt {2}}+\frac {1}{3} \log (1-x)+\frac {1}{3} \log \left (2+x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 61, normalized size = 1.24 \[ \frac {1}{2 \left ((x-1)^2+2 (x-1)+3\right )}+\frac {1}{3} \log \left ((x-1)^2+2 (x-1)+3\right )+\frac {1}{3} \log (x-1)-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {2}}\right )}{3 \sqrt {2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.40, size = 51, normalized size = 1.04 \[ -\frac {\sqrt {2} {\left (x^{2} + 2\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) - 2 \, {\left (x^{2} + 2\right )} \log \left (x^{2} + 2\right ) - 2 \, {\left (x^{2} + 2\right )} \log \left (x - 1\right ) - 3}{6 \, {\left (x^{2} + 2\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.01, size = 37, normalized size = 0.76 \[ -\frac {1}{6} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + \frac {1}{2 \, {\left (x^{2} + 2\right )}} + \frac {1}{3} \, \log \left (x^{2} + 2\right ) + \frac {1}{3} \, \log \left ({\left | x - 1 \right |}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 37, normalized size = 0.76 \[ -\frac {\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, x}{2}\right )}{6}+\frac {\ln \left (x -1\right )}{3}+\frac {\ln \left (x^{2}+2\right )}{3}+\frac {1}{2 x^{2}+4} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.30, size = 36, normalized size = 0.73 \[ -\frac {1}{6} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + \frac {1}{2 \, {\left (x^{2} + 2\right )}} + \frac {1}{3} \, \log \left (x^{2} + 2\right ) + \frac {1}{3} \, \log \left (x - 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.10, size = 53, normalized size = 1.08 \[ \frac {\ln \left (x-1\right )}{3}+\ln \left (x-\sqrt {2}\,1{}\mathrm {i}\right )\,\left (\frac {1}{3}+\frac {\sqrt {2}\,1{}\mathrm {i}}{12}\right )-\ln \left (x+\sqrt {2}\,1{}\mathrm {i}\right )\,\left (-\frac {1}{3}+\frac {\sqrt {2}\,1{}\mathrm {i}}{12}\right )+\frac {1}{2\,\left (x^2+2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.17, size = 14, normalized size = 0.29 \[ \frac {\log {\left (x - 1 \right )}}{3} + \frac {1}{2 x^{2} + 4} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________