Integrand size = 7, antiderivative size = 56 \[ \int \log \left (a \tan ^n(x)\right ) \, dx=2 n x \text {arctanh}\left (e^{2 i x}\right )+x \log \left (a \tan ^n(x)\right )-\frac {1}{2} i n \operatorname {PolyLog}\left (2,-e^{2 i x}\right )+\frac {1}{2} i n \operatorname {PolyLog}\left (2,e^{2 i x}\right ) \] Output:
2*n*x*arctanh(exp(2*I*x))+x*ln(a*tan(x)^n)-1/2*I*n*polylog(2,-exp(2*I*x))+ 1/2*I*n*polylog(2,exp(2*I*x))
Time = 0.02 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.45 \[ \int \log \left (a \tan ^n(x)\right ) \, dx=-\frac {1}{2} i \log (-i (i-\tan (x))) \log \left (a \tan ^n(x)\right )+\frac {1}{2} i \log \left (a \tan ^n(x)\right ) \log (-i (i+\tan (x)))-\frac {1}{2} i n \operatorname {PolyLog}(2,-i \tan (x))+\frac {1}{2} i n \operatorname {PolyLog}(2,i \tan (x)) \] Input:
Integrate[Log[a*Tan[x]^n],x]
Output:
(-1/2*I)*Log[(-I)*(I - Tan[x])]*Log[a*Tan[x]^n] + (I/2)*Log[a*Tan[x]^n]*Lo g[(-I)*(I + Tan[x])] - (I/2)*n*PolyLog[2, (-I)*Tan[x]] + (I/2)*n*PolyLog[2 , I*Tan[x]]
Time = 0.36 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.02, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.000, Rules used = {3028, 27, 4919, 3042, 4671, 2715, 2838}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \log \left (a \tan ^n(x)\right ) \, dx\) |
\(\Big \downarrow \) 3028 |
\(\displaystyle x \log \left (a \tan ^n(x)\right )-\int n x \csc (x) \sec (x)dx\) |
\(\Big \downarrow \) 27 |
\(\displaystyle x \log \left (a \tan ^n(x)\right )-n \int x \csc (x) \sec (x)dx\) |
\(\Big \downarrow \) 4919 |
\(\displaystyle x \log \left (a \tan ^n(x)\right )-2 n \int x \csc (2 x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle x \log \left (a \tan ^n(x)\right )-2 n \int x \csc (2 x)dx\) |
\(\Big \downarrow \) 4671 |
\(\displaystyle x \log \left (a \tan ^n(x)\right )-2 n \left (-\frac {1}{2} \int \log \left (1-e^{2 i x}\right )dx+\frac {1}{2} \int \log \left (1+e^{2 i x}\right )dx-x \text {arctanh}\left (e^{2 i x}\right )\right )\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle x \log \left (a \tan ^n(x)\right )-2 n \left (\frac {1}{4} i \int e^{-2 i x} \log \left (1-e^{2 i x}\right )de^{2 i x}-\frac {1}{4} i \int e^{-2 i x} \log \left (1+e^{2 i x}\right )de^{2 i x}-x \text {arctanh}\left (e^{2 i x}\right )\right )\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle x \log \left (a \tan ^n(x)\right )-2 n \left (-x \text {arctanh}\left (e^{2 i x}\right )+\frac {1}{4} i \operatorname {PolyLog}\left (2,-e^{2 i x}\right )-\frac {1}{4} i \operatorname {PolyLog}\left (2,e^{2 i x}\right )\right )\) |
Input:
Int[Log[a*Tan[x]^n],x]
Output:
x*Log[a*Tan[x]^n] - 2*n*(-(x*ArcTanh[E^((2*I)*x)]) + (I/4)*PolyLog[2, -E^( (2*I)*x)] - (I/4)*PolyLog[2, E^((2*I)*x)])
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Simp[1/(d*e*n*Log[F]) Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) ))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 , (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
Int[Log[u_], x_Symbol] :> Simp[x*Log[u], x] - Int[SimplifyIntegrand[x*(D[u, x]/u), x], x] /; InverseFunctionFreeQ[u, x]
Int[csc[(e_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[- 2*(c + d*x)^m*(ArcTanh[E^(I*(e + f*x))]/f), x] + (-Simp[d*(m/f) Int[(c + d*x)^(m - 1)*Log[1 - E^(I*(e + f*x))], x], x] + Simp[d*(m/f) Int[(c + d*x )^(m - 1)*Log[1 + E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e, f}, x] && IG tQ[m, 0]
Int[Csc[(a_.) + (b_.)*(x_)]^(n_.)*((c_.) + (d_.)*(x_))^(m_.)*Sec[(a_.) + (b _.)*(x_)]^(n_.), x_Symbol] :> Simp[2^n Int[(c + d*x)^m*Csc[2*a + 2*b*x]^n , x], x] /; FreeQ[{a, b, c, d, m}, x] && IntegerQ[n] && RationalQ[m]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 2.89 (sec) , antiderivative size = 2196, normalized size of antiderivative = 39.21
Input:
int(ln(a*tan(x)^n),x,method=_RETURNVERBOSE)
Output:
x*ln((exp(2*I*x)-1)^n*(1+exp(2*I*x))^(-n)*exp(-1/2*I*Pi*n*(csgn(I*(exp(2*I *x)-1)/(1+exp(2*I*x)))^3-csgn(I*(exp(2*I*x)-1)/(1+exp(2*I*x)))^2*csgn(I*(e xp(2*I*x)-1))-csgn(I*(exp(2*I*x)-1)/(1+exp(2*I*x)))^2*csgn(I/(1+exp(2*I*x) ))+csgn(I*(exp(2*I*x)-1)/(1+exp(2*I*x)))*csgn(I*(exp(2*I*x)-1))*csgn(I/(1+ exp(2*I*x)))-csgn(I*(exp(2*I*x)-1)/(1+exp(2*I*x)))*csgn((exp(2*I*x)-1)/(1+ exp(2*I*x)))^2+csgn((exp(2*I*x)-1)/(1+exp(2*I*x)))^3+csgn((exp(2*I*x)-1)/( 1+exp(2*I*x)))*csgn(I*(exp(2*I*x)-1)/(1+exp(2*I*x)))-csgn((exp(2*I*x)-1)/( 1+exp(2*I*x)))^2+1)))+1/2*I*Pi*csgn(I*a)*csgn(I*a*(exp(2*I*x)-1)^n*(1+exp( 2*I*x))^(-n)*exp(-1/2*I*Pi*n*(csgn(I*(exp(2*I*x)-1)/(1+exp(2*I*x)))^3-csgn (I*(exp(2*I*x)-1)/(1+exp(2*I*x)))^2*csgn(I*(exp(2*I*x)-1))-csgn(I*(exp(2*I *x)-1)/(1+exp(2*I*x)))^2*csgn(I/(1+exp(2*I*x)))+csgn(I*(exp(2*I*x)-1)/(1+e xp(2*I*x)))*csgn(I*(exp(2*I*x)-1))*csgn(I/(1+exp(2*I*x)))-csgn(I*(exp(2*I* x)-1)/(1+exp(2*I*x)))*csgn((exp(2*I*x)-1)/(1+exp(2*I*x)))^2+csgn((exp(2*I* x)-1)/(1+exp(2*I*x)))^3+csgn((exp(2*I*x)-1)/(1+exp(2*I*x)))*csgn(I*(exp(2* I*x)-1)/(1+exp(2*I*x)))-csgn((exp(2*I*x)-1)/(1+exp(2*I*x)))^2+1)))^2*x+1/2 *I*Pi*csgn(I*(exp(2*I*x)-1)^n*(1+exp(2*I*x))^(-n)*exp(-1/2*I*Pi*n*(csgn(I* (exp(2*I*x)-1)/(1+exp(2*I*x)))^3-csgn(I*(exp(2*I*x)-1)/(1+exp(2*I*x)))^2*c sgn(I*(exp(2*I*x)-1))-csgn(I*(exp(2*I*x)-1)/(1+exp(2*I*x)))^2*csgn(I/(1+ex p(2*I*x)))+csgn(I*(exp(2*I*x)-1)/(1+exp(2*I*x)))*csgn(I*(exp(2*I*x)-1))*cs gn(I/(1+exp(2*I*x)))-csgn(I*(exp(2*I*x)-1)/(1+exp(2*I*x)))*csgn((exp(2*...
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 195 vs. \(2 (37) = 74\).
Time = 0.09 (sec) , antiderivative size = 195, normalized size of antiderivative = 3.48 \[ \int \log \left (a \tan ^n(x)\right ) \, dx=-\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 ) \] Input:
integrate(log(a*tan(x)^n),x, algorithm="fricas")
Output:
-1/2*n*x*log(2*(tan(x)^2 + I*tan(x))/(tan(x)^2 + 1)) - 1/2*n*x*log(2*(tan( x)^2 - I*tan(x))/(tan(x)^2 + 1)) + 1/2*n*x*log(-2*(I*tan(x) - 1)/(tan(x)^2 + 1)) + 1/2*n*x*log(-2*(-I*tan(x) - 1)/(tan(x)^2 + 1)) + n*x*log(tan(x)) - 1/4*I*n*dilog(-2*(tan(x)^2 + I*tan(x))/(tan(x)^2 + 1) + 1) + 1/4*I*n*dil og(-2*(tan(x)^2 - I*tan(x))/(tan(x)^2 + 1) + 1) + 1/4*I*n*dilog(2*(I*tan(x ) - 1)/(tan(x)^2 + 1) + 1) - 1/4*I*n*dilog(2*(-I*tan(x) - 1)/(tan(x)^2 + 1 ) + 1) + x*log(a)
\[ \int \log \left (a \tan ^n(x)\right ) \, dx=\int \log {\left (a \tan ^{n}{\left (x \right )} \right )}\, dx \] Input:
integrate(ln(a*tan(x)**n),x)
Output:
Integral(log(a*tan(x)**n), x)
Time = 0.11 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.86 \[ \int \log \left (a \tan ^n(x)\right ) \, dx=-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 ) \] Input:
integrate(log(a*tan(x)^n),x, algorithm="maxima")
Output:
-n*x*log(tan(x)) + 1/4*(pi*log(tan(x)^2 + 1) + 2*I*dilog(I*tan(x) + 1) - 2 *I*dilog(-I*tan(x) + 1))*n + x*log(a*tan(x)^n)
\[ \int \log \left (a \tan ^n(x)\right ) \, dx=\int { \log \left (a \tan \left (x\right )^{n}\right ) \,d x } \] Input:
integrate(log(a*tan(x)^n),x, algorithm="giac")
Output:
integrate(log(a*tan(x)^n), x)
Time = 0.07 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.79 \[ \int \log \left (a \tan ^n(x)\right ) \, dx=\frac {n\,\mathrm {polylog}\left (2,{\mathrm {e}}^{x\,2{}\mathrm {i}}\right )\,1{}\mathrm {i}}{2}+x\,\ln \left (a\,{\mathrm {tan}\left (x\right )}^n\right )-\frac {n\,\mathrm {polylog}\left (2,-{\mathrm {e}}^{x\,2{}\mathrm {i}}\right )\,1{}\mathrm {i}}{2}+2\,n\,x\,\mathrm {atanh}\left ({\mathrm {e}}^{x\,2{}\mathrm {i}}\right ) \] Input:
int(log(a*tan(x)^n),x)
Output:
(n*polylog(2, exp(x*2i))*1i)/2 + x*log(a*tan(x)^n) - (n*polylog(2, -exp(x* 2i))*1i)/2 + 2*n*x*atanh(exp(x*2i))
\[ \int \log \left (a \tan ^n(x)\right ) \, dx=\int \mathrm {log}\left (\tan \left (x \right )^{n} a \right )d x \] Input:
int(log(a*tan(x)^n),x)
Output:
int(log(tan(x)**n*a),x)