\(\int e^{-x} \tanh (x) \, dx\) [169]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (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 = 12 \[ \int e^{-x} \tanh (x) \, dx=e^{-x}+2 \arctan \left (e^x\right ) \]

[Out]

exp(-x)+2*arctan(exp(x))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {2320, 464, 209} \[ \int e^{-x} \tanh (x) \, dx=2 \arctan \left (e^x\right )+e^{-x} \]

[In]

Int[Tanh[x]/E^x,x]

[Out]

E^(-x) + 2*ArcTan[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 464

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[c*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(a*e*(m + 1))), x] + Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(a*e^n*(m + 1)), In
t[(e*x)^(m + n)*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && (IntegerQ[n] ||
GtQ[e, 0]) && ((GtQ[n, 0] && LtQ[m, -1]) || (LtQ[n, 0] && GtQ[m + n, -1])) &&  !ILtQ[p, -1]

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^2}{x^2 \left (1+x^2\right )} \, dx,x,e^x\right ) \\ & = e^{-x}+2 \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,e^x\right ) \\ & = e^{-x}+2 \arctan \left (e^x\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int e^{-x} \tanh (x) \, dx=e^{-x}+2 \arctan \left (e^x\right ) \]

[In]

Integrate[Tanh[x]/E^x,x]

[Out]

E^(-x) + 2*ArcTan[E^x]

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.58

method result size
default \(\frac {2}{\tanh \left (\frac {x}{2}\right )+1}+2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )\) \(19\)
risch \({\mathrm e}^{-x}+i \ln \left ({\mathrm e}^{x}+i\right )-i \ln \left ({\mathrm e}^{x}-i\right )\) \(24\)

[In]

int(tanh(x)/exp(x),x,method=_RETURNVERBOSE)

[Out]

2/(tanh(1/2*x)+1)+2*arctan(tanh(1/2*x))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 23 vs. \(2 (10) = 20\).

Time = 0.24 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.92 \[ \int e^{-x} \tanh (x) \, dx=\frac {2 \, {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + 1}{\cosh \left (x\right ) + \sinh \left (x\right )} \]

[In]

integrate(tanh(x)/exp(x),x, algorithm="fricas")

[Out]

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

Sympy [F]

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

[In]

integrate(tanh(x)/exp(x),x)

[Out]

Integral(exp(-x)*tanh(x), x)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int e^{-x} \tanh (x) \, dx=-2 \, \arctan \left (e^{\left (-x\right )}\right ) + e^{\left (-x\right )} \]

[In]

integrate(tanh(x)/exp(x),x, algorithm="maxima")

[Out]

-2*arctan(e^(-x)) + e^(-x)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.83 \[ \int e^{-x} \tanh (x) \, dx=2 \, \arctan \left (e^{x}\right ) + e^{\left (-x\right )} \]

[In]

integrate(tanh(x)/exp(x),x, algorithm="giac")

[Out]

2*arctan(e^x) + e^(-x)

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int e^{-x} \tanh (x) \, dx={\mathrm {e}}^{-x}-2\,\mathrm {atan}\left ({\mathrm {e}}^{-x}\right ) \]

[In]

int(exp(-x)*tanh(x),x)

[Out]

exp(-x) - 2*atan(exp(-x))