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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.429495, antiderivative size = 276, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 5, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.278, Rules used = {2263, 2184, 2190, 2279, 2391} \[ \frac{2 c \text{PolyLog}\left (2,-\frac{2 c e^x}{b-\sqrt{b^2-4 a c}}\right )}{-b \sqrt{b^2-4 a c}-4 a c+b^2}+\frac{2 c \text{PolyLog}\left (2,-\frac{2 c e^x}{\sqrt{b^2-4 a c}+b}\right )}{b \sqrt{b^2-4 a c}-4 a c+b^2}-\frac{c x^2}{-b \sqrt{b^2-4 a c}-4 a c+b^2}-\frac{c x^2}{b \sqrt{b^2-4 a c}-4 a c+b^2}+\frac{2 c x \log \left (\frac{2 c e^x}{b-\sqrt{b^2-4 a c}}+1\right )}{-b \sqrt{b^2-4 a c}-4 a c+b^2}+\frac{2 c x \log \left (\frac{2 c e^x}{\sqrt{b^2-4 a c}+b}+1\right )}{b \sqrt{b^2-4 a c}-4 a c+b^2} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2263

Int[((f_.) + (g_.)*(x_))^(m_.)/((a_.) + (b_.)*(F_)^(u_) + (c_.)*(F_)^(v_)), x_Symbol] :> With[{q = Rt[b^2 - 4*
a*c, 2]}, Dist[(2*c)/q, Int[(f + g*x)^m/(b - q + 2*c*F^u), x], x] - Dist[(2*c)/q, Int[(f + g*x)^m/(b + q + 2*c
*F^u), x], x]] /; FreeQ[{F, a, b, c, f, g}, x] && EqQ[v, 2*u] && LinearQ[u, x] && NeQ[b^2 - 4*a*c, 0] && IGtQ[
m, 0]

Rule 2184

Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[(c
+ d*x)^(m + 1)/(a*d*(m + 1)), x] - Dist[b/a, Int[((c + d*x)^m*(F^(g*(e + f*x)))^n)/(a + b*(F^(g*(e + f*x)))^n)
, x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2190

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), x]
 - Dist[(d*m)/(b*f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*Log[1 + (b*(F^(g*(e + f*x)))^n)/a], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rubi steps

\begin{align*} \int \frac{x}{a+b e^x+c e^{2 x}} \, dx &=\frac{(2 c) \int \frac{x}{b-\sqrt{b^2-4 a c}+2 c e^x} \, dx}{\sqrt{b^2-4 a c}}-\frac{(2 c) \int \frac{x}{b+\sqrt{b^2-4 a c}+2 c e^x} \, dx}{\sqrt{b^2-4 a c}}\\ &=-\frac{c x^2}{b^2-4 a c-b \sqrt{b^2-4 a c}}-\frac{c x^2}{b^2-4 a c+b \sqrt{b^2-4 a c}}+\frac{\left (4 c^2\right ) \int \frac{e^x x}{b-\sqrt{b^2-4 a c}+2 c e^x} \, dx}{b^2-4 a c-b \sqrt{b^2-4 a c}}+\frac{\left (4 c^2\right ) \int \frac{e^x x}{b+\sqrt{b^2-4 a c}+2 c e^x} \, dx}{b^2-4 a c+b \sqrt{b^2-4 a c}}\\ &=-\frac{c x^2}{b^2-4 a c-b \sqrt{b^2-4 a c}}-\frac{c x^2}{b^2-4 a c+b \sqrt{b^2-4 a c}}+\frac{2 c x \log \left (1+\frac{2 c e^x}{b-\sqrt{b^2-4 a c}}\right )}{b^2-4 a c-b \sqrt{b^2-4 a c}}+\frac{2 c x \log \left (1+\frac{2 c e^x}{b+\sqrt{b^2-4 a c}}\right )}{b^2-4 a c+b \sqrt{b^2-4 a c}}-\frac{(2 c) \int \log \left (1+\frac{2 c e^x}{b-\sqrt{b^2-4 a c}}\right ) \, dx}{b^2-4 a c-b \sqrt{b^2-4 a c}}-\frac{(2 c) \int \log \left (1+\frac{2 c e^x}{b+\sqrt{b^2-4 a c}}\right ) \, dx}{b^2-4 a c+b \sqrt{b^2-4 a c}}\\ &=-\frac{c x^2}{b^2-4 a c-b \sqrt{b^2-4 a c}}-\frac{c x^2}{b^2-4 a c+b \sqrt{b^2-4 a c}}+\frac{2 c x \log \left (1+\frac{2 c e^x}{b-\sqrt{b^2-4 a c}}\right )}{b^2-4 a c-b \sqrt{b^2-4 a c}}+\frac{2 c x \log \left (1+\frac{2 c e^x}{b+\sqrt{b^2-4 a c}}\right )}{b^2-4 a c+b \sqrt{b^2-4 a c}}-\frac{(2 c) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 c x}{b-\sqrt{b^2-4 a c}}\right )}{x} \, dx,x,e^x\right )}{b^2-4 a c-b \sqrt{b^2-4 a c}}-\frac{(2 c) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 c x}{b+\sqrt{b^2-4 a c}}\right )}{x} \, dx,x,e^x\right )}{b^2-4 a c+b \sqrt{b^2-4 a c}}\\ &=-\frac{c x^2}{b^2-4 a c-b \sqrt{b^2-4 a c}}-\frac{c x^2}{b^2-4 a c+b \sqrt{b^2-4 a c}}+\frac{2 c x \log \left (1+\frac{2 c e^x}{b-\sqrt{b^2-4 a c}}\right )}{b^2-4 a c-b \sqrt{b^2-4 a c}}+\frac{2 c x \log \left (1+\frac{2 c e^x}{b+\sqrt{b^2-4 a c}}\right )}{b^2-4 a c+b \sqrt{b^2-4 a c}}+\frac{2 c \text{Li}_2\left (-\frac{2 c e^x}{b-\sqrt{b^2-4 a c}}\right )}{b^2-4 a c-b \sqrt{b^2-4 a c}}+\frac{2 c \text{Li}_2\left (-\frac{2 c e^x}{b+\sqrt{b^2-4 a c}}\right )}{b^2-4 a c+b \sqrt{b^2-4 a c}}\\ \end{align*}

