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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, 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 = {2282, 705, 29, 632, 31} \[ \frac {x}{2}-\log \left (e^x+1\right )+\frac {1}{2} \log \left (e^x+2\right ) \]

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 632

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 705

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 2282

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 &=\operatorname {Subst}\left (\int \frac {1}{x \left (2+3 x+x^2\right )} \, dx,x,e^x\right )\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{x} \, dx,x,e^x\right )+\frac {1}{2} \operatorname {Subst}\left (\int \frac {-3-x}{2+3 x+x^2} \, dx,x,e^x\right )\\ &=\frac {x}{2}+\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{2+x} \, dx,x,e^x\right )-\operatorname {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.01, size = 24, normalized size = 1.00 \[ \frac {x}{2}-\log \left (e^x+1\right )+\frac {1}{2} \log \left (e^x+2\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

giac [A]  time = 0.37, size = 18, normalized size = 0.75 \[ \frac {1}{2} \, x + \frac {1}{2} \, \log \left (e^{x} + 2\right ) - \log \left (e^{x} + 1\right ) \]

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)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 21, normalized size = 0.88 \[ -\ln \left ({\mathrm e}^{x}+1\right )+\frac {\ln \left ({\mathrm e}^{x}+2\right )}{2}+\frac {\ln \left ({\mathrm e}^{x}\right )}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.84, size = 18, normalized size = 0.75 \[ \frac {1}{2} \, x + \frac {1}{2} \, \log \left (e^{x} + 2\right ) - \log \left (e^{x} + 1\right ) \]

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)

________________________________________________________________________________________

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

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

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 17, normalized size = 0.71 \[ \frac {x}{2} - \log {\left (e^{x} + 1 \right )} + \frac {\log {\left (e^{x} + 2 \right )}}{2} \]

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

________________________________________________________________________________________