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

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

Optimal result

Integrand size = 15, antiderivative size = 79 \[ \int \cot ^{-1}(c+(i+c) \tanh (a+b x)) \, dx=\frac {1}{2} i b x^2+x \cot ^{-1}(c+(i+c) \tanh (a+b x))-\frac {1}{2} i x \log \left (1+i c e^{2 a+2 b x}\right )-\frac {i \operatorname {PolyLog}\left (2,-i c e^{2 a+2 b x}\right )}{4 b} \]

[Out]

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

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5296, 2215, 2221, 2317, 2438} \[ \int \cot ^{-1}(c+(i+c) \tanh (a+b x)) \, dx=-\frac {i \operatorname {PolyLog}\left (2,-i c e^{2 a+2 b x}\right )}{4 b}-\frac {1}{2} i x \log \left (1+i c e^{2 a+2 b x}\right )+x \cot ^{-1}(c+(c+i) \tanh (a+b x))+\frac {1}{2} i b x^2 \]

[In]

Int[ArcCot[c + (I + c)*Tanh[a + b*x]],x]

[Out]

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

Rule 2215

Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[(c
+ d*x)^(m + 1)/(a*d*(m + 1)), x] - Dist[b/a, Int[(c + d*x)^m*((F^(g*(e + f*x)))^n/(a + b*(F^(g*(e + f*x)))^n))
, x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

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 5296

Int[ArcCot[(c_.) + (d_.)*Tanh[(a_.) + (b_.)*(x_)]], x_Symbol] :> Simp[x*ArcCot[c + d*Tanh[a + b*x]], x] + Dist
[b, Int[x/(c - d + c*E^(2*a + 2*b*x)), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[(c - d)^2, -1]

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

Mathematica [A] (verified)

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

[In]

Integrate[ArcCot[c + (I + c)*Tanh[a + b*x]],x]

[Out]

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

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 543 vs. \(2 (65 ) = 130\).

Time = 1.83 (sec) , antiderivative size = 544, normalized size of antiderivative = 6.89

method result size
derivativedivides \(\frac {-\frac {\operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right )}{2 i+2 c}+\frac {2 i \operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) c}{2 i+2 c}+\frac {\operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) c^{2}}{2 i+2 c}+\frac {\operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \tanh \left (b x +a \right )+i\right )}{2 i+2 c}-\frac {2 i \operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \tanh \left (b x +a \right )+i\right ) c}{2 i+2 c}-\frac {\operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \tanh \left (b x +a \right )+i\right ) c^{2}}{2 i+2 c}+\left (i+c \right )^{2} \left (\frac {-\frac {i \left (\left (\ln \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right )-\ln \left (-\frac {i \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right )}{2}\right )\right ) \ln \left (-\frac {i \left (i-c -\left (i+c \right ) \tanh \left (b x +a \right )\right )}{2}\right )-\operatorname {dilog}\left (-\frac {i \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right )}{2}\right )\right )}{2}+\frac {i \ln \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right )^{2}}{4}}{2 i+2 c}-\frac {-\frac {i \left (\operatorname {dilog}\left (-\frac {i-c -\left (i+c \right ) \tanh \left (b x +a \right )}{2 c}\right )+\ln \left (c -\left (i+c \right ) \tanh \left (b x +a \right )+i\right ) \ln \left (-\frac {i-c -\left (i+c \right ) \tanh \left (b x +a \right )}{2 c}\right )\right )}{2}+\frac {i \left (\operatorname {dilog}\left (\frac {-i-c -\left (i+c \right ) \tanh \left (b x +a \right )}{-2 i-2 c}\right )+\ln \left (c -\left (i+c \right ) \tanh \left (b x +a \right )+i\right ) \ln \left (\frac {-i-c -\left (i+c \right ) \tanh \left (b x +a \right )}{-2 i-2 c}\right )\right )}{2}}{2 \left (i+c \right )}\right )}{b \left (i+c \right )}\) \(544\)
default \(\frac {-\frac {\operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right )}{2 i+2 c}+\frac {2 i \operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) c}{2 i+2 c}+\frac {\operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) c^{2}}{2 i+2 c}+\frac {\operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \tanh \left (b x +a \right )+i\right )}{2 i+2 c}-\frac {2 i \operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \tanh \left (b x +a \right )+i\right ) c}{2 i+2 c}-\frac {\operatorname {arccot}\left (c +\left (i+c \right ) \tanh \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \tanh \left (b x +a \right )+i\right ) c^{2}}{2 i+2 c}+\left (i+c \right )^{2} \left (\frac {-\frac {i \left (\left (\ln \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right )-\ln \left (-\frac {i \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right )}{2}\right )\right ) \ln \left (-\frac {i \left (i-c -\left (i+c \right ) \tanh \left (b x +a \right )\right )}{2}\right )-\operatorname {dilog}\left (-\frac {i \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right )}{2}\right )\right )}{2}+\frac {i \ln \left (i+c +\left (i+c \right ) \tanh \left (b x +a \right )\right )^{2}}{4}}{2 i+2 c}-\frac {-\frac {i \left (\operatorname {dilog}\left (-\frac {i-c -\left (i+c \right ) \tanh \left (b x +a \right )}{2 c}\right )+\ln \left (c -\left (i+c \right ) \tanh \left (b x +a \right )+i\right ) \ln \left (-\frac {i-c -\left (i+c \right ) \tanh \left (b x +a \right )}{2 c}\right )\right )}{2}+\frac {i \left (\operatorname {dilog}\left (\frac {-i-c -\left (i+c \right ) \tanh \left (b x +a \right )}{-2 i-2 c}\right )+\ln \left (c -\left (i+c \right ) \tanh \left (b x +a \right )+i\right ) \ln \left (\frac {-i-c -\left (i+c \right ) \tanh \left (b x +a \right )}{-2 i-2 c}\right )\right )}{2}}{2 \left (i+c \right )}\right )}{b \left (i+c \right )}\) \(544\)
risch \(\text {Expression too large to display}\) \(1217\)

