\(\int \cot ^{-1}(\tanh (a+b x)) \, dx\) [38]

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

Optimal result

Integrand size = 7, antiderivative size = 73 \[ \int \cot ^{-1}(\tanh (a+b x)) \, dx=x \cot ^{-1}(\tanh (a+b x))+x \arctan \left (e^{2 a+2 b x}\right )-\frac {i \operatorname {PolyLog}\left (2,-i e^{2 a+2 b x}\right )}{4 b}+\frac {i \operatorname {PolyLog}\left (2,i e^{2 a+2 b x}\right )}{4 b} \] Output:

x*arccot(tanh(b*x+a))+x*arctan(exp(2*b*x+2*a))-1/4*I*polylog(2,-I*exp(2*b* 
x+2*a))/b+1/4*I*polylog(2,I*exp(2*b*x+2*a))/b
 

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.25 \[ \int \cot ^{-1}(\tanh (a+b x)) \, dx=x \cot ^{-1}(\tanh (a+b x))+\frac {i \left (2 b x \left (\log \left (1-i e^{2 (a+b x)}\right )-\log \left (1+i e^{2 (a+b x)}\right )\right )-\operatorname {PolyLog}\left (2,-i e^{2 (a+b x)}\right )+\operatorname {PolyLog}\left (2,i e^{2 (a+b x)}\right )\right )}{4 b} \] Input:

Integrate[ArcCot[Tanh[a + b*x]],x]
 

Output:

x*ArcCot[Tanh[a + b*x]] + ((I/4)*(2*b*x*(Log[1 - I*E^(2*(a + b*x))] - Log[ 
1 + I*E^(2*(a + b*x))]) - PolyLog[2, (-I)*E^(2*(a + b*x))] + PolyLog[2, I* 
E^(2*(a + b*x))]))/b
 

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.08, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.714, Rules used = {5703, 3042, 4668, 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 \cot ^{-1}(\tanh (a+b x)) \, dx\)

\(\Big \downarrow \) 5703

\(\displaystyle b \int x \text {sech}(2 a+2 b x)dx+x \cot ^{-1}(\tanh (a+b x))\)

\(\Big \downarrow \) 3042

\(\displaystyle x \cot ^{-1}(\tanh (a+b x))+b \int x \csc \left (2 i a+2 i b x+\frac {\pi }{2}\right )dx\)

\(\Big \downarrow \) 4668

\(\displaystyle x \cot ^{-1}(\tanh (a+b x))+b \left (-\frac {i \int \log \left (1-i e^{2 a+2 b x}\right )dx}{2 b}+\frac {i \int \log \left (1+i e^{2 a+2 b x}\right )dx}{2 b}+\frac {x \arctan \left (e^{2 a+2 b x}\right )}{b}\right )\)

\(\Big \downarrow \) 2715

\(\displaystyle x \cot ^{-1}(\tanh (a+b x))+b \left (-\frac {i \int e^{-2 a-2 b x} \log \left (1-i e^{2 a+2 b x}\right )de^{2 a+2 b x}}{4 b^2}+\frac {i \int e^{-2 a-2 b x} \log \left (1+i e^{2 a+2 b x}\right )de^{2 a+2 b x}}{4 b^2}+\frac {x \arctan \left (e^{2 a+2 b x}\right )}{b}\right )\)

\(\Big \downarrow \) 2838

\(\displaystyle x \cot ^{-1}(\tanh (a+b x))+b \left (\frac {x \arctan \left (e^{2 a+2 b x}\right )}{b}-\frac {i \operatorname {PolyLog}\left (2,-i e^{2 a+2 b x}\right )}{4 b^2}+\frac {i \operatorname {PolyLog}\left (2,i e^{2 a+2 b x}\right )}{4 b^2}\right )\)

Input:

Int[ArcCot[Tanh[a + b*x]],x]
 

Output:

x*ArcCot[Tanh[a + b*x]] + b*((x*ArcTan[E^(2*a + 2*b*x)])/b - ((I/4)*PolyLo 
g[2, (-I)*E^(2*a + 2*b*x)])/b^2 + ((I/4)*PolyLog[2, I*E^(2*a + 2*b*x)])/b^ 
2)
 

Defintions of rubi rules used

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 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

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

rule 5703
Int[ArcCot[Tanh[(a_.) + (b_.)*(x_)]], x_Symbol] :> Simp[x*ArcCot[Tanh[a + b 
*x]], x] + Simp[b   Int[x*Sech[2*a + 2*b*x], x], x] /; FreeQ[{a, b}, x]
 
