Optimal. Leaf size=36 \[ -\frac{1}{2} \log \left (x^2+1\right )+\log \left (x^2+2\right )+6 \tan ^{-1}(x)-5 \sqrt{2} \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.117578, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 4, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.16, Rules used = {6725, 635, 203, 260} \[ -\frac{1}{2} \log \left (x^2+1\right )+\log \left (x^2+2\right )+6 \tan ^{-1}(x)-5 \sqrt{2} \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6725
Rule 635
Rule 203
Rule 260
Rubi steps
\begin{align*} \int \frac{2-4 x^2+x^3}{\left (1+x^2\right ) \left (2+x^2\right )} \, dx &=\int \left (\frac{6-x}{1+x^2}+\frac{2 (-5+x)}{2+x^2}\right ) \, dx\\ &=2 \int \frac{-5+x}{2+x^2} \, dx+\int \frac{6-x}{1+x^2} \, dx\\ &=2 \int \frac{x}{2+x^2} \, dx+6 \int \frac{1}{1+x^2} \, dx-10 \int \frac{1}{2+x^2} \, dx-\int \frac{x}{1+x^2} \, dx\\ &=6 \tan ^{-1}(x)-5 \sqrt{2} \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right )-\frac{1}{2} \log \left (1+x^2\right )+\log \left (2+x^2\right )\\ \end{align*}
Mathematica [A] time = 0.0152253, size = 36, normalized size = 1. \[ -\frac{1}{2} \log \left (x^2+1\right )+\log \left (x^2+2\right )+6 \tan ^{-1}(x)-5 \sqrt{2} \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.005, size = 32, normalized size = 0.9 \begin{align*} 6\,\arctan \left ( x \right ) -{\frac{\ln \left ({x}^{2}+1 \right ) }{2}}+\ln \left ({x}^{2}+2 \right ) -5\,\arctan \left ( 1/2\,x\sqrt{2} \right ) \sqrt{2} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.40449, size = 42, normalized size = 1.17 \begin{align*} -5 \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) + 6 \, \arctan \left (x\right ) + \log \left (x^{2} + 2\right ) - \frac{1}{2} \, \log \left (x^{2} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.88212, size = 111, normalized size = 3.08 \begin{align*} -5 \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) + 6 \, \arctan \left (x\right ) + \log \left (x^{2} + 2\right ) - \frac{1}{2} \, \log \left (x^{2} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.168758, size = 36, normalized size = 1. \begin{align*} - \frac{\log{\left (x^{2} + 1 \right )}}{2} + \log{\left (x^{2} + 2 \right )} + 6 \operatorname{atan}{\left (x \right )} - 5 \sqrt{2} \operatorname{atan}{\left (\frac{\sqrt{2} x}{2} \right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.055, size = 42, normalized size = 1.17 \begin{align*} -5 \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) + 6 \, \arctan \left (x\right ) + \log \left (x^{2} + 2\right ) - \frac{1}{2} \, \log \left (x^{2} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]