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

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2267

Int[(u_)/((a_) + (b_.)*(F_)^(v_) + (c_.)*(F_)^(w_)), x_Symbol] :> Int[(u*F^v)/(c + a*F^v + b*F^(2*v)), x] /; F
reeQ[{F, a, b, c}, x] && EqQ[w, -v] && LinearQ[v, x] && If[RationalQ[Coefficient[v, x, 1]], GtQ[Coefficient[v,
 x, 1], 0], LtQ[LeafCount[v], LeafCount[w]]]

Rule 2264

Int[((F_)^(u_)*((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*F^u)/(b - q + 2*c*F^u), x], x] - Dist[(2*c)/q, Int[((f +
g*x)^m*F^u)/(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 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^x} \, dx &=\int \frac{e^x x}{b+a e^x+c e^{2 x}} \, dx\\ &=\frac{(2 c) \int \frac{e^x x}{a-\sqrt{a^2-4 b c}+2 c e^x} \, dx}{\sqrt{a^2-4 b c}}-\frac{(2 c) \int \frac{e^x x}{a+\sqrt{a^2-4 b c}+2 c e^x} \, dx}{\sqrt{a^2-4 b c}}\\ &=\frac{x \log \left (1+\frac{2 c e^x}{a-\sqrt{a^2-4 b c}}\right )}{\sqrt{a^2-4 b c}}-\frac{x \log \left (1+\frac{2 c e^x}{a+\sqrt{a^2-4 b c}}\right )}{\sqrt{a^2-4 b c}}-\frac{\int \log \left (1+\frac{2 c e^x}{a-\sqrt{a^2-4 b c}}\right ) \, dx}{\sqrt{a^2-4 b c}}+\frac{\int \log \left (1+\frac{2 c e^x}{a+\sqrt{a^2-4 b c}}\right ) \, dx}{\sqrt{a^2-4 b c}}\\ &=\frac{x \log \left (1+\frac{2 c e^x}{a-\sqrt{a^2-4 b c}}\right )}{\sqrt{a^2-4 b c}}-\frac{x \log \left (1+\frac{2 c e^x}{a+\sqrt{a^2-4 b c}}\right )}{\sqrt{a^2-4 b c}}-\frac{\operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 c x}{a-\sqrt{a^2-4 b c}}\right )}{x} \, dx,x,e^x\right )}{\sqrt{a^2-4 b c}}+\frac{\operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 c x}{a+\sqrt{a^2-4 b c}}\right )}{x} \, dx,x,e^x\right )}{\sqrt{a^2-4 b c}}\\ &=\frac{x \log \left (1+\frac{2 c e^x}{a-\sqrt{a^2-4 b c}}\right )}{\sqrt{a^2-4 b c}}-\frac{x \log \left (1+\frac{2 c e^x}{a+\sqrt{a^2-4 b c}}\right )}{\sqrt{a^2-4 b c}}+\frac{\text{Li}_2\left (-\frac{2 c e^x}{a-\sqrt{a^2-4 b c}}\right )}{\sqrt{a^2-4 b c}}-\frac{\text{Li}_2\left (-\frac{2 c e^x}{a+\sqrt{a^2-4 b c}}\right )}{\sqrt{a^2-4 b c}}\\ \end{align*}

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.008, size = 181, normalized size = 1.1 \begin{align*} -{x \left ( \ln \left ({ \left ( 2\,c{{\rm e}^{x}}+\sqrt{{a}^{2}-4\,bc}+a \right ) \left ( a+\sqrt{{a}^{2}-4\,bc} \right ) ^{-1}} \right ) -\ln \left ({ \left ( -2\,c{{\rm e}^{x}}+\sqrt{{a}^{2}-4\,bc}-a \right ) \left ( -a+\sqrt{{a}^{2}-4\,bc} \right ) ^{-1}} \right ) \right ){\frac{1}{\sqrt{{a}^{2}-4\,bc}}}}+{{\it dilog} \left ({ \left ( -2\,c{{\rm e}^{x}}+\sqrt{{a}^{2}-4\,bc}-a \right ) \left ( -a+\sqrt{{a}^{2}-4\,bc} \right ) ^{-1}} \right ){\frac{1}{\sqrt{{a}^{2}-4\,bc}}}}-{{\it dilog} \left ({ \left ( 2\,c{{\rm e}^{x}}+\sqrt{{a}^{2}-4\,bc}+a \right ) \left ( a+\sqrt{{a}^{2}-4\,bc} \right ) ^{-1}} \right ){\frac{1}{\sqrt{{a}^{2}-4\,bc}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x e^{x}}{a e^{x} + b + 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(x)),x)

[Out]

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

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x}{b e^{\left (-x\right )} + c 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(x)),x, algorithm="giac")

[Out]

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