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

Optimal. Leaf size=73 \[ x \cot ^{-1}(\tanh (a+b x))+x \text {ArcTan}\left (e^{2 a+2 b x}\right )-\frac {i \text {PolyLog}\left (2,-i e^{2 a+2 b x}\right )}{4 b}+\frac {i \text {PolyLog}\left (2,i e^{2 a+2 b x}\right )}{4 b} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {5288, 4265, 2317, 2438} \begin {gather*} x \text {ArcTan}\left (e^{2 a+2 b x}\right )-\frac {i \text {Li}_2\left (-i e^{2 a+2 b x}\right )}{4 b}+\frac {i \text {Li}_2\left (i e^{2 a+2 b x}\right )}{4 b}+x \cot ^{-1}(\tanh (a+b x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2317

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 2438

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 4265

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] + (-Dist[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] + Dist[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 5288

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

Rubi steps

\begin {align*} \int \cot ^{-1}(\tanh (a+b x)) \, dx &=x \cot ^{-1}(\tanh (a+b x))+b \int x \text {sech}(2 a+2 b x) \, dx\\ &=x \cot ^{-1}(\tanh (a+b x))+x \tan ^{-1}\left (e^{2 a+2 b x}\right )-\frac {1}{2} i \int \log \left (1-i e^{2 a+2 b x}\right ) \, dx+\frac {1}{2} i \int \log \left (1+i e^{2 a+2 b x}\right ) \, dx\\ &=x \cot ^{-1}(\tanh (a+b x))+x \tan ^{-1}\left (e^{2 a+2 b x}\right )-\frac {i \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{2 a+2 b x}\right )}{4 b}+\frac {i \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{2 a+2 b x}\right )}{4 b}\\ &=x \cot ^{-1}(\tanh (a+b x))+x \tan ^{-1}\left (e^{2 a+2 b x}\right )-\frac {i \text {Li}_2\left (-i e^{2 a+2 b x}\right )}{4 b}+\frac {i \text {Li}_2\left (i e^{2 a+2 b x}\right )}{4 b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 132, normalized size = 1.81 \begin {gather*} x \cot ^{-1}(\tanh (a+b x))+\frac {-\left ((-4 i a+\pi -4 i b x) \left (\log \left (1-i e^{2 (a+b x)}\right )-\log \left (1+i e^{2 (a+b x)}\right )\right )\right )+(-4 i a+\pi ) \log \left (\cot \left (\frac {1}{4} (4 i a+\pi +4 i b x)\right )\right )-2 i \left (\text {PolyLog}\left (2,-i e^{2 (a+b x)}\right )-\text {PolyLog}\left (2,i e^{2 (a+b x)}\right )\right )}{8 b} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 183 vs. \(2 (62 ) = 124\).
time = 0.64, size = 184, normalized size = 2.52

method result size
derivativedivides \(\frac {\arctanh \left (\tanh \left (b x +a \right )\right ) \mathrm {arccot}\left (\tanh \left (b x +a \right )\right )+\arctanh \left (\tanh \left (b x +a \right )\right ) \arctan \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 ^{2}\left (b x +a \right )+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 ^{2}\left (b x +a \right )+1}\right )}{2}-\frac {i \dilog \left (1+\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh ^{2}\left (b x +a \right )+1}\right )}{4}+\frac {i \dilog \left (1-\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh ^{2}\left (b x +a \right )+1}\right )}{4}}{b}\) \(184\)
default \(\frac {\arctanh \left (\tanh \left (b x +a \right )\right ) \mathrm {arccot}\left (\tanh \left (b x +a \right )\right )+\arctanh \left (\tanh \left (b x +a \right )\right ) \arctan \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 ^{2}\left (b x +a \right )+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 ^{2}\left (b x +a \right )+1}\right )}{2}-\frac {i \dilog \left (1+\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh ^{2}\left (b x +a \right )+1}\right )}{4}+\frac {i \dilog \left (1-\frac {i \left (1+i \tanh \left (b x +a \right )\right )^{2}}{\tanh ^{2}\left (b x +a \right )+1}\right )}{4}}{b}\) \(184\)
risch \(\text {Expression too large to display}\) \(1111\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/b*(arctanh(tanh(b*x+a))*arccot(tanh(b*x+a))+arctanh(tanh(b*x+a))*arctan(tanh(b*x+a))+1/2*arctan(tanh(b*x+a))
*ln(1+I*(1+I*tanh(b*x+a))^2/(tanh(b*x+a)^2+1))-1/2*arctan(tanh(b*x+a))*ln(1-I*(1+I*tanh(b*x+a))^2/(tanh(b*x+a)
^2+1))-1/4*I*dilog(1+I*(1+I*tanh(b*x+a))^2/(tanh(b*x+a)^2+1))+1/4*I*dilog(1-I*(1+I*tanh(b*x+a))^2/(tanh(b*x+a)
^2+1)))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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
)

________________________________________________________________________________________

Fricas [B] 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 = 2.42, size = 334, normalized size = 4.58 \begin {gather*} \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} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(2*b*x*arctan(cosh(b*x + a)/sinh(b*x + a)) + (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*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
*sinh(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*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))) - I*dilog(-1/2*sqrt(
-4*I)*(cosh(b*x + a) + sinh(b*x + a))))/b

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \operatorname {acot}{\left (\tanh {\left (a + b x \right )} \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \mathrm {acot}\left (\mathrm {tanh}\left (a+b\,x\right )\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________