Maple [A] (verified)

Time = 1.32 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.45

method result size
parts \(x \,\operatorname {arccot}\left (\tanh \left (b x +a \right )\right )+\frac {\frac {i \left (b x +a \right ) \left (\ln \left (1-i {\mathrm e}^{2 b x +2 a}\right )-\ln \left (1+i {\mathrm e}^{2 b x +2 a}\right )\right )}{2}-\frac {i \operatorname {dilog}\left (1+i {\mathrm e}^{2 b x +2 a}\right )}{4}+\frac {i \operatorname {dilog}\left (1-i {\mathrm e}^{2 b x +2 a}\right )}{4}-a \arctan \left ({\mathrm e}^{2 b x +2 a}\right )}{b}\) \(106\)
derivativedivides \(\frac {\operatorname {arctanh}\left (\tanh \left (b x +a \right )\right ) \operatorname {arccot}\left (\tanh \left (b x +a \right )\right )+\arctan \left (\tanh \left (b x +a \right )\right ) \operatorname {arctanh}\left (\tanh \left (b x +a \right )\right )+\frac {\arctan \left (\tanh \left (b x +a \right )\right ) \ln \left (1+\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh \left (b x +a \right )^{2}+1}\right )}{2}-\frac {\arctan \left (\tanh \left (b x +a \right )\right ) \ln \left (1-\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh \left (b x +a \right )^{2}+1}\right )}{2}-\frac {i \operatorname {dilog}\left (1+\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh \left (b x +a \right )^{2}+1}\right )}{4}+\frac {i \operatorname {dilog}\left (1-\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh \left (b x +a \right )^{2}+1}\right )}{4}}{b}\) \(184\)
default \(\frac {\operatorname {arctanh}\left (\tanh \left (b x +a \right )\right ) \operatorname {arccot}\left (\tanh \left (b x +a \right )\right )+\arctan \left (\tanh \left (b x +a \right )\right ) \operatorname {arctanh}\left (\tanh \left (b x +a \right )\right )+\frac {\arctan \left (\tanh \left (b x +a \right )\right ) \ln \left (1+\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh \left (b x +a \right )^{2}+1}\right )}{2}-\frac {\arctan \left (\tanh \left (b x +a \right )\right ) \ln \left (1-\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh \left (b x +a \right )^{2}+1}\right )}{2}-\frac {i \operatorname {dilog}\left (1+\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh \left (b x +a \right )^{2}+1}\right )}{4}+\frac {i \operatorname {dilog}\left (1-\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh \left (b x +a \right )^{2}+1}\right )}{4}}{b}\) \(184\)
risch \(\text {Expression too large to display}\) \(1111\)

Input:

int(arccot(tanh(b*x+a)),x,method=_RETURNVERBOSE)
 

Output:

x*arccot(tanh(b*x+a))+1/b*(1/2*I*(b*x+a)*(ln(1-I*exp(2*b*x+2*a))-ln(1+I*ex 
p(2*b*x+2*a)))-1/4*I*dilog(1+I*exp(2*b*x+2*a))+1/4*I*dilog(1-I*exp(2*b*x+2 
*a))-a*arctan(exp(2*b*x+2*a)))
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 334 vs. \(2 (56) = 112\).

