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

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

Optimal result

Integrand size = 14, antiderivative size = 44 \[ \int \frac {1}{3+3 e^x+e^{2 x}} \, dx=\frac {x}{3}-\frac {\arctan \left (\frac {3+2 e^x}{\sqrt {3}}\right )}{\sqrt {3}}-\frac {1}{6} \log \left (3+3 e^x+e^{2 x}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {2320, 719, 29, 648, 632, 210, 642} \[ \int \frac {1}{3+3 e^x+e^{2 x}} \, dx=-\frac {\arctan \left (\frac {2 e^x+3}{\sqrt {3}}\right )}{\sqrt {3}}+\frac {x}{3}-\frac {1}{6} \log \left (3 e^x+e^{2 x}+3\right ) \]

[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 29

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

Rule 210

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

Rule 632

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 642

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]

Rule 648

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 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*} \text {integral}& = \text {Subst}\left (\int \frac {1}{x \left (3+3 x+x^2\right )} \, dx,x,e^x\right ) \\ & = \frac {1}{3} \text {Subst}\left (\int \frac {1}{x} \, dx,x,e^x\right )+\frac {1}{3} \text {Subst}\left (\int \frac {-3-x}{3+3 x+x^2} \, dx,x,e^x\right ) \\ & = \frac {x}{3}-\frac {1}{6} \text {Subst}\left (\int \frac {3+2 x}{3+3 x+x^2} \, dx,x,e^x\right )-\frac {1}{2} \text {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 )+\text {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] (verified)

Time = 0.04 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.07 \[ \int \frac {1}{3+3 e^x+e^{2 x}} \, dx=\frac {1}{6} \left (-2 \sqrt {3} \arctan \left (\frac {3+2 e^x}{\sqrt {3}}\right )+2 \log \left (e^x\right )-\log \left (3+3 e^x+e^{2 x}\right )\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.02 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.84

method result size
default \(\frac {\ln \left ({\mathrm e}^{x}\right )}{3}-\frac {\ln \left (3+3 \,{\mathrm e}^{x}+{\mathrm e}^{2 x}\right )}{6}-\frac {\arctan \left (\frac {\left (3+2 \,{\mathrm e}^{x}\right ) \sqrt {3}}{3}\right ) \sqrt {3}}{3}\) \(37\)
risch \(\frac {x}{3}-\frac {\ln \left ({\mathrm e}^{x}+\frac {3}{2}-\frac {i \sqrt {3}}{2}\right )}{6}+\frac {i \ln \left ({\mathrm e}^{x}+\frac {3}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {3}}{6}-\frac {\ln \left ({\mathrm e}^{x}+\frac {3}{2}+\frac {i \sqrt {3}}{2}\right )}{6}-\frac {i \ln \left ({\mathrm e}^{x}+\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) \sqrt {3}}{6}\) \(65\)

[In]

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

[Out]

1/3*ln(exp(x))-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)

Fricas [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.77 \[ \int \frac {1}{3+3 e^x+e^{2 x}} \, dx=-\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 ) \]

[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] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.55 \[ \int \frac {1}{3+3 e^x+e^{2 x}} \, dx=\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 )} \]

[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)))

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.77 \[ \int \frac {1}{3+3 e^x+e^{2 x}} \, dx=-\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 ) \]

[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)

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.77 \[ \int \frac {1}{3+3 e^x+e^{2 x}} \, dx=-\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 ) \]

[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)

Mupad [B] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.77 \[ \int \frac {1}{3+3 e^x+e^{2 x}} \, dx=\frac {x}{3}-\frac {\ln \left ({\mathrm {e}}^{2\,x}+3\,{\mathrm {e}}^x+3\right )}{6}-\frac {\sqrt {3}\,\mathrm {atan}\left (\sqrt {3}+\frac {2\,\sqrt {3}\,{\mathrm {e}}^x}{3}\right )}{3} \]

[In]

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

[Out]

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