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

Optimal. Leaf size=61 $i \text{PolyLog}\left (2,-1+\frac{2}{1-i x}\right )+\log \left (\frac{x^2}{x^2+1}\right ) \tan ^{-1}(x)+i \tan ^{-1}(x)^2-2 \log \left (2-\frac{2}{1-i x}\right ) \tan ^{-1}(x)$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.1055, antiderivative size = 61, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 6, integrand size = 20, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.3, Rules used = {203, 2526, 12, 4924, 4868, 2447} $i \text{PolyLog}\left (2,-1+\frac{2}{1-i x}\right )+\log \left (\frac{x^2}{x^2+1}\right ) \tan ^{-1}(x)+i \tan ^{-1}(x)^2-2 \log \left (2-\frac{2}{1-i x}\right ) \tan ^{-1}(x)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 203

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

Rule 2526

Int[Log[(c_.)*(RFx_)^(n_.)]/((d_) + (e_.)*(x_)^2), x_Symbol] :> With[{u = IntHide[1/(d + e*x^2), x]}, Simp[u*L
og[c*RFx^n], x] - Dist[n, Int[SimplifyIntegrand[(u*D[RFx, x])/RFx, x], x], x]] /; FreeQ[{c, d, e, n}, x] && Ra
tionalFunctionQ[RFx, x] &&  !PolynomialQ[RFx, x]

Rule 12

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

Rule 4924

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

Rule 4868

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

Rule 2447

Int[Log[u_]*(Pq_)^(m_.), x_Symbol] :> With[{C = FullSimplify[(Pq^m*(1 - u))/D[u, x]]}, Simp[C*PolyLog[2, 1 - u
], x] /; FreeQ[C, x]] /; IntegerQ[m] && PolyQ[Pq, x] && RationalFunctionQ[u, x] && LeQ[RationalFunctionExponen
ts[u, x][[2]], Expon[Pq, x]]

Rubi steps

\begin{align*} \int \frac{\log \left (\frac{x^2}{1+x^2}\right )}{1+x^2} \, dx &=\tan ^{-1}(x) \log \left (\frac{x^2}{1+x^2}\right )-\int \frac{2 \tan ^{-1}(x)}{x \left (1+x^2\right )} \, dx\\ &=\tan ^{-1}(x) \log \left (\frac{x^2}{1+x^2}\right )-2 \int \frac{\tan ^{-1}(x)}{x \left (1+x^2\right )} \, dx\\ &=i \tan ^{-1}(x)^2+\tan ^{-1}(x) \log \left (\frac{x^2}{1+x^2}\right )-2 i \int \frac{\tan ^{-1}(x)}{x (i+x)} \, dx\\ &=i \tan ^{-1}(x)^2-2 \tan ^{-1}(x) \log \left (2-\frac{2}{1-i x}\right )+\tan ^{-1}(x) \log \left (\frac{x^2}{1+x^2}\right )+2 \int \frac{\log \left (2-\frac{2}{1-i x}\right )}{1+x^2} \, dx\\ &=i \tan ^{-1}(x)^2-2 \tan ^{-1}(x) \log \left (2-\frac{2}{1-i x}\right )+\tan ^{-1}(x) \log \left (\frac{x^2}{1+x^2}\right )+i \text{Li}_2\left (-1+\frac{2}{1-i x}\right )\\ \end{align*}