Mathematica [A]  time = 0.209777, size = 205, normalized size = 0.74 \[ \frac{-\left (\sqrt{b^2-4 a c}+b\right ) \text{PolyLog}\left (2,\frac{2 c e^x}{\sqrt{b^2-4 a c}-b}\right )+\left (b-\sqrt{b^2-4 a c}\right ) \text{PolyLog}\left (2,-\frac{2 c e^x}{\sqrt{b^2-4 a c}+b}\right )+x \left (x \sqrt{b^2-4 a c}-\left (\sqrt{b^2-4 a c}+b\right ) \log \left (\frac{2 c e^x}{b-\sqrt{b^2-4 a c}}+1\right )+\left (b-\sqrt{b^2-4 a c}\right ) \log \left (\frac{2 c e^x}{\sqrt{b^2-4 a c}+b}+1\right )\right )}{2 a \sqrt{b^2-4 a c}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.013, size = 378, normalized size = 1.4 \begin{align*}{\frac{{x}^{2}}{2\,a}}-{\frac{x}{2\,a}\ln \left ({ \left ( -2\,c{{\rm e}^{x}}+\sqrt{-4\,ac+{b}^{2}}-b \right ) \left ( -b+\sqrt{-4\,ac+{b}^{2}} \right ) ^{-1}} \right ) }-{\frac{bx}{2\,a}\ln \left ({ \left ( -2\,c{{\rm e}^{x}}+\sqrt{-4\,ac+{b}^{2}}-b \right ) \left ( -b+\sqrt{-4\,ac+{b}^{2}} \right ) ^{-1}} \right ){\frac{1}{\sqrt{-4\,ac+{b}^{2}}}}}-{\frac{x}{2\,a}\ln \left ({ \left ( 2\,c{{\rm e}^{x}}+\sqrt{-4\,ac+{b}^{2}}+b \right ) \left ( b+\sqrt{-4\,ac+{b}^{2}} \right ) ^{-1}} \right ) }+{\frac{bx}{2\,a}\ln \left ({ \left ( 2\,c{{\rm e}^{x}}+\sqrt{-4\,ac+{b}^{2}}+b \right ) \left ( b+\sqrt{-4\,ac+{b}^{2}} \right ) ^{-1}} \right ){\frac{1}{\sqrt{-4\,ac+{b}^{2}}}}}-{\frac{1}{2\,a}{\it dilog} \left ({ \left ( 2\,c{{\rm e}^{x}}+\sqrt{-4\,ac+{b}^{2}}+b \right ) \left ( b+\sqrt{-4\,ac+{b}^{2}} \right ) ^{-1}} \right ) }+{\frac{b}{2\,a}{\it dilog} \left ({ \left ( 2\,c{{\rm e}^{x}}+\sqrt{-4\,ac+{b}^{2}}+b \right ) \left ( b+\sqrt{-4\,ac+{b}^{2}} \right ) ^{-1}} \right ){\frac{1}{\sqrt{-4\,ac+{b}^{2}}}}}-{\frac{1}{2\,a}{\it dilog} \left ({ \left ( -2\,c{{\rm e}^{x}}+\sqrt{-4\,ac+{b}^{2}}-b \right ) \left ( -b+\sqrt{-4\,ac+{b}^{2}} \right ) ^{-1}} \right ) }-{\frac{b}{2\,a}{\it dilog} \left ({ \left ( -2\,c{{\rm e}^{x}}+\sqrt{-4\,ac+{b}^{2}}-b \right ) \left ( -b+\sqrt{-4\,ac+{b}^{2}} \right ) ^{-1}} \right ){\frac{1}{\sqrt{-4\,ac+{b}^{2}}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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(x/(a+b*exp(x)+c*exp(2*x)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.52882, size = 649, normalized size = 2.35 \begin{align*} \frac{{\left (b^{2} - 4 \, a c\right )} x^{2} -{\left (a b \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} + b^{2} - 4 \, a c\right )}{\rm Li}_2\left (-\frac{a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} e^{x} + b e^{x} + 2 \, a}{2 \, a} + 1\right ) +{\left (a b \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} - b^{2} + 4 \, a c\right )}{\rm Li}_2\left (\frac{a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} e^{x} - b e^{x} - 2 \, a}{2 \, a} + 1\right ) -{\left (a b x \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} +{\left (b^{2} - 4 \, a c\right )} x\right )} \log \left (\frac{a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} e^{x} + b e^{x} + 2 \, a}{2 \, a}\right ) +{\left (a b x \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} -{\left (b^{2} - 4 \, a c\right )} x\right )} \log \left (-\frac{a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} e^{x} - b e^{x} - 2 \, a}{2 \, a}\right )}{2 \,{\left (a b^{2} - 4 \, a^{2} c\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x}{a + b e^{x} + c e^{2 x}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x}{c e^{\left (2 \, x\right )} + b e^{x} + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate(x/(c*e^(2*x) + b*e^x + a), x)