\(\int \frac {1}{b f^{-x}+a f^x} \, dx\) [54]

   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 = 15, antiderivative size = 30 \[ \int \frac {1}{b f^{-x}+a f^x} \, dx=\frac {\arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)} \]

[Out]

arctan(f^x*a^(1/2)/b^(1/2))/ln(f)/a^(1/2)/b^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {2320, 211} \[ \int \frac {1}{b f^{-x}+a f^x} \, dx=\frac {\arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)} \]

[In]

Int[(b/f^x + a*f^x)^(-1),x]

[Out]

ArcTan[(Sqrt[a]*f^x)/Sqrt[b]]/(Sqrt[a]*Sqrt[b]*Log[f])

Rule 211

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

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}& = \frac {\text {Subst}\left (\int \frac {1}{b+a x^2} \, dx,x,f^x\right )}{\log (f)} \\ & = \frac {\tan ^{-1}\left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00 \[ \int \frac {1}{b f^{-x}+a f^x} \, dx=\frac {\arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)} \]

[In]

Integrate[(b/f^x + a*f^x)^(-1),x]

[Out]

ArcTan[(Sqrt[a]*f^x)/Sqrt[b]]/(Sqrt[a]*Sqrt[b]*Log[f])

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.73

method result size
derivativedivides \(\frac {\arctan \left (\frac {a \,f^{x}}{\sqrt {a b}}\right )}{\ln \left (f \right ) \sqrt {a b}}\) \(22\)
default \(\frac {\arctan \left (\frac {a \,f^{x}}{\sqrt {a b}}\right )}{\ln \left (f \right ) \sqrt {a b}}\) \(22\)
risch \(-\frac {\ln \left (f^{x}-\frac {b}{\sqrt {-a b}}\right )}{2 \sqrt {-a b}\, \ln \left (f \right )}+\frac {\ln \left (f^{x}+\frac {b}{\sqrt {-a b}}\right )}{2 \sqrt {-a b}\, \ln \left (f \right )}\) \(53\)

[In]

int(1/(b/(f^x)+a*f^x),x,method=_RETURNVERBOSE)

[Out]

1/ln(f)/(a*b)^(1/2)*arctan(a*f^x/(a*b)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 86, normalized size of antiderivative = 2.87 \[ \int \frac {1}{b f^{-x}+a f^x} \, dx=\left [-\frac {\sqrt {-a b} \log \left (\frac {a f^{2 \, x} - 2 \, \sqrt {-a b} f^{x} - b}{a f^{2 \, x} + b}\right )}{2 \, a b \log \left (f\right )}, -\frac {\sqrt {a b} \arctan \left (\frac {\sqrt {a b}}{a f^{x}}\right )}{a b \log \left (f\right )}\right ] \]

[In]

integrate(1/(b/(f^x)+a*f^x),x, algorithm="fricas")

[Out]

[-1/2*sqrt(-a*b)*log((a*f^(2*x) - 2*sqrt(-a*b)*f^x - b)/(a*f^(2*x) + b))/(a*b*log(f)), -sqrt(a*b)*arctan(sqrt(
a*b)/(a*f^x))/(a*b*log(f))]

Sympy [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.87 \[ \int \frac {1}{b f^{-x}+a f^x} \, dx=\frac {\operatorname {RootSum} {\left (4 z^{2} a b + 1, \left ( i \mapsto i \log {\left (- 2 i a + f^{- x} \right )} \right )\right )}}{\log {\left (f \right )}} \]

[In]

integrate(1/(b/(f**x)+a*f**x),x)

[Out]

RootSum(4*_z**2*a*b + 1, Lambda(_i, _i*log(-2*_i*a + f**(-x))))/log(f)

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.80 \[ \int \frac {1}{b f^{-x}+a f^x} \, dx=-\frac {\arctan \left (\frac {b}{\sqrt {a b} f^{x}}\right )}{\sqrt {a b} \log \left (f\right )} \]

[In]

integrate(1/(b/(f^x)+a*f^x),x, algorithm="maxima")

[Out]

-arctan(b/(sqrt(a*b)*f^x))/(sqrt(a*b)*log(f))

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.70 \[ \int \frac {1}{b f^{-x}+a f^x} \, dx=\frac {\arctan \left (\frac {a f^{x}}{\sqrt {a b}}\right )}{\sqrt {a b} \log \left (f\right )} \]

[In]

integrate(1/(b/(f^x)+a*f^x),x, algorithm="giac")

[Out]

arctan(a*f^x/sqrt(a*b))/(sqrt(a*b)*log(f))

Mupad [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.70 \[ \int \frac {1}{b f^{-x}+a f^x} \, dx=\frac {\mathrm {atan}\left (\frac {a\,f^x}{\sqrt {a\,b}}\right )}{\ln \left (f\right )\,\sqrt {a\,b}} \]

[In]

int(1/(b/f^x + a*f^x),x)

[Out]

atan((a*f^x)/(a*b)^(1/2))/(log(f)*(a*b)^(1/2))