\(\int \frac {1}{a+b e^{-x}+c e^x} \, dx\) [537]

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

Optimal result

Integrand size = 16, antiderivative size = 36 \[ \int \frac {1}{a+b e^{-x}+c e^x} \, dx=-\frac {2 \text {arctanh}\left (\frac {a+2 c e^x}{\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}} \]

[Out]

-2*arctanh((a+2*c*exp(x))/(a^2-4*b*c)^(1/2))/(a^2-4*b*c)^(1/2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {2320, 1400, 632, 212} \[ \int \frac {1}{a+b e^{-x}+c e^x} \, dx=-\frac {2 \text {arctanh}\left (\frac {a+2 c e^x}{\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}} \]

[In]

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

[Out]

(-2*ArcTanh[(a + 2*c*E^x)/Sqrt[a^2 - 4*b*c]])/Sqrt[a^2 - 4*b*c]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[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 1400

Int[(x_)^(m_.)*((a_) + (c_.)*(x_)^(n_.) + (b_.)*(x_)^(mn_))^(p_.), x_Symbol] :> Int[x^(m - n*p)*(b + a*x^n + c
*x^(2*n))^p, x] /; FreeQ[{a, b, c, m, n}, x] && EqQ[mn, -n] && IntegerQ[p] && PosQ[n]

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

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.11 \[ \int \frac {1}{a+b e^{-x}+c e^x} \, dx=\frac {2 \arctan \left (\frac {a+2 c e^x}{\sqrt {-a^2+4 b c}}\right )}{\sqrt {-a^2+4 b c}} \]

[In]

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

[Out]

(2*ArcTan[(a + 2*c*E^x)/Sqrt[-a^2 + 4*b*c]])/Sqrt[-a^2 + 4*b*c]

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.00

method result size
derivativedivides \(\frac {2 \arctan \left (\frac {a +2 c \,{\mathrm e}^{x}}{\sqrt {-a^{2}+4 c b}}\right )}{\sqrt {-a^{2}+4 c b}}\) \(36\)
default \(\frac {2 \arctan \left (\frac {a +2 c \,{\mathrm e}^{x}}{\sqrt {-a^{2}+4 c b}}\right )}{\sqrt {-a^{2}+4 c b}}\) \(36\)
risch \(\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}-4 c b}-a^{2}+4 c b}{2 c \sqrt {a^{2}-4 c b}}\right )}{\sqrt {a^{2}-4 c b}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}-4 c b}+a^{2}-4 c b}{2 c \sqrt {a^{2}-4 c b}}\right )}{\sqrt {a^{2}-4 c b}}\) \(105\)

[In]

int(1/(a+b/exp(x)+c*exp(x)),x,method=_RETURNVERBOSE)

[Out]

2/(-a^2+4*b*c)^(1/2)*arctan((a+2*c*exp(x))/(-a^2+4*b*c)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.36 (sec) , antiderivative size = 126, normalized size of antiderivative = 3.50 \[ \int \frac {1}{a+b e^{-x}+c e^x} \, dx=\left [\frac {\log \left (\frac {2 \, c^{2} e^{\left (2 \, x\right )} + 2 \, a c e^{x} + a^{2} - 2 \, b c - \sqrt {a^{2} - 4 \, b c} {\left (2 \, c e^{x} + a\right )}}{c e^{\left (2 \, x\right )} + a e^{x} + b}\right )}{\sqrt {a^{2} - 4 \, b c}}, -\frac {2 \, \sqrt {-a^{2} + 4 \, b c} \arctan \left (-\frac {\sqrt {-a^{2} + 4 \, b c} {\left (2 \, c e^{x} + a\right )}}{a^{2} - 4 \, b c}\right )}{a^{2} - 4 \, b c}\right ] \]

[In]

integrate(1/(a+b/exp(x)+c*exp(x)),x, algorithm="fricas")

[Out]

[log((2*c^2*e^(2*x) + 2*a*c*e^x + a^2 - 2*b*c - sqrt(a^2 - 4*b*c)*(2*c*e^x + a))/(c*e^(2*x) + a*e^x + b))/sqrt
(a^2 - 4*b*c), -2*sqrt(-a^2 + 4*b*c)*arctan(-sqrt(-a^2 + 4*b*c)*(2*c*e^x + a)/(a^2 - 4*b*c))/(a^2 - 4*b*c)]

Sympy [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.00 \[ \int \frac {1}{a+b e^{-x}+c e^x} \, dx=\operatorname {RootSum} {\left (z^{2} \left (a^{2} - 4 b c\right ) - 1, \left ( i \mapsto i \log {\left (e^{x} + \frac {- i a^{2} + 4 i b c + a}{2 c} \right )} \right )\right )} \]

[In]

integrate(1/(a+b/exp(x)+c*exp(x)),x)

[Out]

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

Maxima [F(-2)]

Exception generated. \[ \int \frac {1}{a+b e^{-x}+c e^x} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(1/(a+b/exp(x)+c*exp(x)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b*c-a^2>0)', see `assume?` f
or more deta

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.97 \[ \int \frac {1}{a+b e^{-x}+c e^x} \, dx=\frac {2 \, \arctan \left (\frac {2 \, c e^{x} + a}{\sqrt {-a^{2} + 4 \, b c}}\right )}{\sqrt {-a^{2} + 4 \, b c}} \]

[In]

integrate(1/(a+b/exp(x)+c*exp(x)),x, algorithm="giac")

[Out]

2*arctan((2*c*e^x + a)/sqrt(-a^2 + 4*b*c))/sqrt(-a^2 + 4*b*c)

Mupad [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.97 \[ \int \frac {1}{a+b e^{-x}+c e^x} \, dx=\frac {2\,\mathrm {atan}\left (\frac {a+2\,c\,{\mathrm {e}}^x}{\sqrt {4\,b\,c-a^2}}\right )}{\sqrt {4\,b\,c-a^2}} \]

[In]

int(1/(a + c*exp(x) + b*exp(-x)),x)

[Out]

(2*atan((a + 2*c*exp(x))/(4*b*c - a^2)^(1/2)))/(4*b*c - a^2)^(1/2)