Optimal. Leaf size=49 \[ i \text{PolyLog}\left (2,-e^{2 i x}\right )-i \text{PolyLog}\left (2,e^{2 i x}\right )+x \log \left (a \cot ^2(x)\right )-4 x \tanh ^{-1}\left (e^{2 i x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0471132, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.857, Rules used = {2548, 12, 4419, 4183, 2279, 2391} \[ i \text{PolyLog}\left (2,-e^{2 i x}\right )-i \text{PolyLog}\left (2,e^{2 i x}\right )+x \log \left (a \cot ^2(x)\right )-4 x \tanh ^{-1}\left (e^{2 i x}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2548
Rule 12
Rule 4419
Rule 4183
Rule 2279
Rule 2391
Rubi steps
\begin{align*} \int \log \left (a \cot ^2(x)\right ) \, dx &=x \log \left (a \cot ^2(x)\right )-\int -2 x \csc (x) \sec (x) \, dx\\ &=x \log \left (a \cot ^2(x)\right )+2 \int x \csc (x) \sec (x) \, dx\\ &=x \log \left (a \cot ^2(x)\right )+4 \int x \csc (2 x) \, dx\\ &=-4 x \tanh ^{-1}\left (e^{2 i x}\right )+x \log \left (a \cot ^2(x)\right )-2 \int \log \left (1-e^{2 i x}\right ) \, dx+2 \int \log \left (1+e^{2 i x}\right ) \, dx\\ &=-4 x \tanh ^{-1}\left (e^{2 i x}\right )+x \log \left (a \cot ^2(x)\right )+i \operatorname{Subst}\left (\int \frac{\log (1-x)}{x} \, dx,x,e^{2 i x}\right )-i \operatorname{Subst}\left (\int \frac{\log (1+x)}{x} \, dx,x,e^{2 i x}\right )\\ &=-4 x \tanh ^{-1}\left (e^{2 i x}\right )+x \log \left (a \cot ^2(x)\right )+i \text{Li}_2\left (-e^{2 i x}\right )-i \text{Li}_2\left (e^{2 i x}\right )\\ \end{align*}
Mathematica [A] time = 0.0115815, size = 75, normalized size = 1.53 \[ i \text{PolyLog}(2,-i \tan (x))-i \text{PolyLog}(2,i \tan (x))-\frac{1}{2} i \log (-i (-\tan (x)+i)) \log \left (a \cot ^2(x)\right )+\frac{1}{2} i \log (-i (\tan (x)+i)) \log \left (a \cot ^2(x)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.043, size = 82, normalized size = 1.7 \begin{align*}{\frac{i}{2}}\ln \left ( a \left ( \cot \left ( x \right ) \right ) ^{2} \right ) \ln \left ( \cot \left ( x \right ) -i \right ) -i\ln \left ( \cot \left ( x \right ) -i \right ) \ln \left ( -i\cot \left ( x \right ) \right ) -i{\it dilog} \left ( -i\cot \left ( x \right ) \right ) -{\frac{i}{2}}\ln \left ( a \left ( \cot \left ( x \right ) \right ) ^{2} \right ) \ln \left ( \cot \left ( x \right ) +i \right ) +i\ln \left ( \cot \left ( x \right ) +i \right ) \ln \left ( i\cot \left ( x \right ) \right ) +i{\it dilog} \left ( i\cot \left ( x \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.52934, size = 59, normalized size = 1.2 \begin{align*} -\frac{1}{2} \, \pi \log \left (\tan \left (x\right )^{2} + 1\right ) + x \log \left (\frac{a}{\tan \left (x\right )^{2}}\right ) + 2 \, x \log \left (\tan \left (x\right )\right ) - i \,{\rm Li}_2\left (i \, \tan \left (x\right ) + 1\right ) + i \,{\rm Li}_2\left (-i \, \tan \left (x\right ) + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.13031, size = 450, normalized size = 9.18 \begin{align*} x \log \left (-\frac{a \cos \left (2 \, x\right ) + a}{\cos \left (2 \, x\right ) - 1}\right ) - x \log \left (\cos \left (2 \, x\right ) + i \, \sin \left (2 \, x\right ) + 1\right ) - x \log \left (\cos \left (2 \, x\right ) - i \, \sin \left (2 \, x\right ) + 1\right ) + x \log \left (-\cos \left (2 \, x\right ) + i \, \sin \left (2 \, x\right ) + 1\right ) + x \log \left (-\cos \left (2 \, x\right ) - i \, \sin \left (2 \, x\right ) + 1\right ) - \frac{1}{2} i \,{\rm Li}_2\left (\cos \left (2 \, x\right ) + i \, \sin \left (2 \, x\right )\right ) + \frac{1}{2} i \,{\rm Li}_2\left (\cos \left (2 \, x\right ) - i \, \sin \left (2 \, x\right )\right ) - \frac{1}{2} i \,{\rm Li}_2\left (-\cos \left (2 \, x\right ) + i \, \sin \left (2 \, x\right )\right ) + \frac{1}{2} i \,{\rm Li}_2\left (-\cos \left (2 \, x\right ) - i \, \sin \left (2 \, x\right )\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \log{\left (a \cot ^{2}{\left (x \right )} \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \log \left (a \cot \left (x\right )^{2}\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]