Optimal. Leaf size=50 \[ \frac {1}{2} \text {ArcTan}(1+x)-\frac {\text {ArcTan}\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 ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, 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 = {5313, 6874,
266, 648, 631, 210, 642} \begin {gather*} -\frac {\text {ArcTan}\left (x^2+x+1\right )}{x}+\frac {1}{2} \text {ArcTan}(x+1)-\frac {1}{2} \log \left (x^2+1\right )+\frac {1}{4} \log \left (x^2+2 x+2\right )+\frac {\log (x)}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 266
Rule 631
Rule 642
Rule 648
Rule 5313
Rule 6874
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} \text {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 \begin {gather*} \frac {1}{2} \text {ArcTan}(1+x)-\frac {\text {ArcTan}\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 {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 43, normalized size = 0.86
method | result | size |
default | \(\frac {\arctan \left (1+x \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}\) | \(43\) |
risch | \(\frac {i \ln \left (1+i \left (x^{2}+x +1\right )\right )}{2 x}-\frac {i \left (2 i \ln \left (x \right ) x +i \ln \left (1+i+x \right ) x +i \ln \left (1-i+x \right ) x -2 i \ln \left (x^{2}+1\right ) x -\ln \left (1+i+x \right ) x +\ln \left (1-i+x \right ) x +2 \ln \left (1-i \left (x^{2}+x +1\right )\right )\right )}{4 x}\) | \(94\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.47, size = 42, normalized size = 0.84 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.22, size = 47, normalized size = 0.94 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.30, size = 41, normalized size = 0.82 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 43, normalized size = 0.86 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.76, size = 42, normalized size = 0.84 \begin {gather*} \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 \left (x\right )}{2}-\frac {\mathrm {atan}\left (x^2+x+1\right )}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________