Optimal. Leaf size=51 \[ \frac{1}{2} i \text{PolyLog}\left (2,-e^{2 i x}\right )-\frac{1}{2} i \text{PolyLog}\left (2,e^{2 i x}\right )+x \log (a \cot (x))-2 x \tanh ^{-1}\left (e^{2 i x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.046003, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 5, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 1., Rules used = {2548, 4419, 4183, 2279, 2391} \[ \frac{1}{2} i \text{PolyLog}\left (2,-e^{2 i x}\right )-\frac{1}{2} i \text{PolyLog}\left (2,e^{2 i x}\right )+x \log (a \cot (x))-2 x \tanh ^{-1}\left (e^{2 i x}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2548
Rule 4419
Rule 4183
Rule 2279
Rule 2391
Rubi steps
\begin{align*} \int \log (a \cot (x)) \, dx &=x \log (a \cot (x))+\int x \csc (x) \sec (x) \, dx\\ &=x \log (a \cot (x))+2 \int x \csc (2 x) \, dx\\ &=-2 x \tanh ^{-1}\left (e^{2 i x}\right )+x \log (a \cot (x))-\int \log \left (1-e^{2 i x}\right ) \, dx+\int \log \left (1+e^{2 i x}\right ) \, dx\\ &=-2 x \tanh ^{-1}\left (e^{2 i x}\right )+x \log (a \cot (x))+\frac{1}{2} i \operatorname{Subst}\left (\int \frac{\log (1-x)}{x} \, dx,x,e^{2 i x}\right )-\frac{1}{2} i \operatorname{Subst}\left (\int \frac{\log (1+x)}{x} \, dx,x,e^{2 i x}\right )\\ &=-2 x \tanh ^{-1}\left (e^{2 i x}\right )+x \log (a \cot (x))+\frac{1}{2} i \text{Li}_2\left (-e^{2 i x}\right )-\frac{1}{2} i \text{Li}_2\left (e^{2 i x}\right )\\ \end{align*}
Mathematica [A] time = 0.0108143, size = 75, normalized size = 1.47 \[ \frac{1}{2} i \text{PolyLog}(2,-i \cot (x))-\frac{1}{2} i \text{PolyLog}(2,i \cot (x))+\frac{1}{2} i \log (-i (-\cot (x)+i)) \log (a \cot (x))-\frac{1}{2} i \log (-i (\cot (x)+i)) \log (a \cot (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.036, size = 82, normalized size = 1.6 \begin{align*}{\frac{i}{2}}\ln \left ( a\cot \left ( x \right ) \right ) \ln \left ({\frac{ia\cot \left ( x \right ) +a}{a}} \right ) -{\frac{i}{2}}\ln \left ( a\cot \left ( x \right ) \right ) \ln \left ( -{\frac{ia\cot \left ( x \right ) -a}{a}} \right ) +{\frac{i}{2}}{\it dilog} \left ({\frac{ia\cot \left ( x \right ) +a}{a}} \right ) -{\frac{i}{2}}{\it dilog} \left ( -{\frac{ia\cot \left ( x \right ) -a}{a}} \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.53032, size = 58, normalized size = 1.14 \begin{align*} -\frac{1}{4} \, \pi \log \left (\tan \left (x\right )^{2} + 1\right ) + x \log \left (\frac{a}{\tan \left (x\right )}\right ) + x \log \left (\tan \left (x\right )\right ) - \frac{1}{2} i \,{\rm Li}_2\left (i \, \tan \left (x\right ) + 1\right ) + \frac{1}{2} 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.1815, size = 462, normalized size = 9.06 \begin{align*} x \log \left (\frac{a \cos \left (2 \, x\right ) + a}{\sin \left (2 \, x\right )}\right ) - \frac{1}{2} \, x \log \left (\cos \left (2 \, x\right ) + i \, \sin \left (2 \, x\right ) + 1\right ) - \frac{1}{2} \, x \log \left (\cos \left (2 \, x\right ) - i \, \sin \left (2 \, x\right ) + 1\right ) + \frac{1}{2} \, x \log \left (-\cos \left (2 \, x\right ) + i \, \sin \left (2 \, x\right ) + 1\right ) + \frac{1}{2} \, x \log \left (-\cos \left (2 \, x\right ) - i \, \sin \left (2 \, x\right ) + 1\right ) - \frac{1}{4} i \,{\rm Li}_2\left (\cos \left (2 \, x\right ) + i \, \sin \left (2 \, x\right )\right ) + \frac{1}{4} i \,{\rm Li}_2\left (\cos \left (2 \, x\right ) - i \, \sin \left (2 \, x\right )\right ) - \frac{1}{4} i \,{\rm Li}_2\left (-\cos \left (2 \, x\right ) + i \, \sin \left (2 \, x\right )\right ) + \frac{1}{4} 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{\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 )\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]