3.509 \(\int \frac{1}{a+b e^x+c e^{2 x}} \, dx\)

Optimal. Leaf size=67 \[ \frac{b \tanh ^{-1}\left (\frac{b+2 c e^x}{\sqrt{b^2-4 a c}}\right )}{a \sqrt{b^2-4 a c}}-\frac{\log \left (a+b e^x+c e^{2 x}\right )}{2 a}+\frac{x}{a} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0646843, antiderivative size = 67, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.438, Rules used = {2282, 705, 29, 634, 618, 206, 628} \[ \frac{b \tanh ^{-1}\left (\frac{b+2 c e^x}{\sqrt{b^2-4 a c}}\right )}{a \sqrt{b^2-4 a c}}-\frac{\log \left (a+b e^x+c e^{2 x}\right )}{2 a}+\frac{x}{a} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[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}{a+b e^x+c e^{2 x}} \, dx &=\operatorname{Subst}\left (\int \frac{1}{x \left (a+b x+c x^2\right )} \, dx,x,e^x\right )\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{x} \, dx,x,e^x\right )}{a}+\frac{\operatorname{Subst}\left (\int \frac{-b-c x}{a+b x+c x^2} \, dx,x,e^x\right )}{a}\\ &=\frac{x}{a}-\frac{\operatorname{Subst}\left (\int \frac{b+2 c x}{a+b x+c x^2} \, dx,x,e^x\right )}{2 a}-\frac{b \operatorname{Subst}\left (\int \frac{1}{a+b x+c x^2} \, dx,x,e^x\right )}{2 a}\\ &=\frac{x}{a}-\frac{\log \left (a+b e^x+c e^{2 x}\right )}{2 a}+\frac{b \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c e^x\right )}{a}\\ &=\frac{x}{a}+\frac{b \tanh ^{-1}\left (\frac{b+2 c e^x}{\sqrt{b^2-4 a c}}\right )}{a \sqrt{b^2-4 a c}}-\frac{\log \left (a+b e^x+c e^{2 x}\right )}{2 a}\\ \end{align*}

Mathematica [A]  time = 0.107642, size = 66, normalized size = 0.99 \[ -\frac{\frac{2 b \tan ^{-1}\left (\frac{b+2 c e^x}{\sqrt{4 a c-b^2}}\right )}{\sqrt{4 a c-b^2}}+\log \left (a+e^x \left (b+c e^x\right )\right )-2 x}{2 a} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.008, size = 66, normalized size = 1. \begin{align*}{\frac{\ln \left ({{\rm e}^{x}} \right ) }{a}}-{\frac{\ln \left ( a+b{{\rm e}^{x}}+c \left ({{\rm e}^{x}} \right ) ^{2} \right ) }{2\,a}}-{\frac{b}{a}\arctan \left ({(b+2\,c{{\rm e}^{x}}){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.53573, size = 518, normalized size = 7.73 \begin{align*} \left [\frac{\sqrt{b^{2} - 4 \, a c} b \log \left (\frac{2 \, c^{2} e^{\left (2 \, x\right )} + 2 \, b c e^{x} + b^{2} - 2 \, a c + \sqrt{b^{2} - 4 \, a c}{\left (2 \, c e^{x} + b\right )}}{c e^{\left (2 \, x\right )} + b e^{x} + a}\right ) + 2 \,{\left (b^{2} - 4 \, a c\right )} x -{\left (b^{2} - 4 \, a c\right )} \log \left (c e^{\left (2 \, x\right )} + b e^{x} + a\right )}{2 \,{\left (a b^{2} - 4 \, a^{2} c\right )}}, \frac{2 \, \sqrt{-b^{2} + 4 \, a c} b \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c e^{x} + b\right )}}{b^{2} - 4 \, a c}\right ) + 2 \,{\left (b^{2} - 4 \, a c\right )} x -{\left (b^{2} - 4 \, a c\right )} \log \left (c e^{\left (2 \, x\right )} + b e^{x} + a\right )}{2 \,{\left (a b^{2} - 4 \, a^{2} c\right )}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.285306, size = 63, normalized size = 0.94 \begin{align*} \operatorname{RootSum}{\left (z^{2} \left (4 a^{2} c - a b^{2}\right ) + z \left (4 a c - b^{2}\right ) + c, \left ( i \mapsto i \log{\left (e^{x} + \frac{- 4 i a^{2} c + i a b^{2} - 2 a c + b^{2}}{b c} \right )} \right )\right )} + \frac{x}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.21214, size = 85, normalized size = 1.27 \begin{align*} -\frac{b \arctan \left (\frac{2 \, c e^{x} + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} a} + \frac{x}{a} - \frac{\log \left (c e^{\left (2 \, x\right )} + b e^{x} + a\right )}{2 \, a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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