3.6.39 \(\int \frac {x^2}{a+b e^{-x}+c e^x} \, dx\) [539]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.34, antiderivative size = 244, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 6, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {2299, 2296, 2221, 2611, 2320, 6724} \begin {gather*} \frac {2 x \text {PolyLog}\left (2,-\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {2 x \text {PolyLog}\left (2,-\frac {2 c e^x}{\sqrt {a^2-4 b c}+a}\right )}{\sqrt {a^2-4 b c}}-\frac {2 \text {PolyLog}\left (3,-\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}+\frac {2 \text {PolyLog}\left (3,-\frac {2 c e^x}{\sqrt {a^2-4 b c}+a}\right )}{\sqrt {a^2-4 b c}}+\frac {x^2 \log \left (\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}+1\right )}{\sqrt {a^2-4 b c}}-\frac {x^2 \log \left (\frac {2 c e^x}{\sqrt {a^2-4 b c}+a}+1\right )}{\sqrt {a^2-4 b c}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2221

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]
 - 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 2296

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 2299

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 2320

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 2611

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

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin {align*} \int \frac {x^2}{a+b e^{-x}+c e^x} \, dx &=\int \frac {e^x x^2}{b+a e^x+c e^{2 x}} \, dx\\ &=\frac {(2 c) \int \frac {e^x x^2}{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^2}{a+\sqrt {a^2-4 b c}+2 c e^x} \, dx}{\sqrt {a^2-4 b c}}\\ &=\frac {x^2 \log \left (1+\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {x^2 \log \left (1+\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {2 \int x \log \left (1+\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right ) \, dx}{\sqrt {a^2-4 b c}}+\frac {2 \int x \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^2 \log \left (1+\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {x^2 \log \left (1+\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}+\frac {2 x \text {Li}_2\left (-\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {2 x \text {Li}_2\left (-\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {2 \int \text {Li}_2\left (-\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right ) \, dx}{\sqrt {a^2-4 b c}}+\frac {2 \int \text {Li}_2\left (-\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right ) \, dx}{\sqrt {a^2-4 b c}}\\ &=\frac {x^2 \log \left (1+\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {x^2 \log \left (1+\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}+\frac {2 x \text {Li}_2\left (-\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {2 x \text {Li}_2\left (-\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {2 \text {Subst}\left (\int \frac {\text {Li}_2\left (\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 {2 \text {Subst}\left (\int \frac {\text {Li}_2\left (-\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^2 \log \left (1+\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {x^2 \log \left (1+\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}+\frac {2 x \text {Li}_2\left (-\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {2 x \text {Li}_2\left (-\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}-\frac {2 \text {Li}_3\left (-\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}}+\frac {2 \text {Li}_3\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.06, size = 185, normalized size = 0.76 \begin {gather*} \frac {x^2 \log \left (1+\frac {2 c e^x}{a-\sqrt {a^2-4 b c}}\right )-x^2 \log \left (1+\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )+2 x \text {Li}_2\left (\frac {2 c e^x}{-a+\sqrt {a^2-4 b c}}\right )-2 x \text {Li}_2\left (-\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )-2 \text {Li}_3\left (\frac {2 c e^x}{-a+\sqrt {a^2-4 b c}}\right )+2 \text {Li}_3\left (-\frac {2 c e^x}{a+\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2/(a+b/exp(x)+c*exp(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(a^2-4*b*c>0)', see `assume?` f
or more deta

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 316, normalized size = 1.30 \begin {gather*} \frac {b x^{2} \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^{2} \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 ) + 2 \, b x \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 ) - 2 \, b x \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 ) - 2 \, b \sqrt {\frac {a^{2} - 4 \, b c}{b^{2}}} {\rm polylog}\left (3, -\frac {b \sqrt {\frac {a^{2} - 4 \, b c}{b^{2}}} e^{x} + a e^{x}}{2 \, b}\right ) + 2 \, b \sqrt {\frac {a^{2} - 4 \, b c}{b^{2}}} {\rm polylog}\left (3, \frac {b \sqrt {\frac {a^{2} - 4 \, b c}{b^{2}}} e^{x} - a e^{x}}{2 \, b}\right )}{a^{2} - 4 \, b c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(b*x^2*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^2*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) + 2*b*x*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) - 2*b*x*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) - 2*b*sqrt((a^2 - 4*b*c)/b^2)*polylog(3, -1/2*(b*sqrt((a^2 - 4*b*c)/b^2
)*e^x + a*e^x)/b) + 2*b*sqrt((a^2 - 4*b*c)/b^2)*polylog(3, 1/2*(b*sqrt((a^2 - 4*b*c)/b^2)*e^x - a*e^x)/b))/(a^
2 - 4*b*c)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________