\(\int \coth ^{-1}(\tan (a+b x)) \, dx\) [234]

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

Optimal result

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

[Out]

x*arccoth(tan(b*x+a))+I*x*arctan(exp(2*I*(b*x+a)))-1/4*I*polylog(2,-I*exp(2*I*(b*x+a)))/b+1/4*I*polylog(2,I*ex
p(2*I*(b*x+a)))/b

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {6383, 4266, 2317, 2438} \[ \int \coth ^{-1}(\tan (a+b x)) \, dx=i x \arctan \left (e^{2 i (a+b x)}\right )-\frac {i \operatorname {PolyLog}\left (2,-i e^{2 i (a+b x)}\right )}{4 b}+\frac {i \operatorname {PolyLog}\left (2,i e^{2 i (a+b x)}\right )}{4 b}+x \coth ^{-1}(\tan (a+b x)) \]

[In]

Int[ArcCoth[Tan[a + b*x]],x]

[Out]

x*ArcCoth[Tan[a + b*x]] + I*x*ArcTan[E^((2*I)*(a + b*x))] - ((I/4)*PolyLog[2, (-I)*E^((2*I)*(a + b*x))])/b + (
(I/4)*PolyLog[2, I*E^((2*I)*(a + 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 4266

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

Rule 6383

Int[ArcCoth[Tan[(a_.) + (b_.)*(x_)]], x_Symbol] :> Simp[x*ArcCoth[Tan[a + b*x]], x] - Dist[b, Int[x*Sec[2*a +
2*b*x], x], x] /; FreeQ[{a, b}, x]

Rubi steps \begin{align*} \text {integral}& = x \coth ^{-1}(\tan (a+b x))-b \int x \sec (2 a+2 b x) \, dx \\ & = x \coth ^{-1}(\tan (a+b x))+i x \arctan \left (e^{2 i (a+b x)}\right )+\frac {1}{2} \int \log \left (1-i e^{i (2 a+2 b x)}\right ) \, dx-\frac {1}{2} \int \log \left (1+i e^{i (2 a+2 b x)}\right ) \, dx \\ & = x \coth ^{-1}(\tan (a+b x))+i x \arctan \left (e^{2 i (a+b x)}\right )-\frac {i \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i (2 a+2 b x)}\right )}{4 b}+\frac {i \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i (2 a+2 b x)}\right )}{4 b} \\ & = x \coth ^{-1}(\tan (a+b x))+i x \arctan \left (e^{2 i (a+b x)}\right )-\frac {i \operatorname {PolyLog}\left (2,-i e^{2 i (a+b x)}\right )}{4 b}+\frac {i \operatorname {PolyLog}\left (2,i e^{2 i (a+b x)}\right )}{4 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.61 \[ \int \coth ^{-1}(\tan (a+b x)) \, dx=x \coth ^{-1}(\tan (a+b x))-\frac {(-4 a+\pi -4 b x) \left (\log \left (1-i e^{-2 i (a+b x)}\right )-\log \left (1+i e^{-2 i (a+b x)}\right )\right )-(-4 a+\pi ) \log \left (\cot \left (a+\frac {\pi }{4}+b x\right )\right )+2 i \left (\operatorname {PolyLog}\left (2,-i e^{-2 i (a+b x)}\right )-\operatorname {PolyLog}\left (2,i e^{-2 i (a+b x)}\right )\right )}{8 b} \]

[In]

Integrate[ArcCoth[Tan[a + b*x]],x]

[Out]

x*ArcCoth[Tan[a + b*x]] - ((-4*a + Pi - 4*b*x)*(Log[1 - I/E^((2*I)*(a + b*x))] - Log[1 + I/E^((2*I)*(a + b*x))
]) - (-4*a + Pi)*Log[Cot[a + Pi/4 + b*x]] + (2*I)*(PolyLog[2, (-I)/E^((2*I)*(a + b*x))] - PolyLog[2, I/E^((2*I
)*(a + b*x))]))/(8*b)

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 168 vs. \(2 (64 ) = 128\).

Time = 1.06 (sec) , antiderivative size = 169, normalized size of antiderivative = 2.14

method result size
derivativedivides \(\frac {\arctan \left (\tan \left (b x +a \right )\right ) \operatorname {arccoth}\left (\tan \left (b x +a \right )\right )+\frac {\arctan \left (\tan \left (b x +a \right )\right ) \ln \left (1+\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan \left (b x +a \right )^{2}}\right )}{2}-\frac {\arctan \left (\tan \left (b x +a \right )\right ) \ln \left (1-\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan \left (b x +a \right )^{2}}\right )}{2}-\frac {i \operatorname {dilog}\left (1+\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan \left (b x +a \right )^{2}}\right )}{4}+\frac {i \operatorname {dilog}\left (1-\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan \left (b x +a \right )^{2}}\right )}{4}}{b}\) \(169\)
default \(\frac {\arctan \left (\tan \left (b x +a \right )\right ) \operatorname {arccoth}\left (\tan \left (b x +a \right )\right )+\frac {\arctan \left (\tan \left (b x +a \right )\right ) \ln \left (1+\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan \left (b x +a \right )^{2}}\right )}{2}-\frac {\arctan \left (\tan \left (b x +a \right )\right ) \ln \left (1-\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan \left (b x +a \right )^{2}}\right )}{2}-\frac {i \operatorname {dilog}\left (1+\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan \left (b x +a \right )^{2}}\right )}{4}+\frac {i \operatorname {dilog}\left (1-\frac {i \left (1+i \tan \left (b x +a \right )\right )^{2}}{1+\tan \left (b x +a \right )^{2}}\right )}{4}}{b}\) \(169\)
risch \(\text {Expression too large to display}\) \(1161\)

