3.535 \(\int \frac{1}{2+3^{-x}+3^x} \, dx\)

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

[Out]

-(1/((1 + 3^x)*Log[3]))

________________________________________________________________________________________

Rubi [A]  time = 0.0120727, antiderivative size = 13, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {2282, 32} \[ -\frac{1}{\left (3^x+1\right ) \log (3)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-(1/((1 + 3^x)*Log[3]))

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 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rubi steps

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

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

Antiderivative was successfully verified.

[In]

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

[Out]

-(1/((1 + 3^x)*Log[3]))

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 14, normalized size = 1.1 \begin{align*} -{\frac{1}{ \left ( 1+{3}^{x} \right ) \ln \left ( 3 \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(2+1/(3^x)+3^x),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.987349, size = 19, normalized size = 1.46 \begin{align*} \frac{1}{{\left (\frac{1}{3^{x}} + 1\right )} \log \left (3\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/((1/3^x + 1)*log(3))

________________________________________________________________________________________

Fricas [A]  time = 1.22765, size = 35, normalized size = 2.69 \begin{align*} -\frac{1}{3^{x} \log \left (3\right ) + \log \left (3\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.088442, size = 12, normalized size = 0.92 \begin{align*} - \frac{1}{3^{x} \log{\left (3 \right )} + \log{\left (3 \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/(3**x*log(3) + log(3))

________________________________________________________________________________________

Giac [A]  time = 1.19945, size = 18, normalized size = 1.38 \begin{align*} -\frac{1}{{\left (3^{x} + 1\right )} \log \left (3\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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