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

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 26, 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.214, Rules used = {2320, 738, 212} \[ \int \frac {1}{\sqrt {1+e^x+e^{2 x}}} \, dx=-\text {arctanh}\left (\frac {e^x+2}{2 \sqrt {e^x+e^{2 x}+1}}\right ) \]

[In]

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

[Out]

-ArcTanh[(2 + E^x)/(2*Sqrt[1 + E^x + E^(2*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 738

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 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 \sqrt {1+x+x^2}} \, dx,x,e^x\right ) \\ & = -\left (2 \text {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {2+e^x}{\sqrt {1+e^x+e^{2 x}}}\right )\right ) \\ & = -\text {arctanh}\left (\frac {2+e^x}{2 \sqrt {1+e^x+e^{2 x}}}\right ) \\ \end{align*}

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.77

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [F]

\[ \int \frac {1}{\sqrt {1+e^x+e^{2 x}}} \, dx=\int \frac {1}{\sqrt {e^{2 x} + e^{x} + 1}}\, dx \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.69 \[ \int \frac {1}{\sqrt {1+e^x+e^{2 x}}} \, dx=-\operatorname {arsinh}\left (\frac {2}{3} \, \sqrt {3} e^{\left (-x\right )} + \frac {1}{3} \, \sqrt {3}\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 16.08 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.81 \[ \int \frac {1}{\sqrt {1+e^x+e^{2 x}}} \, dx=x-\ln \left (\frac {{\mathrm {e}}^x}{2}+\sqrt {{\mathrm {e}}^{2\,x}+{\mathrm {e}}^x+1}+1\right ) \]

[In]

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

[Out]

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