3.6.6 \(\int \frac {1}{2+3 e^x+e^{2 x}} \, dx\) [506]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {2320, 719, 29, 646, 31} \begin {gather*} \frac {x}{2}-\log \left (e^x+1\right )+\frac {1}{2} \log \left (e^x+2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x/2 - Log[1 + E^x] + Log[2 + E^x]/2

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 646

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[
(c*d - e*(b/2 - q/2))/q, Int[1/(b/2 - q/2 + c*x), x], x] - Dist[(c*d - e*(b/2 + q/2))/q, Int[1/(b/2 + q/2 + c*
x), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] && NiceSqrtQ[b^2 - 4*a*
c]

Rule 719

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

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 27, normalized size = 1.12 \begin {gather*} \frac {\log \left (e^x\right )}{2}-\log \left (1+e^x\right )+\frac {1}{2} \log \left (2+e^x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

Log[E^x]/2 - Log[1 + E^x] + Log[2 + E^x]/2

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 21, normalized size = 0.88

method result size
norman \(\frac {x}{2}-\ln \left (1+{\mathrm e}^{x}\right )+\frac {\ln \left (2+{\mathrm e}^{x}\right )}{2}\) \(19\)
risch \(\frac {x}{2}-\ln \left (1+{\mathrm e}^{x}\right )+\frac {\ln \left (2+{\mathrm e}^{x}\right )}{2}\) \(19\)
default \(\frac {\ln \left (2+{\mathrm e}^{x}\right )}{2}-\ln \left (1+{\mathrm e}^{x}\right )+\frac {\ln \left ({\mathrm e}^{x}\right )}{2}\) \(21\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 18, normalized size = 0.75 \begin {gather*} \frac {1}{2} \, x + \frac {1}{2} \, \log \left (e^{x} + 2\right ) - \log \left (e^{x} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 18, normalized size = 0.75 \begin {gather*} \frac {1}{2} \, x + \frac {1}{2} \, \log \left (e^{x} + 2\right ) - \log \left (e^{x} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.04, size = 17, normalized size = 0.71 \begin {gather*} \frac {x}{2} - \log {\left (e^{x} + 1 \right )} + \frac {\log {\left (e^{x} + 2 \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 3.42, size = 18, normalized size = 0.75 \begin {gather*} \frac {1}{2} \, x + \frac {1}{2} \, \log \left (e^{x} + 2\right ) - \log \left (e^{x} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.07, size = 18, normalized size = 0.75 \begin {gather*} \frac {x}{2}-\ln \left ({\mathrm {e}}^x+1\right )+\frac {\ln \left ({\mathrm {e}}^x+2\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________