Optimal. Leaf size=49 \[ 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 )-4 x \tanh ^{-1}\left (e^{2 i x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 49, normalized size of antiderivative = 1.00, 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 12
Rule 2279
Rule 2391
Rule 2548
Rule 4183
Rule 4419
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.01, size = 75, normalized size = 1.53 \[ -\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 )+i \text {Li}_2(-i \tan (x))-i \text {Li}_2(i \tan (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.54, size = 148, normalized size = 3.02 \[ 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 ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \log \left (a \cot \relax (x)^{2}\right )\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.46, size = 82, normalized size = 1.67 \[ -i \ln \left (-i \cot \relax (x )\right ) \ln \left (\cot \relax (x )-i\right )+i \ln \left (i \cot \relax (x )\right ) \ln \left (\cot \relax (x )+i\right )+\frac {i \ln \left (a \left (\cot ^{2}\relax (x )\right )\right ) \ln \left (\cot \relax (x )-i\right )}{2}-\frac {i \ln \left (a \left (\cot ^{2}\relax (x )\right )\right ) \ln \left (\cot \relax (x )+i\right )}{2}-i \dilog \left (-i \cot \relax (x )\right )+i \dilog \left (i \cot \relax (x )\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.37, size = 44, normalized size = 0.90 \[ -\frac {1}{2} \, \pi \log \left (\tan \relax (x)^{2} + 1\right ) + x \log \left (\frac {a}{\tan \relax (x)^{2}}\right ) + 2 \, x \log \left (\tan \relax (x)\right ) - i \, {\rm Li}_2\left (i \, \tan \relax (x) + 1\right ) + i \, {\rm Li}_2\left (-i \, \tan \relax (x) + 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.02 \[ \int \ln \left (a\,{\mathrm {cot}\relax (x)}^2\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \log {\left (a \cot ^{2}{\relax (x )} \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________