\(\int \cot ^{-1}(e^x) \, dx\) [218]

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

Optimal result

Integrand size = 4, antiderivative size = 35 \[ \int \cot ^{-1}\left (e^x\right ) \, dx=-\frac {1}{2} i \operatorname {PolyLog}\left (2,-i e^{-x}\right )+\frac {1}{2} i \operatorname {PolyLog}\left (2,i e^{-x}\right ) \]

[Out]

-1/2*I*polylog(2,-I/exp(x))+1/2*I*polylog(2,I/exp(x))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.750, Rules used = {2320, 4941, 2438} \[ \int \cot ^{-1}\left (e^x\right ) \, dx=\frac {1}{2} i \operatorname {PolyLog}\left (2,i e^{-x}\right )-\frac {1}{2} i \operatorname {PolyLog}\left (2,-i e^{-x}\right ) \]

[In]

Int[ArcCot[E^x],x]

[Out]

(-1/2*I)*PolyLog[2, (-I)/E^x] + (I/2)*PolyLog[2, I/E^x]

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

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 4941

Int[((a_.) + ArcCot[(c_.)*(x_)]*(b_.))/(x_), x_Symbol] :> Simp[a*Log[x], x] + (-Dist[I*(b/2), Int[Log[1 + I/(c
*x)]/x, x], x] + Dist[I*(b/2), Int[Log[1 - I/(c*x)]/x, x], x]) /; FreeQ[{a, b, c}, x]

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

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.69 \[ \int \cot ^{-1}\left (e^x\right ) \, dx=x \cot ^{-1}\left (e^x\right )+\frac {1}{2} i \left (x \left (\log \left (1-i e^x\right )-\log \left (1+i e^x\right )\right )-\operatorname {PolyLog}\left (2,-i e^x\right )+\operatorname {PolyLog}\left (2,i e^x\right )\right ) \]

[In]

Integrate[ArcCot[E^x],x]

[Out]

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

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 52 vs. \(2 (25 ) = 50\).

Time = 0.82 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.51

method result size
parts \(x \,\operatorname {arccot}\left ({\mathrm e}^{x}\right )-\frac {i x \ln \left (1+i {\mathrm e}^{x}\right )}{2}+\frac {i x \ln \left (1-i {\mathrm e}^{x}\right )}{2}-\frac {i \operatorname {dilog}\left (1+i {\mathrm e}^{x}\right )}{2}+\frac {i \operatorname {dilog}\left (1-i {\mathrm e}^{x}\right )}{2}\) \(53\)
derivativedivides \(\ln \left ({\mathrm e}^{x}\right ) \operatorname {arccot}\left ({\mathrm e}^{x}\right )-\frac {i \ln \left ({\mathrm e}^{x}\right ) \ln \left (1+i {\mathrm e}^{x}\right )}{2}+\frac {i \ln \left ({\mathrm e}^{x}\right ) \ln \left (1-i {\mathrm e}^{x}\right )}{2}-\frac {i \operatorname {dilog}\left (1+i {\mathrm e}^{x}\right )}{2}+\frac {i \operatorname {dilog}\left (1-i {\mathrm e}^{x}\right )}{2}\) \(59\)
default \(\ln \left ({\mathrm e}^{x}\right ) \operatorname {arccot}\left ({\mathrm e}^{x}\right )-\frac {i \ln \left ({\mathrm e}^{x}\right ) \ln \left (1+i {\mathrm e}^{x}\right )}{2}+\frac {i \ln \left ({\mathrm e}^{x}\right ) \ln \left (1-i {\mathrm e}^{x}\right )}{2}-\frac {i \operatorname {dilog}\left (1+i {\mathrm e}^{x}\right )}{2}+\frac {i \operatorname {dilog}\left (1-i {\mathrm e}^{x}\right )}{2}\) \(59\)
risch \(\frac {i x \ln \left (1+i {\mathrm e}^{x}\right )}{2}+\frac {\pi x}{2}+\frac {i \operatorname {dilog}\left (1-i {\mathrm e}^{x}\right )}{2}+\frac {i \ln \left (-i {\mathrm e}^{x}\right ) \ln \left (-i \left (-{\mathrm e}^{x}+i\right )\right )}{2}-\frac {i \ln \left (-i \left (-{\mathrm e}^{x}+i\right )\right ) x}{2}+\frac {i \operatorname {dilog}\left (-i {\mathrm e}^{x}\right )}{2}\) \(73\)

[In]

int(arccot(exp(x)),x,method=_RETURNVERBOSE)

[Out]

x*arccot(exp(x))-1/2*I*x*ln(1+I*exp(x))+1/2*I*x*ln(1-I*exp(x))-1/2*I*dilog(1+I*exp(x))+1/2*I*dilog(1-I*exp(x))

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. 40 vs. \(2 (19) = 38\).

Time = 0.28 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.14 \[ \int \cot ^{-1}\left (e^x\right ) \, dx=x \operatorname {arccot}\left (e^{x}\right ) - \frac {1}{2} i \, x \log \left (i \, e^{x} + 1\right ) + \frac {1}{2} i \, x \log \left (-i \, e^{x} + 1\right ) + \frac {1}{2} i \, {\rm Li}_2\left (i \, e^{x}\right ) - \frac {1}{2} i \, {\rm Li}_2\left (-i \, e^{x}\right ) \]

[In]

integrate(arccot(exp(x)),x, algorithm="fricas")

[Out]

x*arccot(e^x) - 1/2*I*x*log(I*e^x + 1) + 1/2*I*x*log(-I*e^x + 1) + 1/2*I*dilog(I*e^x) - 1/2*I*dilog(-I*e^x)

Sympy [F]

\[ \int \cot ^{-1}\left (e^x\right ) \, dx=\int \operatorname {acot}{\left (e^{x} \right )}\, dx \]

[In]

integrate(acot(exp(x)),x)

[Out]

Integral(acot(exp(x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.97 \[ \int \cot ^{-1}\left (e^x\right ) \, dx=x \operatorname {arccot}\left (e^{x}\right ) + \frac {1}{4} \, \pi \log \left (e^{\left (2 \, x\right )} + 1\right ) + \frac {1}{2} i \, {\rm Li}_2\left (i \, e^{x} + 1\right ) - \frac {1}{2} i \, {\rm Li}_2\left (-i \, e^{x} + 1\right ) \]

[In]

integrate(arccot(exp(x)),x, algorithm="maxima")

[Out]

x*arccot(e^x) + 1/4*pi*log(e^(2*x) + 1) + 1/2*I*dilog(I*e^x + 1) - 1/2*I*dilog(-I*e^x + 1)

Giac [F]

\[ \int \cot ^{-1}\left (e^x\right ) \, dx=\int { \operatorname {arccot}\left (e^{x}\right ) \,d x } \]

[In]

integrate(arccot(exp(x)),x, algorithm="giac")

[Out]

integrate(arccot(e^x), x)

Mupad [F(-1)]

Timed out. \[ \int \cot ^{-1}\left (e^x\right ) \, dx=\int \mathrm {acot}\left ({\mathrm {e}}^x\right ) \,d x \]

[In]

int(acot(exp(x)),x)

[Out]

int(acot(exp(x)), x)