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

Optimal. Leaf size=391 \[ \frac{4 c x \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{4 c x \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{4 c \text{PolyLog}\left (3,-\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{4 c \text{PolyLog}\left (3,-\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{2 c x^3}{3 \left (-b \sqrt{b^2-4 a c}-4 a c+b^2\right )}-\frac{2 c x^3}{3 \left (b \sqrt{b^2-4 a c}-4 a c+b^2\right )}+\frac{2 c x^2 \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^2 \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]

(-2*c*x^3)/(3*(b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c])) - (2*c*x^3)/(3*(b^2 - 4*a*c +
 b*Sqrt[b^2 - 4*a*c])) + (2*c*x^2*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^2*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]) + (4*c*x*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]) + (4*c*x*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]) - (4*c*Po
lyLog[3, (-2*c*E^x)/(b - Sqrt[b^2 - 4*a*c])])/(b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c]
) - (4*c*PolyLog[3, (-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.992374, antiderivative size = 391, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 6, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.3 \[ \frac{4 c x \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{4 c x \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{4 c \text{PolyLog}\left (3,-\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{4 c \text{PolyLog}\left (3,-\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{2 c x^3}{3 \left (-b \sqrt{b^2-4 a c}-4 a c+b^2\right )}-\frac{2 c x^3}{3 \left (b \sqrt{b^2-4 a c}-4 a c+b^2\right )}+\frac{2 c x^2 \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^2 \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^2/(a + b*E^x + c*E^(2*x)),x]

[Out]

(-2*c*x^3)/(3*(b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c])) - (2*c*x^3)/(3*(b^2 - 4*a*c +
 b*Sqrt[b^2 - 4*a*c])) + (2*c*x^2*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^2*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]) + (4*c*x*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]) + (4*c*x*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]) - (4*c*Po
lyLog[3, (-2*c*E^x)/(b - Sqrt[b^2 - 4*a*c])])/(b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c]
) - (4*c*PolyLog[3, (-2*c*E^x)/(b + Sqrt[b^2 - 4*a*c])])/(b^2 - 4*a*c + b*Sqrt[b
^2 - 4*a*c])

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 66.489, size = 304, normalized size = 0.78 \[ \frac{2 c x^{2} \log{\left (1 + \frac{\left (b + \sqrt{- 4 a c + b^{2}}\right ) e^{- x}}{2 c} \right )}}{- 4 a c + b^{2} + b \sqrt{- 4 a c + b^{2}}} + \frac{2 c x^{2} \log{\left (1 + \frac{\left (b - \sqrt{- 4 a c + b^{2}}\right ) e^{- x}}{2 c} \right )}}{- 4 a c + b^{2} - b \sqrt{- 4 a c + b^{2}}} - \frac{4 c x \operatorname{Li}_{2}\left (- \frac{\left (b + \sqrt{- 4 a c + b^{2}}\right ) e^{- x}}{2 c}\right )}{- 4 a c + b^{2} + b \sqrt{- 4 a c + b^{2}}} - \frac{4 c x \operatorname{Li}_{2}\left (- \frac{\left (b - \sqrt{- 4 a c + b^{2}}\right ) e^{- x}}{2 c}\right )}{- 4 a c + b^{2} - b \sqrt{- 4 a c + b^{2}}} - \frac{4 c \operatorname{Li}_{3}\left (- \frac{\left (b + \sqrt{- 4 a c + b^{2}}\right ) e^{- x}}{2 c}\right )}{- 4 a c + b^{2} + b \sqrt{- 4 a c + b^{2}}} - \frac{4 c \operatorname{Li}_{3}\left (- \frac{\left (b - \sqrt{- 4 a c + b^{2}}\right ) e^{- x}}{2 c}\right )}{- 4 a c + b^{2} - b \sqrt{- 4 a c + b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(x**2/(a+b*exp(x)+c*exp(2*x)),x)

[Out]

2*c*x**2*log(1 + (b + sqrt(-4*a*c + b**2))*exp(-x)/(2*c))/(-4*a*c + b**2 + b*sqr
t(-4*a*c + b**2)) + 2*c*x**2*log(1 + (b - sqrt(-4*a*c + b**2))*exp(-x)/(2*c))/(-
4*a*c + b**2 - b*sqrt(-4*a*c + b**2)) - 4*c*x*polylog(2, -(b + sqrt(-4*a*c + b**
2))*exp(-x)/(2*c))/(-4*a*c + b**2 + b*sqrt(-4*a*c + b**2)) - 4*c*x*polylog(2, -(
b - sqrt(-4*a*c + b**2))*exp(-x)/(2*c))/(-4*a*c + b**2 - b*sqrt(-4*a*c + b**2))
- 4*c*polylog(3, -(b + sqrt(-4*a*c + b**2))*exp(-x)/(2*c))/(-4*a*c + b**2 + b*sq
rt(-4*a*c + b**2)) - 4*c*polylog(3, -(b - sqrt(-4*a*c + b**2))*exp(-x)/(2*c))/(-
4*a*c + b**2 - b*sqrt(-4*a*c + b**2))

_______________________________________________________________________________________

Mathematica [A]  time = 0.254885, size = 407, normalized size = 1.04 \[ \frac{-6 x \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 )+6 x \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 )+6 b \text{PolyLog}\left (3,\frac{2 c e^x}{\sqrt{b^2-4 a c}-b}\right )+6 \sqrt{b^2-4 a c} \text{PolyLog}\left (3,\frac{2 c e^x}{\sqrt{b^2-4 a c}-b}\right )-6 b \text{PolyLog}\left (3,-\frac{2 c e^x}{\sqrt{b^2-4 a c}+b}\right )+6 \sqrt{b^2-4 a c} \text{PolyLog}\left (3,-\frac{2 c e^x}{\sqrt{b^2-4 a c}+b}\right )+2 x^3 \sqrt{b^2-4 a c}-3 b x^2 \log \left (\frac{2 c e^x}{b-\sqrt{b^2-4 a c}}+1\right )-3 x^2 \sqrt{b^2-4 a c} \log \left (\frac{2 c e^x}{b-\sqrt{b^2-4 a c}}+1\right )+3 b x^2 \log \left (\frac{2 c e^x}{\sqrt{b^2-4 a c}+b}+1\right )-3 x^2 \sqrt{b^2-4 a c} \log \left (\frac{2 c e^x}{\sqrt{b^2-4 a c}+b}+1\right )}{6 a \sqrt{b^2-4 a c}} \]

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

Maple [F]  time = 0.04, size = 0, normalized size = 0. \[ \int{\frac{{x}^{2}}{a+b{{\rm e}^{x}}+c{{\rm e}^{2\,x}}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x^2/(c*e^(2*x) + b*e^x + a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

_______________________________________________________________________________________

Fricas [A]  time = 0.292679, size = 632, normalized size = 1.62 \[ \frac{2 \,{\left (b^{2} - 4 \, a c\right )} x^{3} + 6 \,{\left (a b x \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} -{\left (b^{2} - 4 \, a c\right )} x\right )}{\rm Li}_2\left (-\frac{2 \, c e^{x} + a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} + b}{a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} + b} + 1\right ) - 6 \,{\left (a b x \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} +{\left (b^{2} - 4 \, a c\right )} x\right )}{\rm Li}_2\left (\frac{2 \, c e^{x} - a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} + b}{a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} - b} + 1\right ) + 3 \,{\left (a b x^{2} \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} -{\left (b^{2} - 4 \, a c\right )} x^{2}\right )} \log \left (\frac{2 \, c e^{x} + a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} + b}{a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} + b}\right ) - 3 \,{\left (a b x^{2} \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} +{\left (b^{2} - 4 \, a c\right )} x^{2}\right )} \log \left (-\frac{2 \, c e^{x} - a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} + b}{a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} - b}\right ) - 6 \,{\left (a b \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} - b^{2} + 4 \, a c\right )}{\rm Li}_{3}(-\frac{2 \, c e^{x}}{a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} + b}) + 6 \,{\left (a b \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} + b^{2} - 4 \, a c\right )}{\rm Li}_{3}(\frac{2 \, c e^{x}}{a \sqrt{\frac{b^{2} - 4 \, a c}{a^{2}}} - b})}{6 \,{\left (a b^{2} - 4 \, a^{2} c\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x^2/(c*e^(2*x) + b*e^x + a),x, algorithm="fricas")

[Out]

1/6*(2*(b^2 - 4*a*c)*x^3 + 6*(a*b*x*sqrt((b^2 - 4*a*c)/a^2) - (b^2 - 4*a*c)*x)*d
ilog(-(2*c*e^x + a*sqrt((b^2 - 4*a*c)/a^2) + b)/(a*sqrt((b^2 - 4*a*c)/a^2) + b)
+ 1) - 6*(a*b*x*sqrt((b^2 - 4*a*c)/a^2) + (b^2 - 4*a*c)*x)*dilog((2*c*e^x - a*sq
rt((b^2 - 4*a*c)/a^2) + b)/(a*sqrt((b^2 - 4*a*c)/a^2) - b) + 1) + 3*(a*b*x^2*sqr
t((b^2 - 4*a*c)/a^2) - (b^2 - 4*a*c)*x^2)*log((2*c*e^x + a*sqrt((b^2 - 4*a*c)/a^
2) + b)/(a*sqrt((b^2 - 4*a*c)/a^2) + b)) - 3*(a*b*x^2*sqrt((b^2 - 4*a*c)/a^2) +
(b^2 - 4*a*c)*x^2)*log(-(2*c*e^x - a*sqrt((b^2 - 4*a*c)/a^2) + b)/(a*sqrt((b^2 -
 4*a*c)/a^2) - b)) - 6*(a*b*sqrt((b^2 - 4*a*c)/a^2) - b^2 + 4*a*c)*polylog(3, -2
*c*e^x/(a*sqrt((b^2 - 4*a*c)/a^2) + b)) + 6*(a*b*sqrt((b^2 - 4*a*c)/a^2) + b^2 -
 4*a*c)*polylog(3, 2*c*e^x/(a*sqrt((b^2 - 4*a*c)/a^2) - b)))/(a*b^2 - 4*a^2*c)

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{x^{2}}{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^2/(c*e^(2*x) + b*e^x + a),x, algorithm="giac")

[Out]

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