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.0672271, antiderivative size = 49, normalized size of antiderivative = 1., 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 1647
Rule 1629
Rule 635
Rule 203
Rule 260
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.026986, 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]
________________________________________________________________________________________
Maple [A] time = 0.009, size = 37, normalized size = 0.8 \begin{align*}{\frac{1}{2\,{x}^{2}+4}}+{\frac{\ln \left ({x}^{2}+2 \right ) }{3}}-{\frac{\sqrt{2}}{6}\arctan \left ({\frac{x\sqrt{2}}{2}} \right ) }+{\frac{\ln \left ( -1+x \right ) }{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.48141, size = 49, normalized size = 1. \begin{align*} -\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 ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.7595, size = 154, normalized size = 3.14 \begin{align*} -\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 )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.155543, size = 14, normalized size = 0.29 \begin{align*} \frac{\log{\left (x - 1 \right )}}{3} + \frac{1}{2 x^{2} + 4} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.07925, size = 50, normalized size = 1.02 \begin{align*} -\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 ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]