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

Optimal. Leaf size=276 \[ \frac {2 c \text {Li}_2\left (-\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 {Li}_2\left (-\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 {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*(-4*a*c+b^2)^(1/2))+2*c*x*ln(1+2*c*exp(x)/(b-(-4*a*c+b^2)^(1/2)))/(b^2-4*a*c-b*(-4*a*c+b^2
)^(1/2))+2*c*polylog(2,-2*c*exp(x)/(b-(-4*a*c+b^2)^(1/2)))/(b^2-4*a*c-b*(-4*a*c+b^2)^(1/2))-c*x^2/(b^2-4*a*c+b
*(-4*a*c+b^2)^(1/2))+2*c*x*ln(1+2*c*exp(x)/(b+(-4*a*c+b^2)^(1/2)))/(b^2-4*a*c+b*(-4*a*c+b^2)^(1/2))+2*c*polylo
g(2,-2*c*exp(x)/(b+(-4*a*c+b^2)^(1/2)))/(b^2-4*a*c+b*(-4*a*c+b^2)^(1/2))

________________________________________________________________________________________

Rubi [A]  time = 0.43, antiderivative size = 276, normalized size of antiderivative = 1.00, 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 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 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 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.22, size = 205, normalized size = 0.74 \[ \frac {-\left (\sqrt {b^2-4 a c}+b\right ) \text {Li}_2\left (\frac {2 c e^x}{\sqrt {b^2-4 a c}-b}\right )+\left (b-\sqrt {b^2-4 a c}\right ) \text {Li}_2\left (-\frac {2 c e^x}{b+\sqrt {b^2-4 a c}}\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])

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 280, normalized size = 1.01 \[ \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 )}} \]

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)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x}{c e^{\left (2 \, x\right )} + b e^{x} + a}\,{d x} \]

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)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 378, normalized size = 1.37 \[ -\frac {b x \ln \left (\frac {-2 c \,{\mathrm e}^{x}-b +\sqrt {-4 a c +b^{2}}}{-b +\sqrt {-4 a c +b^{2}}}\right )}{2 \sqrt {-4 a c +b^{2}}\, a}+\frac {b x \ln \left (\frac {2 c \,{\mathrm e}^{x}+b +\sqrt {-4 a c +b^{2}}}{b +\sqrt {-4 a c +b^{2}}}\right )}{2 \sqrt {-4 a c +b^{2}}\, a}-\frac {b \dilog \left (\frac {-2 c \,{\mathrm e}^{x}-b +\sqrt {-4 a c +b^{2}}}{-b +\sqrt {-4 a c +b^{2}}}\right )}{2 \sqrt {-4 a c +b^{2}}\, a}+\frac {b \dilog \left (\frac {2 c \,{\mathrm e}^{x}+b +\sqrt {-4 a c +b^{2}}}{b +\sqrt {-4 a c +b^{2}}}\right )}{2 \sqrt {-4 a c +b^{2}}\, a}+\frac {x^{2}}{2 a}-\frac {x \ln \left (\frac {-2 c \,{\mathrm e}^{x}-b +\sqrt {-4 a c +b^{2}}}{-b +\sqrt {-4 a c +b^{2}}}\right )}{2 a}-\frac {x \ln \left (\frac {2 c \,{\mathrm e}^{x}+b +\sqrt {-4 a c +b^{2}}}{b +\sqrt {-4 a c +b^{2}}}\right )}{2 a}-\frac {\dilog \left (\frac {-2 c \,{\mathrm e}^{x}-b +\sqrt {-4 a c +b^{2}}}{-b +\sqrt {-4 a c +b^{2}}}\right )}{2 a}-\frac {\dilog \left (\frac {2 c \,{\mathrm e}^{x}+b +\sqrt {-4 a c +b^{2}}}{b +\sqrt {-4 a c +b^{2}}}\right )}{2 a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-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*ex
p(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*d
ilog((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-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+1/2/a*x^2

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

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 >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more details)Is 4*a*c-b^2 positive or negative?

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {x}{a+b\,{\mathrm {e}}^x+c\,{\mathrm {e}}^{2\,x}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x}{a + b e^{x} + c e^{2 x}}\, dx \]

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)

________________________________________________________________________________________