Optimal. Leaf size=49 \[ \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 ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, 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 = {1661, 1643,
649, 209, 266} \begin {gather*} -\frac {\text {ArcTan}\left (\frac {x}{\sqrt {2}}\right )}{3 \sqrt {2}}+\frac {1}{2 \left (x^2+2\right )}+\frac {1}{3} \log \left (x^2+2\right )+\frac {1}{3} \log (1-x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 266
Rule 649
Rule 1643
Rule 1661
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.02, size = 61, normalized size = 1.24 \begin {gather*} \frac {1}{2 \left (3+2 (-1+x)+(-1+x)^2\right )}-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {2}}\right )}{3 \sqrt {2}}+\frac {1}{3} \log \left (3+2 (-1+x)+(-1+x)^2\right )+\frac {1}{3} \log (-1+x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 37, normalized size = 0.76
method | result | size |
default | \(\frac {1}{2 x^{2}+4}+\frac {\ln \left (x^{2}+2\right )}{3}-\frac {\arctan \left (\frac {x \sqrt {2}}{2}\right ) \sqrt {2}}{6}+\frac {\ln \left (-1+x \right )}{3}\) | \(37\) |
risch | \(\frac {1}{2 x^{2}+4}+\frac {\ln \left (x^{2}+2\right )}{3}-\frac {\arctan \left (\frac {x \sqrt {2}}{2}\right ) \sqrt {2}}{6}+\frac {\ln \left (-1+x \right )}{3}\) | \(37\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 3.45, size = 36, normalized size = 0.73 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.64, size = 51, normalized size = 1.04 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.07, size = 14, normalized size = 0.29 \begin {gather*} \frac {\log {\left (x - 1 \right )}}{3} + \frac {1}{2 x^{2} + 4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 37, normalized size = 0.76 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.10, size = 53, normalized size = 1.08 \begin {gather*} \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 )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________