[In]

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

[Out]

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

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. 186 vs. \(2 (58) = 116\).

Time = 0.27 (sec) , antiderivative size = 186, normalized size of antiderivative = 2.35 \[ \int \cot ^{-1}(c+(i+c) \tanh (a+b x)) \, dx=\frac {i \, b^{2} x^{2} + i \, b x \log \left (\frac {{\left (c e^{\left (2 \, b x + 2 \, a\right )} - i\right )} e^{\left (-2 \, b x - 2 \, a\right )}}{c + i}\right ) - i \, a^{2} + {\left (-i \, b x - i \, a\right )} \log \left (\frac {1}{2} \, \sqrt {-4 i \, c} e^{\left (b x + a\right )} + 1\right ) + {\left (-i \, b x - i \, a\right )} \log \left (-\frac {1}{2} \, \sqrt {-4 i \, c} e^{\left (b x + a\right )} + 1\right ) + i \, a \log \left (\frac {2 \, c e^{\left (b x + a\right )} + i \, \sqrt {-4 i \, c}}{2 \, c}\right ) + i \, a \log \left (\frac {2 \, c e^{\left (b x + a\right )} - i \, \sqrt {-4 i \, c}}{2 \, c}\right ) - i \, {\rm Li}_2\left (\frac {1}{2} \, \sqrt {-4 i \, c} e^{\left (b x + a\right )}\right ) - i \, {\rm Li}_2\left (-\frac {1}{2} \, \sqrt {-4 i \, c} e^{\left (b x + a\right )}\right )}{2 \, b} \]

[In]

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

[Out]

1/2*(I*b^2*x^2 + I*b*x*log((c*e^(2*b*x + 2*a) - I)*e^(-2*b*x - 2*a)/(c + I)) - I*a^2 + (-I*b*x - I*a)*log(1/2*
sqrt(-4*I*c)*e^(b*x + a) + 1) + (-I*b*x - I*a)*log(-1/2*sqrt(-4*I*c)*e^(b*x + a) + 1) + I*a*log(1/2*(2*c*e^(b*
x + a) + I*sqrt(-4*I*c))/c) + I*a*log(1/2*(2*c*e^(b*x + a) - I*sqrt(-4*I*c))/c) - I*dilog(1/2*sqrt(-4*I*c)*e^(
b*x + a)) - I*dilog(-1/2*sqrt(-4*I*c)*e^(b*x + a)))/b

Sympy [F(-2)]

Exception generated. \[ \int \cot ^{-1}(c+(i+c) \tanh (a+b x)) \, dx=\text {Exception raised: CoercionFailed} \]

[In]

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

[Out]

Exception raised: CoercionFailed >> Cannot convert 2*_t0**4*c**2*exp(4*a) + _t0**4*I*c*exp(4*a) - 3*_t0**2*I*c
*exp(2*a) + _t0**2*exp(2*a) - 1 of type <class 'sympy.core.add.Add'> to QQ_I[b,c,_t0,exp(a)]

Maxima [A] (verification not implemented)

none

Time = 1.31 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.01 \[ \int \cot ^{-1}(c+(i+c) \tanh (a+b x)) \, dx=-2 \, b {\left (c + i\right )} {\left (\frac {2 \, x^{2}}{2 i \, c - 2} - \frac {2 \, b x \log \left (i \, c e^{\left (2 \, b x + 2 \, a\right )} + 1\right ) + {\rm Li}_2\left (-i \, c e^{\left (2 \, b x + 2 \, a\right )}\right )}{-2 \, b^{2} {\left (-i \, c + 1\right )}}\right )} + x \operatorname {arccot}\left ({\left (c + i\right )} \tanh \left (b x + a\right ) + c\right ) \]

[In]

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

[Out]

-2*b*(c + I)*(2*x^2/(2*I*c - 2) - (2*b*x*log(I*c*e^(2*b*x + 2*a) + 1) + dilog(-I*c*e^(2*b*x + 2*a)))/(b^2*(2*I
*c - 2))) + x*arccot((c + I)*tanh(b*x + a) + c)

Giac [F]

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

int(acot(c + tanh(a + b*x)*(c + 1i)),x)

[Out]

int(acot(c + tanh(a + b*x)*(c + 1i)), x)