\(\int \frac {\sqrt {1+e^{-x}}}{-e^{-x}+e^x} \, dx\) [19]

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

Optimal result

Integrand size = 25, antiderivative size = 25 \[ \int \frac {\sqrt {1+e^{-x}}}{-e^{-x}+e^x} \, dx=-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {1+e^{-x}}}{\sqrt {2}}\right ) \]

[Out]

-arctanh(1/2*(1+exp(-x))^(1/2)*2^(1/2))*2^(1/2)

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {2320, 1460, 1483, 641, 65, 212} \[ \int \frac {\sqrt {1+e^{-x}}}{-e^{-x}+e^x} \, dx=-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {e^{-x}+1}}{\sqrt {2}}\right ) \]

[In]

Int[Sqrt[1 + E^(-x)]/(-E^(-x) + E^x),x]

[Out]

-(Sqrt[2]*ArcTanh[Sqrt[1 + E^(-x)]/Sqrt[2]])

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

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 641

Int[((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m + p)*(a/d + (c/e)*x)^
p, x] /; FreeQ[{a, c, d, e, m, p}, x] && EqQ[c*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && I
ntegerQ[m + p]))

Rule 1460

Int[((a_.) + (c_.)*(x_)^(mn2_.))^(p_.)*((d_) + (e_.)*(x_)^(n_.))^(q_.), x_Symbol] :> Int[((d + e*x^n)^q*(c + a
*x^(2*n))^p)/x^(2*n*p), x] /; FreeQ[{a, c, d, e, n, q}, x] && EqQ[mn2, -2*n] && IntegerQ[p]

Rule 1483

Int[(x_)^(m_.)*((a_) + (c_.)*(x_)^(n2_.))^(p_.)*((d_) + (e_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[I
nt[(d + e*x)^q*(a + c*x^2)^p, x], x, x^n], x] /; FreeQ[{a, c, d, e, m, n, p, q}, x] && EqQ[n2, 2*n] && EqQ[Sim
plify[m - n + 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 {\sqrt {1+\frac {1}{x}}}{-1+x^2} \, dx,x,e^x\right ) \\ & = \text {Subst}\left (\int \frac {\sqrt {1+\frac {1}{x}}}{\left (1-\frac {1}{x^2}\right ) x^2} \, dx,x,e^x\right ) \\ & = -\text {Subst}\left (\int \frac {\sqrt {1+x}}{1-x^2} \, dx,x,e^{-x}\right ) \\ & = -\text {Subst}\left (\int \frac {1}{(1-x) \sqrt {1+x}} \, dx,x,e^{-x}\right ) \\ & = -\left (2 \text {Subst}\left (\int \frac {1}{2-x^2} \, dx,x,\sqrt {1+e^{-x}}\right )\right ) \\ & = -\sqrt {2} \text {arctanh}\left (\frac {\sqrt {1+e^{-x}}}{\sqrt {2}}\right ) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(65\) vs. \(2(25)=50\).

Time = 0.11 (sec) , antiderivative size = 65, normalized size of antiderivative = 2.60 \[ \int \frac {\sqrt {1+e^{-x}}}{-e^{-x}+e^x} \, dx=-\frac {\sqrt {2} e^{x/2} \sqrt {1+e^{-x}} \text {arctanh}\left (\frac {1-e^x+e^{x/2} \sqrt {1+e^x}}{\sqrt {2}}\right )}{\sqrt {1+e^x}} \]

[In]

Integrate[Sqrt[1 + E^(-x)]/(-E^(-x) + E^x),x]

[Out]

-((Sqrt[2]*E^(x/2)*Sqrt[1 + E^(-x)]*ArcTanh[(1 - E^x + E^(x/2)*Sqrt[1 + E^x])/Sqrt[2]])/Sqrt[1 + E^x])

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(48\) vs. \(2(19)=38\).

Time = 0.10 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.96

method result size
default \(-\frac {\sqrt {\left (1+{\mathrm e}^{x}\right ) {\mathrm e}^{-x}}\, {\mathrm e}^{x} \sqrt {2}\, \operatorname {arctanh}\left (\frac {\left (1+3 \,{\mathrm e}^{x}\right ) \sqrt {2}}{4 \sqrt {{\mathrm e}^{x}+{\mathrm e}^{2 x}}}\right )}{2 \sqrt {\left (1+{\mathrm e}^{x}\right ) {\mathrm e}^{x}}}\) \(49\)

[In]

int((1+exp(-x))^(1/2)/(-exp(-x)+exp(x)),x,method=_RETURNVERBOSE)

[Out]

-1/2*((1+exp(x))/exp(x))^(1/2)*exp(x)/((1+exp(x))*exp(x))^(1/2)*2^(1/2)*arctanh(1/4*(1+3*exp(x))*2^(1/2)/(exp(
x)^2+exp(x))^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.36 \[ \int \frac {\sqrt {1+e^{-x}}}{-e^{-x}+e^x} \, dx=\frac {1}{2} \, \sqrt {2} \log \left (\frac {2 \, \sqrt {2} \sqrt {e^{x} + 1} e^{\left (\frac {1}{2} \, x\right )} - 3 \, e^{x} - 1}{e^{x} - 1}\right ) \]

[In]

integrate((1+exp(-x))^(1/2)/(-exp(-x)+exp(x)),x, algorithm="fricas")

[Out]

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

Sympy [F]

\[ \int \frac {\sqrt {1+e^{-x}}}{-e^{-x}+e^x} \, dx=\int \frac {\sqrt {1 + e^{- x}} e^{x}}{\left (e^{x} - 1\right ) \left (e^{x} + 1\right )}\, dx \]

[In]

integrate((1+exp(-x))**(1/2)/(-exp(-x)+exp(x)),x)

[Out]

Integral(sqrt(1 + exp(-x))*exp(x)/((exp(x) - 1)*(exp(x) + 1)), x)

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.44 \[ \int \frac {\sqrt {1+e^{-x}}}{-e^{-x}+e^x} \, dx=\frac {1}{2} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - \sqrt {e^{\left (-x\right )} + 1}}{\sqrt {2} + \sqrt {e^{\left (-x\right )} + 1}}\right ) \]

[In]

integrate((1+exp(-x))^(1/2)/(-exp(-x)+exp(x)),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (19) = 38\).

Time = 0.29 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.20 \[ \int \frac {\sqrt {1+e^{-x}}}{-e^{-x}+e^x} \, dx=\frac {1}{2} \, \sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 2 \, \sqrt {e^{\left (2 \, x\right )} + e^{x}} - 2 \, e^{x} + 2 \right |}}{{\left | 2 \, \sqrt {2} + 2 \, \sqrt {e^{\left (2 \, x\right )} + e^{x}} - 2 \, e^{x} + 2 \right |}}\right ) \]

[In]

integrate((1+exp(-x))^(1/2)/(-exp(-x)+exp(x)),x, algorithm="giac")

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {1+e^{-x}}}{-e^{-x}+e^x} \, dx=-\int \frac {\sqrt {{\mathrm {e}}^{-x}+1}}{{\mathrm {e}}^{-x}-{\mathrm {e}}^x} \,d x \]

[In]

int(-(exp(-x) + 1)^(1/2)/(exp(-x) - exp(x)),x)

[Out]

-int((exp(-x) + 1)^(1/2)/(exp(-x) - exp(x)), x)