Time = 0.14 (sec) , antiderivative size = 334, normalized size of antiderivative = 4.58 \[ \int \cot ^{-1}(\tanh (a+b x)) \, dx=\frac {2 \, b x \arctan \left (\frac {\cosh \left (b x + a\right )}{\sinh \left (b x + a\right )}\right ) + {\left (i \, b x + i \, a\right )} \log \left (\frac {1}{2} \, \sqrt {4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (i \, b x + i \, a\right )} \log \left (-\frac {1}{2} \, \sqrt {4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (-i \, b x - i \, a\right )} \log \left (\frac {1}{2} \, \sqrt {-4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (-i \, b x - i \, a\right )} \log \left (-\frac {1}{2} \, \sqrt {-4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) - i \, a \log \left (i \, \sqrt {4 i} + 2 \, \cosh \left (b x + a\right ) + 2 \, \sinh \left (b x + a\right )\right ) - i \, a \log \left (-i \, \sqrt {4 i} + 2 \, \cosh \left (b x + a\right ) + 2 \, \sinh \left (b x + a\right )\right ) + i \, a \log \left (i \, \sqrt {-4 i} + 2 \, \cosh \left (b x + a\right ) + 2 \, \sinh \left (b x + a\right )\right ) + i \, a \log \left (-i \, \sqrt {-4 i} + 2 \, \cosh \left (b x + a\right ) + 2 \, \sinh \left (b x + a\right )\right ) + i \, {\rm Li}_2\left (\frac {1}{2} \, \sqrt {4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) + i \, {\rm Li}_2\left (-\frac {1}{2} \, \sqrt {4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) - i \, {\rm Li}_2\left (\frac {1}{2} \, \sqrt {-4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) - i \, {\rm Li}_2\left (-\frac {1}{2} \, \sqrt {-4 i} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right )}{2 \, b} \] Input:

integrate(arccot(tanh(b*x+a)),x, algorithm="fricas")
 

Output:

1/2*(2*b*x*arctan(cosh(b*x + a)/sinh(b*x + a)) + (I*b*x + I*a)*log(1/2*sqr 
t(4*I)*(cosh(b*x + a) + sinh(b*x + a)) + 1) + (I*b*x + I*a)*log(-1/2*sqrt( 
4*I)*(cosh(b*x + a) + sinh(b*x + a)) + 1) + (-I*b*x - I*a)*log(1/2*sqrt(-4 
*I)*(cosh(b*x + a) + sinh(b*x + a)) + 1) + (-I*b*x - I*a)*log(-1/2*sqrt(-4 
*I)*(cosh(b*x + a) + sinh(b*x + a)) + 1) - I*a*log(I*sqrt(4*I) + 2*cosh(b* 
x + a) + 2*sinh(b*x + a)) - I*a*log(-I*sqrt(4*I) + 2*cosh(b*x + a) + 2*sin 
h(b*x + a)) + I*a*log(I*sqrt(-4*I) + 2*cosh(b*x + a) + 2*sinh(b*x + a)) + 
I*a*log(-I*sqrt(-4*I) + 2*cosh(b*x + a) + 2*sinh(b*x + a)) + I*dilog(1/2*s 
qrt(4*I)*(cosh(b*x + a) + sinh(b*x + a))) + I*dilog(-1/2*sqrt(4*I)*(cosh(b 
*x + a) + sinh(b*x + a))) - I*dilog(1/2*sqrt(-4*I)*(cosh(b*x + a) + sinh(b 
*x + a))) - I*dilog(-1/2*sqrt(-4*I)*(cosh(b*x + a) + sinh(b*x + a))))/b
 

Sympy [F]

\[ \int \cot ^{-1}(\tanh (a+b x)) \, dx=\int \operatorname {acot}{\left (\tanh {\left (a + b x \right )} \right )}\, dx \] Input:

integrate(acot(tanh(b*x+a)),x)
 

Output:

Integral(acot(tanh(a + b*x)), x)
 

Maxima [F]

\[ \int \cot ^{-1}(\tanh (a+b x)) \, dx=\int { \operatorname {arccot}\left (\tanh \left (b x + a\right )\right ) \,d x } \] Input:

integrate(arccot(tanh(b*x+a)),x, algorithm="maxima")
 

Output:

x*arctan2(e^(2*b*x + 2*a) + 1, e^(2*b*x + 2*a) - 1) + 2*b*integrate(x*e^(2 
*b*x + 2*a)/(e^(4*b*x + 4*a) + 1), x)
 

Giac [F]

\[ \int \cot ^{-1}(\tanh (a+b x)) \, dx=\int { \operatorname {arccot}\left (\tanh \left (b x + a\right )\right ) \,d x } \] Input:

integrate(arccot(tanh(b*x+a)),x, algorithm="giac")
 

Output:

integrate(arccot(tanh(b*x + a)), x)
 

Mupad [F(-1)]

Timed out. \[ \int \cot ^{-1}(\tanh (a+b x)) \, dx=\int \mathrm {acot}\left (\mathrm {tanh}\left (a+b\,x\right )\right ) \,d x \] Input:

int(acot(tanh(a + b*x)),x)
 

Output:

int(acot(tanh(a + b*x)), x)
 

Reduce [F]

\[ \int \cot ^{-1}(\tanh (a+b x)) \, dx=\int \mathit {acot} \left (\tanh \left (b x +a \right )\right )d x \] Input:

int(acot(tanh(b*x+a)),x)
 

Output:

int(acot(tanh(a + b*x)),x)