### 3.170 $$\int \log (a \cot (x)) \, dx$$

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]

-2*x*ArcTanh[E^((2*I)*x)] + x*Log[a*Cot[x]] + (I/2)*PolyLog[2, -E^((2*I)*x)] - (I/2)*PolyLog[2, E^((2*I)*x)]

________________________________________________________________________________________

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 veriﬁed.

[In]

Int[Log[a*Cot[x]],x]

[Out]

-2*x*ArcTanh[E^((2*I)*x)] + x*Log[a*Cot[x]] + (I/2)*PolyLog[2, -E^((2*I)*x)] - (I/2)*PolyLog[2, E^((2*I)*x)]

Rule 2548

Int[Log[u_], x_Symbol] :> Simp[x*Log[u], x] - Int[SimplifyIntegrand[(x*D[u, x])/u, x], x] /; InverseFunctionFr
eeQ[u, x]

Rule 4419

Int[Csc[(a_.) + (b_.)*(x_)]^(n_.)*((c_.) + (d_.)*(x_))^(m_.)*Sec[(a_.) + (b_.)*(x_)]^(n_.), x_Symbol] :> Dist[
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]

Rule 4183

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] + (-Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Log[1 - E^(I*(e + f*x))], x], x] + Dist[(d*m)/f, Int[(c +
d*x)^(m - 1)*Log[1 + E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e, f}, x] && IGtQ[m, 0]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[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]

Rule 2391

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]

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 veriﬁed.

[In]

Integrate[Log[a*Cot[x]],x]

[Out]

(I/2)*Log[(-I)*(I - Cot[x])]*Log[a*Cot[x]] - (I/2)*Log[a*Cot[x]]*Log[(-I)*(I + Cot[x])] + (I/2)*PolyLog[2, (-I
)*Cot[x]] - (I/2)*PolyLog[2, I*Cot[x]]

________________________________________________________________________________________

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*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(ln(a*cot(x)),x)

[Out]

1/2*I*ln(a*cot(x))*ln((I*a*cot(x)+a)/a)-1/2*I*ln(a*cot(x))*ln(-(I*a*cot(x)-a)/a)+1/2*I*dilog((I*a*cot(x)+a)/a)
-1/2*I*dilog(-(I*a*cot(x)-a)/a)

________________________________________________________________________________________

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*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(a*cot(x)),x, algorithm="maxima")

[Out]

-1/4*pi*log(tan(x)^2 + 1) + x*log(a/tan(x)) + x*log(tan(x)) - 1/2*I*dilog(I*tan(x) + 1) + 1/2*I*dilog(-I*tan(x
) + 1)

________________________________________________________________________________________

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*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(a*cot(x)),x, algorithm="fricas")

[Out]

x*log((a*cos(2*x) + a)/sin(2*x)) - 1/2*x*log(cos(2*x) + I*sin(2*x) + 1) - 1/2*x*log(cos(2*x) - I*sin(2*x) + 1)
+ 1/2*x*log(-cos(2*x) + I*sin(2*x) + 1) + 1/2*x*log(-cos(2*x) - I*sin(2*x) + 1) - 1/4*I*dilog(cos(2*x) + I*si
n(2*x)) + 1/4*I*dilog(cos(2*x) - I*sin(2*x)) - 1/4*I*dilog(-cos(2*x) + I*sin(2*x)) + 1/4*I*dilog(-cos(2*x) - I
*sin(2*x))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \log{\left (a \cot{\left (x \right )} \right )}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(a*cot(x)),x)

[Out]

Integral(log(a*cot(x)), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \log \left (a \cot \left (x\right )\right )\,{d x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(a*cot(x)),x, algorithm="giac")

[Out]

integrate(log(a*cot(x)), x)