Optimal. Leaf size=50 \[ -\frac{1}{2} \log \left (x^2+1\right )+\frac{1}{4} \log \left (x^2+2 x+2\right )-\frac{\tan ^{-1}\left (x^2+x+1\right )}{x}+\frac{\log (x)}{2}+\frac{1}{2} \tan ^{-1}(x+1) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.146014, antiderivative size = 50, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.636, Rules used = {5205, 6742, 260, 634, 617, 204, 628} \[ -\frac{1}{2} \log \left (x^2+1\right )+\frac{1}{4} \log \left (x^2+2 x+2\right )-\frac{\tan ^{-1}\left (x^2+x+1\right )}{x}+\frac{\log (x)}{2}+\frac{1}{2} \tan ^{-1}(x+1) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 5205
Rule 6742
Rule 260
Rule 634
Rule 617
Rule 204
Rule 628
Rubi steps
\begin{align*} \int \frac{\tan ^{-1}\left (1+x+x^2\right )}{x^2} \, dx &=-\frac{\tan ^{-1}\left (1+x+x^2\right )}{x}+\int \frac{1+2 x}{x \left (2+2 x+3 x^2+2 x^3+x^4\right )} \, dx\\ &=-\frac{\tan ^{-1}\left (1+x+x^2\right )}{x}+\int \left (\frac{1}{2 x}-\frac{x}{1+x^2}+\frac{2+x}{2 \left (2+2 x+x^2\right )}\right ) \, dx\\ &=-\frac{\tan ^{-1}\left (1+x+x^2\right )}{x}+\frac{\log (x)}{2}+\frac{1}{2} \int \frac{2+x}{2+2 x+x^2} \, dx-\int \frac{x}{1+x^2} \, dx\\ &=-\frac{\tan ^{-1}\left (1+x+x^2\right )}{x}+\frac{\log (x)}{2}-\frac{1}{2} \log \left (1+x^2\right )+\frac{1}{4} \int \frac{2+2 x}{2+2 x+x^2} \, dx+\frac{1}{2} \int \frac{1}{2+2 x+x^2} \, dx\\ &=-\frac{\tan ^{-1}\left (1+x+x^2\right )}{x}+\frac{\log (x)}{2}-\frac{1}{2} \log \left (1+x^2\right )+\frac{1}{4} \log \left (2+2 x+x^2\right )-\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1+x\right )\\ &=\frac{1}{2} \tan ^{-1}(1+x)-\frac{\tan ^{-1}\left (1+x+x^2\right )}{x}+\frac{\log (x)}{2}-\frac{1}{2} \log \left (1+x^2\right )+\frac{1}{4} \log \left (2+2 x+x^2\right )\\ \end{align*}
Mathematica [A] time = 0.0149432, size = 50, normalized size = 1. \[ -\frac{1}{2} \log \left (x^2+1\right )+\frac{1}{4} \log \left (x^2+2 x+2\right )-\frac{\tan ^{-1}\left (x^2+x+1\right )}{x}+\frac{\log (x)}{2}+\frac{1}{2} \tan ^{-1}(x+1) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.043, size = 43, normalized size = 0.9 \begin{align*}{\frac{\arctan \left ( x+1 \right ) }{2}}-{\frac{\arctan \left ({x}^{2}+x+1 \right ) }{x}}+{\frac{\ln \left ( x \right ) }{2}}-{\frac{\ln \left ({x}^{2}+1 \right ) }{2}}+{\frac{\ln \left ({x}^{2}+2\,x+2 \right ) }{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.47961, size = 57, normalized size = 1.14 \begin{align*} -\frac{\arctan \left (x^{2} + x + 1\right )}{x} + \frac{1}{2} \, \arctan \left (x + 1\right ) + \frac{1}{4} \, \log \left (x^{2} + 2 \, x + 2\right ) - \frac{1}{2} \, \log \left (x^{2} + 1\right ) + \frac{1}{2} \, \log \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.03198, size = 143, normalized size = 2.86 \begin{align*} \frac{2 \, x \arctan \left (x + 1\right ) + x \log \left (x^{2} + 2 \, x + 2\right ) - 2 \, x \log \left (x^{2} + 1\right ) + 2 \, x \log \left (x\right ) - 4 \, \arctan \left (x^{2} + x + 1\right )}{4 \, x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.07726, size = 41, normalized size = 0.82 \begin{align*} \frac{\log{\left (x \right )}}{2} - \frac{\log{\left (x^{2} + 1 \right )}}{2} + \frac{\log{\left (x^{2} + 2 x + 2 \right )}}{4} + \frac{\operatorname{atan}{\left (x + 1 \right )}}{2} - \frac{\operatorname{atan}{\left (x^{2} + x + 1 \right )}}{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.1258, size = 58, normalized size = 1.16 \begin{align*} -\frac{\arctan \left (x^{2} + x + 1\right )}{x} + \frac{1}{2} \, \arctan \left (x + 1\right ) + \frac{1}{4} \, \log \left (x^{2} + 2 \, x + 2\right ) - \frac{1}{2} \, \log \left (x^{2} + 1\right ) + \frac{1}{2} \, \log \left ({\left | x \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]