\(\int e^x \coth (2 x) \, dx\) [216]

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

Optimal result

Integrand size = 8, antiderivative size = 16 \[ \int e^x \coth (2 x) \, dx=e^x-\arctan \left (e^x\right )-\text {arctanh}\left (e^x\right ) \]

[Out]

exp(x)-arctan(exp(x))-arctanh(exp(x))

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, 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.625, Rules used = {2320, 396, 218, 212, 209} \[ \int e^x \coth (2 x) \, dx=-\arctan \left (e^x\right )-\text {arctanh}\left (e^x\right )+e^x \]

[In]

Int[E^x*Coth[2*x],x]

[Out]

E^x - ArcTan[E^x] - ArcTanh[E^x]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 218

Int[((a_) + (b_.)*(x_)^4)^(-1), x_Symbol] :> With[{r = Numerator[Rt[-a/b, 2]], s = Denominator[Rt[-a/b, 2]]},
Dist[r/(2*a), Int[1/(r - s*x^2), x], x] + Dist[r/(2*a), Int[1/(r + s*x^2), x], x]] /; FreeQ[{a, b}, x] &&  !Gt
Q[a/b, 0]

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

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]]]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {-1-x^4}{1-x^4} \, dx,x,e^x\right ) \\ & = e^x-2 \text {Subst}\left (\int \frac {1}{1-x^4} \, dx,x,e^x\right ) \\ & = e^x-\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,e^x\right )-\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,e^x\right ) \\ & = e^x-\arctan \left (e^x\right )-\text {arctanh}\left (e^x\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00 \[ \int e^x \coth (2 x) \, dx=e^x-\arctan \left (e^x\right )-\text {arctanh}\left (e^x\right ) \]

[In]

Integrate[E^x*Coth[2*x],x]

[Out]

E^x - ArcTan[E^x] - ArcTanh[E^x]

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.14 (sec) , antiderivative size = 36, normalized size of antiderivative = 2.25

method result size
risch \({\mathrm e}^{x}-\frac {\ln \left ({\mathrm e}^{x}+1\right )}{2}+\frac {\ln \left ({\mathrm e}^{x}-1\right )}{2}+\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{2}-\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{2}\) \(36\)

[In]

int(exp(x)*coth(2*x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 31 vs. \(2 (13) = 26\).

Time = 0.26 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.94 \[ \int e^x \coth (2 x) \, dx=-\arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + \cosh \left (x\right ) - \frac {1}{2} \, \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) + \frac {1}{2} \, \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right ) + \sinh \left (x\right ) \]

[In]

integrate(exp(x)*coth(2*x),x, algorithm="fricas")

[Out]

-arctan(cosh(x) + sinh(x)) + cosh(x) - 1/2*log(cosh(x) + sinh(x) + 1) + 1/2*log(cosh(x) + sinh(x) - 1) + sinh(
x)

Sympy [F]

\[ \int e^x \coth (2 x) \, dx=\int e^{x} \coth {\left (2 x \right )}\, dx \]

[In]

integrate(exp(x)*coth(2*x),x)

[Out]

Integral(exp(x)*coth(2*x), x)

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.38 \[ \int e^x \coth (2 x) \, dx=-\arctan \left (e^{x}\right ) + e^{x} - \frac {1}{2} \, \log \left (e^{x} + 1\right ) + \frac {1}{2} \, \log \left (e^{x} - 1\right ) \]

[In]

integrate(exp(x)*coth(2*x),x, algorithm="maxima")

[Out]

-arctan(e^x) + e^x - 1/2*log(e^x + 1) + 1/2*log(e^x - 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.44 \[ \int e^x \coth (2 x) \, dx=-\arctan \left (e^{x}\right ) + e^{x} - \frac {1}{2} \, \log \left (e^{x} + 1\right ) + \frac {1}{2} \, \log \left ({\left | e^{x} - 1 \right |}\right ) \]

[In]

integrate(exp(x)*coth(2*x),x, algorithm="giac")

[Out]

-arctan(e^x) + e^x - 1/2*log(e^x + 1) + 1/2*log(abs(e^x - 1))

Mupad [B] (verification not implemented)

Time = 1.78 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.62 \[ \int e^x \coth (2 x) \, dx=\frac {\ln \left (2-2\,{\mathrm {e}}^x\right )}{2}-\frac {\ln \left (-2\,{\mathrm {e}}^x-2\right )}{2}-\mathrm {atan}\left ({\mathrm {e}}^x\right )+{\mathrm {e}}^x \]

[In]

int(coth(2*x)*exp(x),x)

[Out]

log(2 - 2*exp(x))/2 - log(- 2*exp(x) - 2)/2 - atan(exp(x)) + exp(x)