\(\int \log ^2(a+b \cot (c+d x)) \, dx\) [7]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F(-1)]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 13, antiderivative size = 230 \[ \int \log ^2(a+b \cot (c+d x)) \, dx=\frac {i \log \left (\frac {b (i-\cot (c+d x))}{a+i b}\right ) \log ^2(a+b \cot (c+d x))}{2 d}-\frac {i \log \left (-\frac {b (i+\cot (c+d x))}{a-i b}\right ) \log ^2(a+b \cot (c+d x))}{2 d}-\frac {i \log (a+b \cot (c+d x)) \operatorname {PolyLog}\left (2,\frac {a+b \cot (c+d x)}{a-i b}\right )}{d}+\frac {i \log (a+b \cot (c+d x)) \operatorname {PolyLog}\left (2,\frac {a+b \cot (c+d x)}{a+i b}\right )}{d}+\frac {i \operatorname {PolyLog}\left (3,\frac {a+b \cot (c+d x)}{a-i b}\right )}{d}-\frac {i \operatorname {PolyLog}\left (3,\frac {a+b \cot (c+d x)}{a+i b}\right )}{d} \] Output:

1/2*I*ln(b*(I-cot(d*x+c))/(a+I*b))*ln(a+b*cot(d*x+c))^2/d-1/2*I*ln(-b*(I+c 
ot(d*x+c))/(a-I*b))*ln(a+b*cot(d*x+c))^2/d-I*ln(a+b*cot(d*x+c))*polylog(2, 
(a+b*cot(d*x+c))/(a-I*b))/d+I*ln(a+b*cot(d*x+c))*polylog(2,(a+b*cot(d*x+c) 
)/(a+I*b))/d+I*polylog(3,(a+b*cot(d*x+c))/(a-I*b))/d-I*polylog(3,(a+b*cot( 
d*x+c))/(a+I*b))/d
 

Mathematica [A] (verified)

Time = 0.96 (sec) , antiderivative size = 203, normalized size of antiderivative = 0.88 \[ \int \log ^2(a+b \cot (c+d x)) \, dx=\frac {i \left (\log \left (-\frac {b (-i+\cot (c+d x))}{a+i b}\right ) \log ^2(a+b \cot (c+d x))-\log \left (-\frac {b (i+\cot (c+d x))}{a-i b}\right ) \log ^2(a+b \cot (c+d x))-2 \log (a+b \cot (c+d x)) \operatorname {PolyLog}\left (2,\frac {a+b \cot (c+d x)}{a-i b}\right )+2 \log (a+b \cot (c+d x)) \operatorname {PolyLog}\left (2,\frac {a+b \cot (c+d x)}{a+i b}\right )+2 \operatorname {PolyLog}\left (3,\frac {a+b \cot (c+d x)}{a-i b}\right )-2 \operatorname {PolyLog}\left (3,\frac {a+b \cot (c+d x)}{a+i b}\right )\right )}{2 d} \] Input:

Integrate[Log[a + b*Cot[c + d*x]]^2,x]
 

Output:

((I/2)*(Log[-((b*(-I + Cot[c + d*x]))/(a + I*b))]*Log[a + b*Cot[c + d*x]]^ 
2 - Log[-((b*(I + Cot[c + d*x]))/(a - I*b))]*Log[a + b*Cot[c + d*x]]^2 - 2 
*Log[a + b*Cot[c + d*x]]*PolyLog[2, (a + b*Cot[c + d*x])/(a - I*b)] + 2*Lo 
g[a + b*Cot[c + d*x]]*PolyLog[2, (a + b*Cot[c + d*x])/(a + I*b)] + 2*PolyL 
og[3, (a + b*Cot[c + d*x])/(a - I*b)] - 2*PolyLog[3, (a + b*Cot[c + d*x])/ 
(a + I*b)]))/d
 

Rubi [A] (verified)

Time = 0.73 (sec) , antiderivative size = 217, normalized size of antiderivative = 0.94, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {4852, 2856, 2009}

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 ^2(a+b \cot (c+d x)) \, dx\)

\(\Big \downarrow \) 4852

\(\displaystyle -\frac {\int \frac {\log ^2(a+b \cot (c+d x))}{\cot ^2(c+d x)+1}d\cot (c+d x)}{d}\)

\(\Big \downarrow \) 2856