Mathematica [B]  time = 0.0442744, size = 239, normalized size = 3.92 $-\frac{1}{2} i \text{PolyLog}\left (2,-\frac{1}{2} i (-x+i)\right )+i \text{PolyLog}(2,-i (-x+i))+\frac{1}{2} i \text{PolyLog}\left (2,-\frac{1}{2} i (x+i)\right )-i \text{PolyLog}(2,-i (x+i))-\frac{1}{2} i \log \left (\frac{x^2}{x^2+1}\right ) \log (-x+i)+\frac{1}{2} i \log (x+i) \log \left (\frac{x^2}{x^2+1}\right )-\frac{1}{4} i \log ^2(-x+i)+\frac{1}{4} i \log ^2(x+i)+i \log (-i x) \log (-x+i)-\frac{1}{2} i \log \left (-\frac{1}{2} i (x+i)\right ) \log (-x+i)+\frac{1}{2} i \log \left (-\frac{1}{2} i (-x+i)\right ) \log (x+i)-i \log (i x) \log (x+i)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(-I/4)*Log[I - x]^2 + I*Log[I - x]*Log[(-I)*x] - (I/2)*Log[I - x]*Log[(-I/2)*(I + x)] + (I/2)*Log[(-I/2)*(I -
x)]*Log[I + x] - I*Log[I*x]*Log[I + x] + (I/4)*Log[I + x]^2 - (I/2)*Log[I - x]*Log[x^2/(1 + x^2)] + (I/2)*Log[
I + x]*Log[x^2/(1 + x^2)] - (I/2)*PolyLog[2, (-I/2)*(I - x)] + I*PolyLog[2, (-I)*(I - x)] + (I/2)*PolyLog[2, (
-I/2)*(I + x)] - I*PolyLog[2, (-I)*(I + x)]

________________________________________________________________________________________

Maple [B]  time = 0.02, size = 158, normalized size = 2.6 \begin{align*} -{\frac{i}{2}}\ln \left ({\frac{{x}^{2}}{{x}^{2}+1}} \right ) \ln \left ( x-i \right ) -{\frac{i}{4}} \left ( \ln \left ( x-i \right ) \right ) ^{2}-{\frac{i}{2}}\ln \left ( x-i \right ) \ln \left ( -{\frac{i}{2}} \left ( x+i \right ) \right ) +i\ln \left ( x-i \right ) \ln \left ( -ix \right ) -{\frac{i}{2}}{\it dilog} \left ( -{\frac{i}{2}} \left ( x+i \right ) \right ) +i{\it dilog} \left ( -ix \right ) +{\frac{i}{2}}\ln \left ({\frac{{x}^{2}}{{x}^{2}+1}} \right ) \ln \left ( x+i \right ) +{\frac{i}{4}} \left ( \ln \left ( x+i \right ) \right ) ^{2}+{\frac{i}{2}}\ln \left ( x+i \right ) \ln \left ({\frac{i}{2}} \left ( x-i \right ) \right ) -i\ln \left ( x+i \right ) \ln \left ( ix \right ) +{\frac{i}{2}}{\it dilog} \left ({\frac{i}{2}} \left ( x-i \right ) \right ) -i{\it dilog} \left ( ix \right ) \end{align*}

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

[In]

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

[Out]

-1/2*I*ln(x^2/(x^2+1))*ln(x-I)-1/4*I*ln(x-I)^2-1/2*I*ln(x-I)*ln(-1/2*I*(x+I))+I*ln(x-I)*ln(-I*x)-1/2*I*dilog(-
1/2*I*(x+I))+I*dilog(-I*x)+1/2*I*ln(x^2/(x^2+1))*ln(x+I)+1/4*I*ln(x+I)^2+1/2*I*ln(x+I)*ln(1/2*I*(x-I))-I*ln(x+
I)*ln(I*x)+1/2*I*dilog(1/2*I*(x-I))-I*dilog(I*x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\log \left (\frac{x^{2}}{x^{2} + 1}\right )}{x^{2} + 1}\,{d x} \end{align*}

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

[In]

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

[Out]

integrate(log(x^2/(x^2 + 1))/(x^2 + 1), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\log \left (\frac{x^{2}}{x^{2} + 1}\right )}{x^{2} + 1}, x\right ) \end{align*}

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

[In]

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

[Out]

integral(log(x^2/(x^2 + 1))/(x^2 + 1), x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\log{\left (\frac{x^{2}}{x^{2} + 1} \right )}}{x^{2} + 1}\, dx \end{align*}

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

[In]

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

[Out]

Integral(log(x**2/(x**2 + 1))/(x**2 + 1), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\log \left (\frac{x^{2}}{x^{2} + 1}\right )}{x^{2} + 1}\,{d x} \end{align*}

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

[In]

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

[Out]

integrate(log(x^2/(x^2 + 1))/(x^2 + 1), x)