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

Optimal. Leaf size=44 \[ \frac{x}{3}-\frac{1}{6} \log \left (3 e^x+e^{2 x}+3\right )-\frac{\tan ^{-1}\left (\frac{2 e^x+3}{\sqrt{3}}\right )}{\sqrt{3}} \]

[Out]

x/3 - ArcTan[(3 + 2*E^x)/Sqrt[3]]/Sqrt[3] - Log[3 + 3*E^x + E^(2*x)]/6

________________________________________________________________________________________

Rubi [A]  time = 0.036331, antiderivative size = 44, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {2282, 705, 29, 634, 618, 204, 628} \[ \frac{x}{3}-\frac{1}{6} \log \left (3 e^x+e^{2 x}+3\right )-\frac{\tan ^{-1}\left (\frac{2 e^x+3}{\sqrt{3}}\right )}{\sqrt{3}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

x/3 - ArcTan[(3 + 2*E^x)/Sqrt[3]]/Sqrt[3] - Log[3 + 3*E^x + E^(2*x)]/6

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]]]

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 29

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

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), 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 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{1}{3+3 e^x+e^{2 x}} \, dx &=\operatorname{Subst}\left (\int \frac{1}{x \left (3+3 x+x^2\right )} \, dx,x,e^x\right )\\ &=\frac{1}{3} \operatorname{Subst}\left (\int \frac{1}{x} \, dx,x,e^x\right )+\frac{1}{3} \operatorname{Subst}\left (\int \frac{-3-x}{3+3 x+x^2} \, dx,x,e^x\right )\\ &=\frac{x}{3}-\frac{1}{6} \operatorname{Subst}\left (\int \frac{3+2 x}{3+3 x+x^2} \, dx,x,e^x\right )-\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{3+3 x+x^2} \, dx,x,e^x\right )\\ &=\frac{x}{3}-\frac{1}{6} \log \left (3+3 e^x+e^{2 x}\right )+\operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,3+2 e^x\right )\\ &=\frac{x}{3}-\frac{\tan ^{-1}\left (\frac{3+2 e^x}{\sqrt{3}}\right )}{\sqrt{3}}-\frac{1}{6} \log \left (3+3 e^x+e^{2 x}\right )\\ \end{align*}

Mathematica [A]  time = 0.0179097, size = 44, normalized size = 1. \[ \frac{x}{3}-\frac{1}{6} \log \left (3 e^x+e^{2 x}+3\right )-\frac{\tan ^{-1}\left (\frac{2 e^x+3}{\sqrt{3}}\right )}{\sqrt{3}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

x/3 - ArcTan[(3 + 2*E^x)/Sqrt[3]]/Sqrt[3] - Log[3 + 3*E^x + E^(2*x)]/6

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 37, normalized size = 0.8 \begin{align*} -{\frac{\ln \left ( 3+3\,{{\rm e}^{x}}+ \left ({{\rm e}^{x}} \right ) ^{2} \right ) }{6}}-{\frac{\sqrt{3}}{3}\arctan \left ({\frac{ \left ( 3+2\,{{\rm e}^{x}} \right ) \sqrt{3}}{3}} \right ) }+{\frac{\ln \left ({{\rm e}^{x}} \right ) }{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/6*ln(3+3*exp(x)+exp(x)^2)-1/3*arctan(1/3*(3+2*exp(x))*3^(1/2))*3^(1/2)+1/3*ln(exp(x))

________________________________________________________________________________________

Maxima [A]  time = 1.46327, size = 46, normalized size = 1.05 \begin{align*} -\frac{1}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, e^{x} + 3\right )}\right ) + \frac{1}{3} \, x - \frac{1}{6} \, \log \left (e^{\left (2 \, x\right )} + 3 \, e^{x} + 3\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.5249, size = 117, normalized size = 2.66 \begin{align*} -\frac{1}{3} \, \sqrt{3} \arctan \left (\frac{2}{3} \, \sqrt{3} e^{x} + \sqrt{3}\right ) + \frac{1}{3} \, x - \frac{1}{6} \, \log \left (e^{\left (2 \, x\right )} + 3 \, e^{x} + 3\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.120918, size = 24, normalized size = 0.55 \begin{align*} \frac{x}{3} + \operatorname{RootSum}{\left (9 z^{2} + 3 z + 1, \left ( i \mapsto i \log{\left (- 3 i + e^{x} + 1 \right )} \right )\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x/3 + RootSum(9*_z**2 + 3*_z + 1, Lambda(_i, _i*log(-3*_i + exp(x) + 1)))

________________________________________________________________________________________

Giac [A]  time = 1.26904, size = 46, normalized size = 1.05 \begin{align*} -\frac{1}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, e^{x} + 3\right )}\right ) + \frac{1}{3} \, x - \frac{1}{6} \, \log \left (e^{\left (2 \, x\right )} + 3 \, e^{x} + 3\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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