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

3.6.38.1 Optimal result
3.6.38.2 Mathematica [A] (verified)
3.6.38.3 Rubi [A] (verified)
3.6.38.4 Maple [A] (verified)
3.6.38.5 Fricas [A] (verification not implemented)
3.6.38.6 Sympy [F]
3.6.38.7 Maxima [F(-2)]
3.6.38.8 Giac [F]
3.6.38.9 Mupad [F(-1)]

3.6.38.1 Optimal result

Integrand size = 18, antiderivative size = 159 \[ \int \frac {x}{a+b e^{-x}+c e^x} \, dx=\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 {PolyLog}\left (2,-\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {\operatorname {PolyLog}\left (2,-\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}} \]

output
x*ln(1+2*c*exp(x)/(a-(a^2-4*b*c)^(1/2)))/(a^2-4*b*c)^(1/2)-x*ln(1+2*c*exp( 
x)/(a+(a^2-4*b*c)^(1/2)))/(a^2-4*b*c)^(1/2)+polylog(2,-2*c*exp(x)/(a-(a^2- 
4*b*c)^(1/2)))/(a^2-4*b*c)^(1/2)-polylog(2,-2*c*exp(x)/(a+(a^2-4*b*c)^(1/2 
)))/(a^2-4*b*c)^(1/2)
 
3.6.38.2 Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.77 \[ \int \frac {x}{a+b e^{-x}+c e^x} \, dx=\frac {x \left (\log \left (1+\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )-\log \left (1+\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )\right )+\operatorname {PolyLog}\left (2,\frac {2 c e^x}{-a+\sqrt {a^2-4 b c}}\right )-\operatorname {PolyLog}\left (2,-\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}} \]

input
Integrate[x/(a + b/E^x + c*E^x),x]
 
output
(x*(Log[1 + (2*c*E^x)/(a - Sqrt[a^2 - 4*b*c])] - Log[1 + (2*c*E^x)/(a + Sq 
rt[a^2 - 4*b*c])]) + PolyLog[2, (2*c*E^x)/(-a + Sqrt[a^2 - 4*b*c])] - Poly 
Log[2, (-2*c*E^x)/(a + Sqrt[a^2 - 4*b*c])])/Sqrt[a^2 - 4*b*c]
 
3.6.38.3 Rubi [A] (verified)

Time = 0.62 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.04, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {2697, 2694, 2620, 2715, 2838}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

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

\(\Big \downarrow \) 2697

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

\(\Big \downarrow \) 2694

\(\displaystyle \frac {2 c \int \frac {e^x x}{a+2 c e^x-\sqrt {a^2-4 b c}}dx}{\sqrt {a^2-4 b c}}-\frac {2 c \int \frac {e^x x}{a+2 c e^x+\sqrt {a^2-4 b c}}dx}{\sqrt {a^2-4 b c}}\)

\(\Big \downarrow \) 2620

\(\displaystyle \frac {2 c \left (\frac {x \log \left (\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}+1\right )}{2 c}-\frac {\int \log \left (\frac {2 e^x c}{a-\sqrt {a^2-4 b c}}+1\right )dx}{2 c}\right )}{\sqrt {a^2-4 b c}}-\frac {2 c \left (\frac {x \log \left (\frac {2 c e^x}{\sqrt {a^2-4 b c}+a}+1\right )}{2 c}-\frac {\int \log \left (\frac {2 e^x c}{a+\sqrt {a^2-4 b c}}+1\right )dx}{2 c}\right )}{\sqrt {a^2-4 b c}}\)

\(\Big \downarrow \) 2715

\(\displaystyle \frac {2 c \left (\frac {x \log \left (\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}+1\right )}{2 c}-\frac {\int e^{-x} \log \left (\frac {2 e^x c}{a-\sqrt {a^2-4 b c}}+1\right )de^x}{2 c}\right )}{\sqrt {a^2-4 b c}}-\frac {2 c \left (\frac {x \log \left (\frac {2 c e^x}{\sqrt {a^2-4 b c}+a}+1\right )}{2 c}-\frac {\int e^{-x} \log \left (\frac {2 e^x c}{a+\sqrt {a^2-4 b c}}+1\right )de^x}{2 c}\right )}{\sqrt {a^2-4 b c}}\)

\(\Big \downarrow \) 2838