[In]

int(arccoth(tan(b*x+a)),x,method=_RETURNVERBOSE)

[Out]

1/b*(arctan(tan(b*x+a))*arccoth(tan(b*x+a))+1/2*arctan(tan(b*x+a))*ln(1+I*(1+I*tan(b*x+a))^2/(1+tan(b*x+a)^2))
-1/2*arctan(tan(b*x+a))*ln(1-I*(1+I*tan(b*x+a))^2/(1+tan(b*x+a)^2))-1/4*I*dilog(1+I*(1+I*tan(b*x+a))^2/(1+tan(
b*x+a)^2))+1/4*I*dilog(1-I*(1+I*tan(b*x+a))^2/(1+tan(b*x+a)^2)))

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. 498 vs. \(2 (57) = 114\).

Time = 0.28 (sec) , antiderivative size = 498, normalized size of antiderivative = 6.30 \[ \int \coth ^{-1}(\tan (a+b x)) \, dx=\frac {4 \, b x \log \left (\frac {\tan \left (b x + a\right ) + 1}{\tan \left (b x + a\right ) - 1}\right ) - 2 \, {\left (b x + a\right )} \log \left (\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} + 2 \, \tan \left (b x + a\right ) - i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, a \log \left (\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} + 2 i \, \tan \left (b x + a\right ) + i - 1}{\tan \left (b x + a\right )^{2} + 1}\right ) - 2 \, a \log \left (\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} - 2 i \, \tan \left (b x + a\right ) + i - 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, {\left (b x + a\right )} \log \left (\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} - 2 \, \tan \left (b x + a\right ) - i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) - 2 \, {\left (b x + a\right )} \log \left (\frac {-\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} + 2 \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, {\left (b x + a\right )} \log \left (\frac {-\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} - 2 \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, a \log \left (\frac {\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} + 2 i \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) - 2 \, a \log \left (\frac {\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} - 2 i \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + i \, {\rm Li}_2\left (-\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} + 2 \, \tan \left (b x + a\right ) - i + 1}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) + i \, {\rm Li}_2\left (-\frac {\left (i + 1\right ) \, \tan \left (b x + a\right )^{2} - 2 \, \tan \left (b x + a\right ) - i + 1}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - i \, {\rm Li}_2\left (-\frac {-\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} + 2 \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - i \, {\rm Li}_2\left (-\frac {-\left (i - 1\right ) \, \tan \left (b x + a\right )^{2} - 2 \, \tan \left (b x + a\right ) + i + 1}{\tan \left (b x + a\right )^{2} + 1} + 1\right )}{8 \, b} \]

[In]

integrate(arccoth(tan(b*x+a)),x, algorithm="fricas")

[Out]

1/8*(4*b*x*log((tan(b*x + a) + 1)/(tan(b*x + a) - 1)) - 2*(b*x + a)*log(((I + 1)*tan(b*x + a)^2 + 2*tan(b*x +
a) - I + 1)/(tan(b*x + a)^2 + 1)) + 2*a*log(((I + 1)*tan(b*x + a)^2 + 2*I*tan(b*x + a) + I - 1)/(tan(b*x + a)^
2 + 1)) - 2*a*log(((I + 1)*tan(b*x + a)^2 - 2*I*tan(b*x + a) + I - 1)/(tan(b*x + a)^2 + 1)) + 2*(b*x + a)*log(
((I + 1)*tan(b*x + a)^2 - 2*tan(b*x + a) - I + 1)/(tan(b*x + a)^2 + 1)) - 2*(b*x + a)*log((-(I - 1)*tan(b*x +
a)^2 + 2*tan(b*x + a) + I + 1)/(tan(b*x + a)^2 + 1)) + 2*(b*x + a)*log((-(I - 1)*tan(b*x + a)^2 - 2*tan(b*x +
a) + I + 1)/(tan(b*x + a)^2 + 1)) + 2*a*log(((I - 1)*tan(b*x + a)^2 + 2*I*tan(b*x + a) + I + 1)/(tan(b*x + a)^
2 + 1)) - 2*a*log(((I - 1)*tan(b*x + a)^2 - 2*I*tan(b*x + a) + I + 1)/(tan(b*x + a)^2 + 1)) + I*dilog(-((I + 1
)*tan(b*x + a)^2 + 2*tan(b*x + a) - I + 1)/(tan(b*x + a)^2 + 1) + 1) + I*dilog(-((I + 1)*tan(b*x + a)^2 - 2*ta
n(b*x + a) - I + 1)/(tan(b*x + a)^2 + 1) + 1) - I*dilog(-(-(I - 1)*tan(b*x + a)^2 + 2*tan(b*x + a) + I + 1)/(t
an(b*x + a)^2 + 1) + 1) - I*dilog(-(-(I - 1)*tan(b*x + a)^2 - 2*tan(b*x + a) + I + 1)/(tan(b*x + a)^2 + 1) + 1
))/b

Sympy [F]

\[ \int \coth ^{-1}(\tan (a+b x)) \, dx=\int \operatorname {acoth}{\left (\tan {\left (a + b x \right )} \right )}\, dx \]

[In]

integrate(acoth(tan(b*x+a)),x)

[Out]

Integral(acoth(tan(a + b*x)), x)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 182 vs. \(2 (57) = 114\).

Time = 0.34 (sec) , antiderivative size = 182, normalized size of antiderivative = 2.30 \[ \int \coth ^{-1}(\tan (a+b x)) \, dx=\frac {4 \, {\left (b x + a\right )} \operatorname {arcoth}\left (\tan \left (b x + a\right )\right ) + {\left (\arctan \left (\frac {1}{2} \, \tan \left (b x + a\right ) + \frac {1}{2}, \frac {1}{2} \, \tan \left (b x + a\right ) + \frac {1}{2}\right ) - \arctan \left (\frac {1}{2} \, \tan \left (b x + a\right ) - \frac {1}{2}, -\frac {1}{2} \, \tan \left (b x + a\right ) + \frac {1}{2}\right )\right )} \log \left (\tan \left (b x + a\right )^{2} + 1\right ) - {\left (b x + a\right )} \log \left (\frac {1}{2} \, \tan \left (b x + a\right )^{2} + \tan \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b x + a\right )} \log \left (\frac {1}{2} \, \tan \left (b x + a\right )^{2} - \tan \left (b x + a\right ) + \frac {1}{2}\right ) - i \, {\rm Li}_2\left (\left (\frac {1}{2} i + \frac {1}{2}\right ) \, \tan \left (b x + a\right ) - \frac {1}{2} i + \frac {1}{2}\right ) + i \, {\rm Li}_2\left (-\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \tan \left (b x + a\right ) + \frac {1}{2} i + \frac {1}{2}\right ) + i \, {\rm Li}_2\left (\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \tan \left (b x + a\right ) + \frac {1}{2} i + \frac {1}{2}\right ) - i \, {\rm Li}_2\left (-\left (\frac {1}{2} i + \frac {1}{2}\right ) \, \tan \left (b x + a\right ) - \frac {1}{2} i + \frac {1}{2}\right )}{4 \, b} \]

