3.505 \(\int \frac{1}{1+2 e^x+e^{2 x}} \, dx\)

Optimal. Leaf size=17 \[ x+\frac{1}{e^x+1}-\log \left (e^x+1\right ) \]

[Out]

(1 + E^x)^(-1) + x - Log[1 + E^x]

_______________________________________________________________________________________

Rubi [A]  time = 0.0294842, antiderivative size = 17, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143 \[ x+\frac{1}{e^x+1}-\log \left (e^x+1\right ) \]

Antiderivative was successfully verified.

[In]  Int[(1 + 2*E^x + E^(2*x))^(-1),x]

[Out]

(1 + E^x)^(-1) + x - Log[1 + E^x]

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 7.38376, size = 17, normalized size = 1. \[ - \log{\left (e^{x} + 1 \right )} + \log{\left (e^{x} \right )} + \frac{1}{e^{x} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(1/(1+2*exp(x)+exp(2*x)),x)

[Out]

-log(exp(x) + 1) + log(exp(x)) + 1/(exp(x) + 1)

_______________________________________________________________________________________

Mathematica [A]  time = 0.0167562, size = 17, normalized size = 1. \[ x+\frac{1}{e^x+1}-\log \left (e^x+1\right ) \]

Antiderivative was successfully verified.

[In]  Integrate[(1 + 2*E^x + E^(2*x))^(-1),x]

[Out]

(1 + E^x)^(-1) + x - Log[1 + E^x]

_______________________________________________________________________________________

Maple [A]  time = 0.013, size = 18, normalized size = 1.1 \[ \left ( 1+{{\rm e}^{x}} \right ) ^{-1}-\ln \left ( 1+{{\rm e}^{x}} \right ) +\ln \left ({{\rm e}^{x}} \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(1/(1+2*exp(x)+exp(2*x)),x)

[Out]

1/(1+exp(x))-ln(1+exp(x))+ln(exp(x))

_______________________________________________________________________________________

Maxima [A]  time = 0.780711, size = 20, normalized size = 1.18 \[ x + \frac{1}{e^{x} + 1} - \log \left (e^{x} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(e^(2*x) + 2*e^x + 1),x, algorithm="maxima")

[Out]

x + 1/(e^x + 1) - log(e^x + 1)

_______________________________________________________________________________________

Fricas [A]  time = 0.246991, size = 34, normalized size = 2. \[ \frac{x e^{x} -{\left (e^{x} + 1\right )} \log \left (e^{x} + 1\right ) + x + 1}{e^{x} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(e^(2*x) + 2*e^x + 1),x, algorithm="fricas")

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.065228, size = 14, normalized size = 0.82 \[ x - \log{\left (e^{x} + 1 \right )} + \frac{1}{e^{x} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(1+2*exp(x)+exp(2*x)),x)

[Out]

x - log(exp(x) + 1) + 1/(exp(x) + 1)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.237677, size = 20, normalized size = 1.18 \[ x + \frac{1}{e^{x} + 1} -{\rm ln}\left (e^{x} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(e^(2*x) + 2*e^x + 1),x, algorithm="giac")

[Out]

x + 1/(e^x + 1) - ln(e^x + 1)