\(\int \log (a \coth (x)) \, dx\) [212]

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

Optimal result

Integrand size = 5, antiderivative size = 41 \[ \int \log (a \coth (x)) \, dx=-2 x \text {arctanh}\left (e^{2 x}\right )+x \log (a \coth (x))-\frac {1}{2} \operatorname {PolyLog}\left (2,-e^{2 x}\right )+\frac {\operatorname {PolyLog}\left (2,e^{2 x}\right )}{2} \] Output:

-2*x*arctanh(exp(2*x))+x*ln(a*coth(x))-1/2*polylog(2,-exp(2*x))+1/2*polylo 
g(2,exp(2*x))
 

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.20 \[ \int \log (a \coth (x)) \, dx=-\frac {1}{2} \log (a \coth (x)) \log (1-\tanh (x))+\frac {1}{2} \log (a \coth (x)) \log (1+\tanh (x))-\frac {1}{2} \operatorname {PolyLog}(2,-\tanh (x))+\frac {\operatorname {PolyLog}(2,\tanh (x))}{2} \] Input:

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

Output:

-1/2*(Log[a*Coth[x]]*Log[1 - Tanh[x]]) + (Log[a*Coth[x]]*Log[1 + Tanh[x]]) 
/2 - PolyLog[2, -Tanh[x]]/2 + PolyLog[2, Tanh[x]]/2
 

Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 0.35 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.27, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.600, Rules used = {3028, 25, 5984, 3042, 26, 4670, 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 (a \coth (x)) \, dx\)

\(\Big \downarrow \) 3028

\(\displaystyle x \log (a \coth (x))-\int -x \text {csch}(x) \text {sech}(x)dx\)

\(\Big \downarrow \) 25

\(\displaystyle \int x \text {csch}(x) \text {sech}(x)dx+x \log (a \coth (x))\)

\(\Big \downarrow \) 5984

\(\displaystyle 2 \int x \text {csch}(2 x)dx+x \log (a \coth (x))\)

\(\Big \downarrow \) 3042

\(\displaystyle x \log (a \coth (x))+2 \int i x \csc (2 i x)dx\)

\(\Big \downarrow \) 26

\(\displaystyle x \log (a \coth (x))+2 i \int x \csc (2 i x)dx\)

\(\Big \downarrow \) 4670

\(\displaystyle x \log (a \coth (x))+2 i \left (\frac {1}{2} i \int \log \left (1-e^{2 x}\right )dx-\frac {1}{2} i \int \log \left (1+e^{2 x}\right )dx+i x \text {arctanh}\left (e^{2 x}\right )\right )\)

\(\Big \downarrow \) 2715

\(\displaystyle x \log (a \coth (x))+2 i \left (\frac {1}{4} i \int e^{-2 x} \log \left (1-e^{2 x}\right )de^{2 x}-\frac {1}{4} i \int e^{-2 x} \log \left (1+e^{2 x}\right )de^{2 x}+i x \text {arctanh}\left (e^{2 x}\right )\right )\)

\(\Big \downarrow \) 2838

\(\displaystyle x \log (a \coth (x))+2 i \left (i x \text {arctanh}\left (e^{2 x}\right )+\frac {1}{4} i \operatorname {PolyLog}\left (2,-e^{2 x}\right )-\frac {1}{4} i \operatorname {PolyLog}\left (2,e^{2 x}\right )\right )\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

rule 2715
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]
 

