### 3.272 $$\int \frac{\log (\frac{1-(-1+x)^2}{1+(-1+x)^2})}{x^2} \, dx$$

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]

-x^(-1) + ArcTan[1 - x] - Log[(1 - (1 - x)^2)/(1 + (-1 + x)^2)]/x + Log[2 - x]/2 + Log[x]/2 - Log[2 - 2*x + x^
2]/2

________________________________________________________________________________________

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 veriﬁed.

[In]

Int[Log[(1 - (-1 + x)^2)/(1 + (-1 + x)^2)]/x^2,x]

[Out]

-x^(-1) + ArcTan[1 - x] - Log[(1 - (1 - x)^2)/(1 + (-1 + x)^2)]/x + Log[2 - x]/2 + Log[x]/2 - Log[2 - 2*x + x^
2]/2

Rule 2525

Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Simp[((d + e*x)^(m
+ 1)*(a + b*Log[c*RFx^p])^n)/(e*(m + 1)), x] - Dist[(b*n*p)/(e*(m + 1)), Int[SimplifyIntegrand[((d + e*x)^(m +
1)*(a + b*Log[c*RFx^p])^(n - 1)*D[RFx, x])/RFx, x], x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && RationalFunc
tionQ[RFx, x] && IGtQ[n, 0] && (EqQ[n, 1] || IntegerQ[m]) && NeQ[m, -1]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 6728

Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a +
b*x^n + c*x^(2*n)), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 617

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*Simplify[(a*c)/b^2]}, Dist[-2/b, Sub
st[Int[1/(q - x^2), x], x, 1 + (2*c*x)/b], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /;
FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

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 veriﬁed.

[In]

Integrate[Log[(1 - (-1 + x)^2)/(1 + (-1 + x)^2)]/x^2,x]

[Out]

-x^(-1) + ArcTan[1 - x] + Log[2 - x]/2 + Log[x]/2 - Log[-(((-2 + x)*x)/(2 - 2*x + x^2))]/x - Log[2 - 2*x + x^2
]/2

________________________________________________________________________________________

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*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(ln((1-(-1+x)^2)/(1+(-1+x)^2))/x^2,x)

[Out]

-1/x*ln(x*(2-x)/(x^2-2*x+2))-1/x+1/2*ln(x)-1/2*ln(x^2-2*x+2)-arctan(-1+x)+1/2*ln(x-2)

________________________________________________________________________________________

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*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(log((1-(-1+x)^2)/(1+(-1+x)^2))/x^2,x, algorithm="maxima")

[Out]

-log(-((x - 1)^2 - 1)/((x - 1)^2 + 1))/x - 1/x - arctan(x - 1) - 1/2*log(x^2 - 2*x + 2) + 1/2*log(x - 2) + 1/2
*log(x)

________________________________________________________________________________________

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*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(log((1-(-1+x)^2)/(1+(-1+x)^2))/x^2,x, algorithm="fricas")

[Out]

-1/2*(2*x*arctan(x - 1) + x*log(x^2 - 2*x + 2) - x*log(x^2 - 2*x) + 2*log(-(x^2 - 2*x)/(x^2 - 2*x + 2)) + 2)/x

________________________________________________________________________________________

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*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln((1-(-1+x)**2)/(1+(-1+x)**2))/x**2,x)

[Out]

log(x**2 - 2*x)/2 - log(x**2 - 2*x + 2)/2 - atan(x - 1) - log((1 - (x - 1)**2)/((x - 1)**2 + 1))/x - 1/x

________________________________________________________________________________________

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*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(log((1-(-1+x)^2)/(1+(-1+x)^2))/x^2,x, algorithm="giac")

[Out]

-log(-((x - 1)^2 - 1)/((x - 1)^2 + 1))/x - 1/x - arctan(x - 1) - 1/2*log(x^2 - 2*x + 2) + 1/2*log(abs(x - 2))
+ 1/2*log(abs(x))