Optimal. Leaf size=56 \[ -\frac{1}{2} i n \text{PolyLog}\left (2,-e^{2 i x}\right )+\frac{1}{2} i n \text{PolyLog}\left (2,e^{2 i x}\right )+x \log \left (a \tan ^n(x)\right )+2 n x \tanh ^{-1}\left (e^{2 i x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0482997, antiderivative size = 56, 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} \[ -\frac{1}{2} i n \text{PolyLog}\left (2,-e^{2 i x}\right )+\frac{1}{2} i n \text{PolyLog}\left (2,e^{2 i x}\right )+x \log \left (a \tan ^n(x)\right )+2 n 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 \tan ^n(x)\right ) \, dx &=x \log \left (a \tan ^n(x)\right )-\int n x \csc (x) \sec (x) \, dx\\ &=x \log \left (a \tan ^n(x)\right )-n \int x \csc (x) \sec (x) \, dx\\ &=x \log \left (a \tan ^n(x)\right )-(2 n) \int x \csc (2 x) \, dx\\ &=2 n x \tanh ^{-1}\left (e^{2 i x}\right )+x \log \left (a \tan ^n(x)\right )+n \int \log \left (1-e^{2 i x}\right ) \, dx-n \int \log \left (1+e^{2 i x}\right ) \, dx\\ &=2 n x \tanh ^{-1}\left (e^{2 i x}\right )+x \log \left (a \tan ^n(x)\right )-\frac{1}{2} (i n) \operatorname{Subst}\left (\int \frac{\log (1-x)}{x} \, dx,x,e^{2 i x}\right )+\frac{1}{2} (i n) \operatorname{Subst}\left (\int \frac{\log (1+x)}{x} \, dx,x,e^{2 i x}\right )\\ &=2 n x \tanh ^{-1}\left (e^{2 i x}\right )+x \log \left (a \tan ^n(x)\right )-\frac{1}{2} i n \text{Li}_2\left (-e^{2 i x}\right )+\frac{1}{2} i n \text{Li}_2\left (e^{2 i x}\right )\\ \end{align*}
Mathematica [A] time = 0.0114228, size = 81, normalized size = 1.45 \[ -\frac{1}{2} i n \text{PolyLog}(2,-i \tan (x))+\frac{1}{2} i n \text{PolyLog}(2,i \tan (x))-\frac{1}{2} i \log (-i (-\tan (x)+i)) \log \left (a \tan ^n(x)\right )+\frac{1}{2} i \log (-i (\tan (x)+i)) \log \left (a \tan ^n(x)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 17.115, size = 6782, normalized size = 121.1 \begin{align*} \text{output too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.53804, size = 65, normalized size = 1.16 \begin{align*} -n x \log \left (\tan \left (x\right )\right ) + \frac{1}{4} \,{\left (\pi \log \left (\tan \left (x\right )^{2} + 1\right ) + 2 i \,{\rm Li}_2\left (i \, \tan \left (x\right ) + 1\right ) - 2 i \,{\rm Li}_2\left (-i \, \tan \left (x\right ) + 1\right )\right )} n + x \log \left (a \tan \left (x\right )^{n}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.11327, size = 625, normalized size = 11.16 \begin{align*} -\frac{1}{2} \, n x \log \left (\frac{2 \,{\left (\tan \left (x\right )^{2} + i \, \tan \left (x\right )\right )}}{\tan \left (x\right )^{2} + 1}\right ) - \frac{1}{2} \, n x \log \left (\frac{2 \,{\left (\tan \left (x\right )^{2} - i \, \tan \left (x\right )\right )}}{\tan \left (x\right )^{2} + 1}\right ) + \frac{1}{2} \, n x \log \left (-\frac{2 \,{\left (i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1}\right ) + \frac{1}{2} \, n x \log \left (-\frac{2 \,{\left (-i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1}\right ) + n x \log \left (\tan \left (x\right )\right ) - \frac{1}{4} i \, n{\rm Li}_2\left (-\frac{2 \,{\left (\tan \left (x\right )^{2} + i \, \tan \left (x\right )\right )}}{\tan \left (x\right )^{2} + 1} + 1\right ) + \frac{1}{4} i \, n{\rm Li}_2\left (-\frac{2 \,{\left (\tan \left (x\right )^{2} - i \, \tan \left (x\right )\right )}}{\tan \left (x\right )^{2} + 1} + 1\right ) + \frac{1}{4} i \, n{\rm Li}_2\left (\frac{2 \,{\left (i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1} + 1\right ) - \frac{1}{4} i \, n{\rm Li}_2\left (\frac{2 \,{\left (-i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1} + 1\right ) + x \log \left (a\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 \tan ^{n}{\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 \tan \left (x\right )^{n}\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]