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.15, antiderivative size = 50, normalized size of antiderivative = 1.00, 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 204
Rule 260
Rule 617
Rule 628
Rule 634
Rule 5205
Rule 6742
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.02, size = 50, normalized size = 1.00 \[ -\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]
________________________________________________________________________________________
fricas [A] time = 0.53, size = 47, normalized size = 0.94 \[ \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 \relax (x) - 4 \, \arctan \left (x^{2} + x + 1\right )}{4 \, x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 43, normalized size = 0.86 \[ -\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 ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.05, size = 43, normalized size = 0.86 \[ \frac {\arctan \left (x +1\right )}{2}-\frac {\arctan \left (x^{2}+x +1\right )}{x}+\frac {\ln \relax (x )}{2}-\frac {\ln \left (x^{2}+1\right )}{2}+\frac {\ln \left (x^{2}+2 x +2\right )}{4} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.43, size = 42, normalized size = 0.84 \[ -\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 \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.76, size = 42, normalized size = 0.84 \[ \frac {\mathrm {atan}\left (x+1\right )}{2}+\frac {\ln \left (x^2+2\,x+2\right )}{4}-\frac {\ln \left (x^2+1\right )}{2}+\frac {\ln \relax (x)}{2}-\frac {\mathrm {atan}\left (x^2+x+1\right )}{x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.89, size = 41, normalized size = 0.82 \[ \frac {\log {\relax (x )}}{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} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________