Optimal. Leaf size=68 \[ -\frac{1}{2} \log \left (x^2-2 x+2\right )-\frac{1}{x}-\frac{\log \left (\frac{1-(1-x)^2}{(x-1)^2+1}\right )}{x}+\frac{1}{2} \log (2-x)+\frac{\log (x)}{2}+\tan ^{-1}(1-x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.250847, antiderivative size = 68, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.292, Rules used = {2525, 12, 6728, 634, 617, 204, 628} \[ -\frac{1}{2} \log \left (x^2-2 x+2\right )-\frac{1}{x}-\frac{\log \left (\frac{1-(1-x)^2}{(x-1)^2+1}\right )}{x}+\frac{1}{2} \log (2-x)+\frac{\log (x)}{2}+\tan ^{-1}(1-x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2525
Rule 12
Rule 6728
Rule 634
Rule 617
Rule 204
Rule 628
Rubi steps
\begin{align*} \int \frac{\log \left (\frac{1-(-1+x)^2}{1+(-1+x)^2}\right )}{x^2} \, dx &=-\frac{\log \left (\frac{1-(1-x)^2}{1+(-1+x)^2}\right )}{x}+\int \frac{4 (1-x)}{(2-x) x^2 \left (2-2 x+x^2\right )} \, dx\\ &=-\frac{\log \left (\frac{1-(1-x)^2}{1+(-1+x)^2}\right )}{x}+4 \int \frac{1-x}{(2-x) x^2 \left (2-2 x+x^2\right )} \, dx\\ &=-\frac{\log \left (\frac{1-(1-x)^2}{1+(-1+x)^2}\right )}{x}+4 \int \left (\frac{1}{8 (-2+x)}+\frac{1}{4 x^2}+\frac{1}{8 x}-\frac{x}{4 \left (2-2 x+x^2\right )}\right ) \, dx\\ &=-\frac{1}{x}-\frac{\log \left (\frac{1-(1-x)^2}{1+(-1+x)^2}\right )}{x}+\frac{1}{2} \log (2-x)+\frac{\log (x)}{2}-\int \frac{x}{2-2 x+x^2} \, dx\\ &=-\frac{1}{x}-\frac{\log \left (\frac{1-(1-x)^2}{1+(-1+x)^2}\right )}{x}+\frac{1}{2} \log (2-x)+\frac{\log (x)}{2}-\frac{1}{2} \int \frac{-2+2 x}{2-2 x+x^2} \, dx-\int \frac{1}{2-2 x+x^2} \, dx\\ &=-\frac{1}{x}-\frac{\log \left (\frac{1-(1-x)^2}{1+(-1+x)^2}\right )}{x}+\frac{1}{2} \log (2-x)+\frac{\log (x)}{2}-\frac{1}{2} \log \left (2-2 x+x^2\right )-\operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1-x\right )\\ &=-\frac{1}{x}+\tan ^{-1}(1-x)-\frac{\log \left (\frac{1-(1-x)^2}{1+(-1+x)^2}\right )}{x}+\frac{1}{2} \log (2-x)+\frac{\log (x)}{2}-\frac{1}{2} \log \left (2-2 x+x^2\right )\\ \end{align*}
Mathematica [A] time = 0.0315522, size = 63, normalized size = 0.93 \[ -\frac{\log \left (-\frac{(x-2) x}{x^2-2 x+2}\right )}{x}-\frac{1}{2} \log \left (x^2-2 x+2\right )-\frac{1}{x}+\frac{1}{2} \log (2-x)+\frac{\log (x)}{2}+\tan ^{-1}(1-x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.021, size = 57, normalized size = 0.8 \begin{align*} -{\frac{1}{x}\ln \left ({\frac{x \left ( 2-x \right ) }{{x}^{2}-2\,x+2}} \right ) }-{x}^{-1}+{\frac{\ln \left ( x \right ) }{2}}-{\frac{\ln \left ({x}^{2}-2\,x+2 \right ) }{2}}-\arctan \left ( -1+x \right ) +{\frac{\ln \left ( x-2 \right ) }{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.6894, size = 77, normalized size = 1.13 \begin{align*} -\frac{\log \left (-\frac{{\left (x - 1\right )}^{2} - 1}{{\left (x - 1\right )}^{2} + 1}\right )}{x} - \frac{1}{x} - \arctan \left (x - 1\right ) - \frac{1}{2} \, \log \left (x^{2} - 2 \, x + 2\right ) + \frac{1}{2} \, \log \left (x - 2\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.14019, size = 151, normalized size = 2.22 \begin{align*} -\frac{2 \, x \arctan \left (x - 1\right ) + x \log \left (x^{2} - 2 \, x + 2\right ) - x \log \left (x^{2} - 2 \, x\right ) + 2 \, \log \left (-\frac{x^{2} - 2 \, x}{x^{2} - 2 \, x + 2}\right ) + 2}{2 \, x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.227864, size = 46, normalized size = 0.68 \begin{align*} \frac{\log{\left (x^{2} - 2 x \right )}}{2} - \frac{\log{\left (x^{2} - 2 x + 2 \right )}}{2} - \operatorname{atan}{\left (x - 1 \right )} - \frac{\log{\left (\frac{1 - \left (x - 1\right )^{2}}{\left (x - 1\right )^{2} + 1} \right )}}{x} - \frac{1}{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.37482, size = 80, normalized size = 1.18 \begin{align*} -\frac{\log \left (-\frac{{\left (x - 1\right )}^{2} - 1}{{\left (x - 1\right )}^{2} + 1}\right )}{x} - \frac{1}{x} - \arctan \left (x - 1\right ) - \frac{1}{2} \, \log \left (x^{2} - 2 \, x + 2\right ) + \frac{1}{2} \, \log \left ({\left | x - 2 \right |}\right ) + \frac{1}{2} \, \log \left ({\left | x \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]