[In]

integrate(arccoth(tan(b*x+a)),x, algorithm="maxima")

[Out]

1/4*(4*(b*x + a)*arccoth(tan(b*x + a)) + (arctan2(1/2*tan(b*x + a) + 1/2, 1/2*tan(b*x + a) + 1/2) - arctan2(1/
2*tan(b*x + a) - 1/2, -1/2*tan(b*x + a) + 1/2))*log(tan(b*x + a)^2 + 1) - (b*x + a)*log(1/2*tan(b*x + a)^2 + t
an(b*x + a) + 1/2) + (b*x + a)*log(1/2*tan(b*x + a)^2 - tan(b*x + a) + 1/2) - I*dilog((1/2*I + 1/2)*tan(b*x +
a) - 1/2*I + 1/2) + I*dilog(-(1/2*I - 1/2)*tan(b*x + a) + 1/2*I + 1/2) + I*dilog((1/2*I - 1/2)*tan(b*x + a) +
1/2*I + 1/2) - I*dilog(-(1/2*I + 1/2)*tan(b*x + a) - 1/2*I + 1/2))/b

Giac [F]

\[ \int \coth ^{-1}(\tan (a+b x)) \, dx=\int { \operatorname {arcoth}\left (\tan \left (b x + a\right )\right ) \,d x } \]

[In]

integrate(arccoth(tan(b*x+a)),x, algorithm="giac")

[Out]

integrate(arccoth(tan(b*x + a)), x)

Mupad [F(-1)]

Timed out. \[ \int \coth ^{-1}(\tan (a+b x)) \, dx=\int \mathrm {acoth}\left (\mathrm {tan}\left (a+b\,x\right )\right ) \,d x \]

[In]

int(acoth(tan(a + b*x)),x)

[Out]

int(acoth(tan(a + b*x)), x)