\(\displaystyle -\frac {\int \left (\frac {i \log ^2(a+b \cot (c+d x))}{2 (i-\cot (c+d x))}+\frac {i \log ^2(a+b \cot (c+d x))}{2 (\cot (c+d x)+i)}\right )d\cot (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {-i \operatorname {PolyLog}\left (3,\frac {a+b \cot (c+d x)}{a-i b}\right )+i \operatorname {PolyLog}\left (3,\frac {a+b \cot (c+d x)}{a+i b}\right )+i \operatorname {PolyLog}\left (2,\frac {a+b \cot (c+d x)}{a-i b}\right ) \log (a+b \cot (c+d x))-i \operatorname {PolyLog}\left (2,\frac {a+b \cot (c+d x)}{a+i b}\right ) \log (a+b \cot (c+d x))-\frac {1}{2} i \log \left (\frac {b (-\cot (c+d x)+i)}{a+i b}\right ) \log ^2(a+b \cot (c+d x))+\frac {1}{2} i \log \left (-\frac {b (\cot (c+d x)+i)}{a-i b}\right ) \log ^2(a+b \cot (c+d x))}{d}\)

Input:

Int[Log[a + b*Cot[c + d*x]]^2,x]
 

Output:

-(((-1/2*I)*Log[(b*(I - Cot[c + d*x]))/(a + I*b)]*Log[a + b*Cot[c + d*x]]^ 
2 + (I/2)*Log[-((b*(I + Cot[c + d*x]))/(a - I*b))]*Log[a + b*Cot[c + d*x]] 
^2 + I*Log[a + b*Cot[c + d*x]]*PolyLog[2, (a + b*Cot[c + d*x])/(a - I*b)] 
- I*Log[a + b*Cot[c + d*x]]*PolyLog[2, (a + b*Cot[c + d*x])/(a + I*b)] - I 
*PolyLog[3, (a + b*Cot[c + d*x])/(a - I*b)] + I*PolyLog[3, (a + b*Cot[c + 
d*x])/(a + I*b)])/d)
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2856
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_. 
)*(x_)^(r_))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*Log[c*(d + e*x) 
^n])^p, (f + g*x^r)^q, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, r}, x] && I 
GtQ[p, 0] && IntegerQ[q] && (GtQ[q, 0] || (IntegerQ[r] && NeQ[r, 1]))
 

rule 4852
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, Simp[With[{d = FreeFa 
ctors[Cot[v], x]}, -d/Coefficient[v, x, 1]   Subst[Int[SubstFor[1/(1 + d^2* 
x^2), Cot[v]/d, u, x], x], x, Cot[v]/d]], x] /;  !FalseQ[v] && FunctionOfQ[ 
NonfreeFactors[Cot[v], x], u, x, True] && TryPureTanSubst[ActivateTrig[u], 
x]]
 
Maple [F]

\[\int \ln \left (a +b \cot \left (d x +c \right )\right )^{2}d x\]

Input:

int(ln(a+b*cot(d*x+c))^2,x)
 

Output:

int(ln(a+b*cot(d*x+c))^2,x)
 

Fricas [F]

\[ \int \log ^2(a+b \cot (c+d x)) \, dx=\int { \log \left (b \cot \left (d x + c\right ) + a\right )^{2} \,d x } \] Input:

integrate(log(a+b*cot(d*x+c))^2,x, algorithm="fricas")
 

Output:

integral(log(b*cot(d*x + c) + a)^2, x)
 

Sympy [F]

\[ \int \log ^2(a+b \cot (c+d x)) \, dx=\int \log {\left (a + b \cot {\left (c + d x \right )} \right )}^{2}\, dx \] Input:

integrate(ln(a+b*cot(d*x+c))**2,x)
 

Output:

Integral(log(a + b*cot(c + d*x))**2, x)
 

Maxima [F(-1)]

Timed out. \[ \int \log ^2(a+b \cot (c+d x)) \, dx=\text {Timed out} \] Input:

integrate(log(a+b*cot(d*x+c))^2,x, algorithm="maxima")
 

Output:

Timed out
 

Giac [F]

\[ \int \log ^2(a+b \cot (c+d x)) \, dx=\int { \log \left (b \cot \left (d x + c\right ) + a\right )^{2} \,d x } \] Input:

integrate(log(a+b*cot(d*x+c))^2,x, algorithm="giac")
 

Output:

integrate(log(b*cot(d*x + c) + a)^2, x)
 

Mupad [F(-1)]

Timed out. \[ \int \log ^2(a+b \cot (c+d x)) \, dx=\int {\ln \left (a+b\,\mathrm {cot}\left (c+d\,x\right )\right )}^2 \,d x \] Input:

int(log(a + b*cot(c + d*x))^2,x)
 

Output:

int(log(a + b*cot(c + d*x))^2, x)
 

Reduce [F]

\[ \int \log ^2(a+b \cot (c+d x)) \, dx=\int \mathrm {log}\left (a +b \cot \left (d x +c \right )\right )^{2}d x \] Input:

int(log(a+b*cot(d*x+c))^2,x)
 

Output:

int(log(cot(c + d*x)*b + a)**2,x)