rule 2838
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]
 

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

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4670
Int[csc[(e_.) + (Complex[0, fz_])*(f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x 
_Symbol] :> Simp[-2*(c + d*x)^m*(ArcTanh[E^((-I)*e + f*fz*x)]/(f*fz*I)), x] 
 + (-Simp[d*(m/(f*fz*I))   Int[(c + d*x)^(m - 1)*Log[1 - E^((-I)*e + f*fz*x 
)], x], x] + Simp[d*(m/(f*fz*I))   Int[(c + d*x)^(m - 1)*Log[1 + E^((-I)*e 
+ f*fz*x)], x], x]) /; FreeQ[{c, d, e, f, fz}, x] && IGtQ[m, 0]
 

rule 5984
Int[Csch[(a_.) + (b_.)*(x_)]^(n_.)*((c_.) + (d_.)*(x_))^(m_.)*Sech[(a_.) + 
(b_.)*(x_)]^(n_.), x_Symbol] :> Simp[2^n   Int[(c + d*x)^m*Csch[2*a + 2*b*x 
]^n, x], x] /; FreeQ[{a, b, c, d}, x] && RationalQ[m] && IntegerQ[n]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(75\) vs. \(2(34)=68\).

Time = 0.42 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.85

method result size
derivativedivides \(\frac {\frac {\left (\operatorname {dilog}\left (\frac {a \coth \left (x \right )+a}{a}\right )+\ln \left (a \coth \left (x \right )\right ) \ln \left (\frac {a \coth \left (x \right )+a}{a}\right )\right ) a}{2}-\frac {\left (\operatorname {dilog}\left (-\frac {a \coth \left (x \right )-a}{a}\right )+\ln \left (a \coth \left (x \right )\right ) \ln \left (-\frac {a \coth \left (x \right )-a}{a}\right )\right ) a}{2}}{a}\) \(76\)
default \(\frac {\frac {\left (\operatorname {dilog}\left (\frac {a \coth \left (x \right )+a}{a}\right )+\ln \left (a \coth \left (x \right )\right ) \ln \left (\frac {a \coth \left (x \right )+a}{a}\right )\right ) a}{2}-\frac {\left (\operatorname {dilog}\left (-\frac {a \coth \left (x \right )-a}{a}\right )+\ln \left (a \coth \left (x \right )\right ) \ln \left (-\frac {a \coth \left (x \right )-a}{a}\right )\right ) a}{2}}{a}\) \(76\)
risch \(-x \ln \left (-1+{\mathrm e}^{2 x}\right )+\frac {i \pi \,\operatorname {csgn}\left (\frac {i \left (1+{\mathrm e}^{2 x}\right )}{-1+{\mathrm e}^{2 x}}\right ) {\operatorname {csgn}\left (\frac {i a \left (1+{\mathrm e}^{2 x}\right )}{-1+{\mathrm e}^{2 x}}\right )}^{2} x}{2}-\frac {i \pi \,\operatorname {csgn}\left (i a \right ) \operatorname {csgn}\left (\frac {i \left (1+{\mathrm e}^{2 x}\right )}{-1+{\mathrm e}^{2 x}}\right ) \operatorname {csgn}\left (\frac {i a \left (1+{\mathrm e}^{2 x}\right )}{-1+{\mathrm e}^{2 x}}\right ) x}{2}+\frac {i \pi \,\operatorname {csgn}\left (i \left (1+{\mathrm e}^{2 x}\right )\right ) {\operatorname {csgn}\left (\frac {i \left (1+{\mathrm e}^{2 x}\right )}{-1+{\mathrm e}^{2 x}}\right )}^{2} x}{2}+\frac {i \pi \,\operatorname {csgn}\left (i a \right ) {\operatorname {csgn}\left (\frac {i a \left (1+{\mathrm e}^{2 x}\right )}{-1+{\mathrm e}^{2 x}}\right )}^{2} x}{2}+x \ln \left (a \right )-\operatorname {dilog}\left ({\mathrm e}^{x}\right )+\operatorname {dilog}\left ({\mathrm e}^{x}+1\right )+x \ln \left ({\mathrm e}^{x}+1\right )+\frac {i \pi \,\operatorname {csgn}\left (\frac {i}{-1+{\mathrm e}^{2 x}}\right ) {\operatorname {csgn}\left (\frac {i \left (1+{\mathrm e}^{2 x}\right )}{-1+{\mathrm e}^{2 x}}\right )}^{2} x}{2}-\frac {i \pi {\operatorname {csgn}\left (\frac {i a \left (1+{\mathrm e}^{2 x}\right )}{-1+{\mathrm e}^{2 x}}\right )}^{3} x}{2}-\frac {i \pi \,\operatorname {csgn}\left (i \left (1+{\mathrm e}^{2 x}\right )\right ) \operatorname {csgn}\left (\frac {i}{-1+{\mathrm e}^{2 x}}\right ) \operatorname {csgn}\left (\frac {i \left (1+{\mathrm e}^{2 x}\right )}{-1+{\mathrm e}^{2 x}}\right ) x}{2}-\frac {i \pi {\operatorname {csgn}\left (\frac {i \left (1+{\mathrm e}^{2 x}\right )}{-1+{\mathrm e}^{2 x}}\right )}^{3} x}{2}+\ln \left ({\mathrm e}^{x}\right ) \ln \left (1+{\mathrm e}^{2 x}\right )-\ln \left ({\mathrm e}^{x}\right ) \ln \left (1+i {\mathrm e}^{x}\right )-\ln \left ({\mathrm e}^{x}\right ) \ln \left (1-i {\mathrm e}^{x}\right )-\operatorname {dilog}\left (1+i {\mathrm e}^{x}\right )-\operatorname {dilog}\left (1-i {\mathrm e}^{x}\right )\) \(380\)

Input:

int(ln(a*coth(x)),x,method=_RETURNVERBOSE)
 

Output:

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

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.09 (sec) , antiderivative size = 102, normalized size of antiderivative = 2.49 \[ \int \log (a \coth (x)) \, dx=x \log \left (\frac {a \cosh \left (x\right )}{\sinh \left (x\right )}\right ) + x \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - x \log \left (i \, \cosh \left (x\right ) + i \, \sinh \left (x\right ) + 1\right ) - x \log \left (-i \, \cosh \left (x\right ) - i \, \sinh \left (x\right ) + 1\right ) + x \log \left (-\cosh \left (x\right ) - \sinh \left (x\right ) + 1\right ) + {\rm Li}_2\left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) - {\rm Li}_2\left (i \, \cosh \left (x\right ) + i \, \sinh \left (x\right )\right ) - {\rm Li}_2\left (-i \, \cosh \left (x\right ) - i \, \sinh \left (x\right )\right ) + {\rm Li}_2\left (-\cosh \left (x\right ) - \sinh \left (x\right )\right ) \] Input:

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

Output:

x*log(a*cosh(x)/sinh(x)) + x*log(cosh(x) + sinh(x) + 1) - x*log(I*cosh(x) 
+ I*sinh(x) + 1) - x*log(-I*cosh(x) - I*sinh(x) + 1) + x*log(-cosh(x) - si 
nh(x) + 1) + dilog(cosh(x) + sinh(x)) - dilog(I*cosh(x) + I*sinh(x)) - dil 
og(-I*cosh(x) - I*sinh(x)) + dilog(-cosh(x) - sinh(x))
 

Sympy [F]

\[ \int \log (a \coth (x)) \, dx=\int \log {\left (a \coth {\left (x \right )} \right )}\, dx \] Input:

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.24 \[ \int \log (a \coth (x)) \, dx=x \log \left (a \coth \left (x\right )\right ) - x \log \left (e^{\left (2 \, x\right )} + 1\right ) + x \log \left (e^{x} + 1\right ) + x \log \left (-e^{x} + 1\right ) - \frac {1}{2} \, {\rm Li}_2\left (-e^{\left (2 \, x\right )}\right ) + {\rm Li}_2\left (-e^{x}\right ) + {\rm Li}_2\left (e^{x}\right ) \] Input:

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

Output:

x*log(a*coth(x)) - x*log(e^(2*x) + 1) + x*log(e^x + 1) + x*log(-e^x + 1) - 
 1/2*dilog(-e^(2*x)) + dilog(-e^x) + dilog(e^x)
 

Giac [F]

\[ \int \log (a \coth (x)) \, dx=\int { \log \left (a \coth \left (x\right )\right ) \,d x } \] Input:

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

Output:

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

Mupad [F(-1)]

Timed out. \[ \int \log (a \coth (x)) \, dx=\int \ln \left (a\,\mathrm {coth}\left (x\right )\right ) \,d x \] Input:

int(log(a*coth(x)),x)
 

Output:

int(log(a*coth(x)), x)
 

Reduce [F]

\[ \int \log (a \coth (x)) \, dx=\int \mathrm {log}\left (\coth \left (x \right ) a \right )d x \] Input:

int(log(a*coth(x)),x)
 

Output:

int(log(coth(x)*a),x)