\(\displaystyle \frac {2 c \left (\frac {\operatorname {PolyLog}\left (2,-\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{2 c}+\frac {x \log \left (\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}+1\right )}{2 c}\right )}{\sqrt {a^2-4 b c}}-\frac {2 c \left (\frac {\operatorname {PolyLog}\left (2,-\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{2 c}+\frac {x \log \left (\frac {2 c e^x}{\sqrt {a^2-4 b c}+a}+1\right )}{2 c}\right )}{\sqrt {a^2-4 b c}}\)

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

3.6.38.3.1 Defintions of rubi rules used

rule 2620
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/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si 
mp[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 2694
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]}, Simp[2*(c/q)   Int 
[(f + g*x)^m*(F^u/(b - q + 2*c*F^u)), x], x] - Simp[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 2697
Int[(u_)/((a_) + (b_.)*(F_)^(v_) + (c_.)*(F_)^(w_)), x_Symbol] :> Int[u*(F^ 
v/(c + a*F^v + b*F^(2*v))), x] /; FreeQ[{F, a, b, c}, x] && EqQ[w, -v] && L 
inearQ[v, x] && If[RationalQ[D[v, x]], GtQ[D[v, x], 0], LtQ[LeafCount[v], L 
eafCount[w]]]
 

rule 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[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 2838
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]
 
3.6.38.4 Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.08

method result size
default \(\frac {x \left (\ln \left (\frac {-2 c \,{\mathrm e}^{x}+\sqrt {a^{2}-4 c b}-a}{-a +\sqrt {a^{2}-4 c b}}\right )-\ln \left (\frac {2 c \,{\mathrm e}^{x}+\sqrt {a^{2}-4 c b}+a}{a +\sqrt {a^{2}-4 c b}}\right )\right )}{\sqrt {a^{2}-4 c b}}+\frac {\operatorname {dilog}\left (\frac {-2 c \,{\mathrm e}^{x}+\sqrt {a^{2}-4 c b}-a}{-a +\sqrt {a^{2}-4 c b}}\right )-\operatorname {dilog}\left (\frac {2 c \,{\mathrm e}^{x}+\sqrt {a^{2}-4 c b}+a}{a +\sqrt {a^{2}-4 c b}}\right )}{\sqrt {a^{2}-4 c b}}\) \(171\)
risch \(\frac {x \left (\ln \left (\frac {-2 c \,{\mathrm e}^{x}+\sqrt {a^{2}-4 c b}-a}{-a +\sqrt {a^{2}-4 c b}}\right )-\ln \left (\frac {2 c \,{\mathrm e}^{x}+\sqrt {a^{2}-4 c b}+a}{a +\sqrt {a^{2}-4 c b}}\right )\right )}{\sqrt {a^{2}-4 c b}}+\frac {\operatorname {dilog}\left (\frac {-2 c \,{\mathrm e}^{x}+\sqrt {a^{2}-4 c b}-a}{-a +\sqrt {a^{2}-4 c b}}\right )}{\sqrt {a^{2}-4 c b}}-\frac {\operatorname {dilog}\left (\frac {2 c \,{\mathrm e}^{x}+\sqrt {a^{2}-4 c b}+a}{a +\sqrt {a^{2}-4 c b}}\right )}{\sqrt {a^{2}-4 c b}}\) \(180\)

input
int(x/(a+b/exp(x)+c*exp(x)),x,method=_RETURNVERBOSE)
 
output
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*ex 
p(x)+(a^2-4*b*c)^(1/2)+a)/(a+(a^2-4*b*c)^(1/2))))/(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)))-dilog((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)
 
3.6.38.5 Fricas [A] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 214, normalized size of antiderivative = 1.35 \[ \int \frac {x}{a+b e^{-x}+c e^x} \, dx=\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} \]

input
integrate(x/(a+b/exp(x)+c*exp(x)),x, algorithm="fricas")
 
output
(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)*di 
log(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 
)
 
3.6.38.6 Sympy [F]

\[ \int \frac {x}{a+b e^{-x}+c e^x} \, dx=\int \frac {x e^{x}}{a e^{x} + b + c e^{2 x}}\, dx \]

input
integrate(x/(a+b/exp(x)+c*exp(x)),x)
 
output
Integral(x*exp(x)/(a*exp(x) + b + c*exp(2*x)), x)
 
3.6.38.7 Maxima [F(-2)]

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

input
integrate(x/(a+b/exp(x)+c*exp(x)),x, algorithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(a^2-4*b*c>0)', see `assume?` for 
 more deta
 
3.6.38.8 Giac [F]

\[ \int \frac {x}{a+b e^{-x}+c e^x} \, dx=\int { \frac {x}{b e^{\left (-x\right )} + c e^{x} + a} \,d x } \]

input
integrate(x/(a+b/exp(x)+c*exp(x)),x, algorithm="giac")
 
output
integrate(x/(b*e^(-x) + c*e^x + a), x)
 
3.6.38.9 Mupad [F(-1)]

Timed out. \[ \int \frac {x}{a+b e^{-x}+c e^x} \, dx=\int \frac {x}{a+c\,{\mathrm {e}}^x+b\,{\mathrm {e}}^{-x}} \,d x \]

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