\(\int \frac {x^2}{2+3 e^x+e^{2 x}} \, dx\) [439]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 18, antiderivative size = 77 \[ \int \frac {x^2}{2+3 e^x+e^{2 x}} \, dx=\frac {x^3}{6}+\frac {1}{2} x^2 \log \left (1+\frac {e^x}{2}\right )-x^2 \log \left (1+e^x\right )-2 x \operatorname {PolyLog}\left (2,-e^x\right )+x \operatorname {PolyLog}\left (2,-\frac {e^x}{2}\right )+2 \operatorname {PolyLog}\left (3,-e^x\right )-\operatorname {PolyLog}\left (3,-\frac {e^x}{2}\right ) \] Output:

1/6*x^3+1/2*x^2*ln(1+1/2*exp(x))-x^2*ln(1+exp(x))-2*x*polylog(2,-exp(x))+x 
*polylog(2,-1/2*exp(x))+2*polylog(3,-exp(x))-polylog(3,-1/2*exp(x))
 

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.00 \[ \int \frac {x^2}{2+3 e^x+e^{2 x}} \, dx=-x^2 \log \left (1+e^{-x}\right )+\frac {1}{2} x^2 \log \left (1+2 e^{-x}\right )-x \operatorname {PolyLog}\left (2,-2 e^{-x}\right )+2 x \operatorname {PolyLog}\left (2,-e^{-x}\right )-\operatorname {PolyLog}\left (3,-2 e^{-x}\right )+2 \operatorname {PolyLog}\left (3,-e^{-x}\right ) \] Input:

Integrate[x^2/(2 + 3*E^x + E^(2*x)),x]
 

Output:

-(x^2*Log[1 + E^(-x)]) + (x^2*Log[1 + 2/E^x])/2 - x*PolyLog[2, -2/E^x] + 2 
*x*PolyLog[2, -E^(-x)] - PolyLog[3, -2/E^x] + 2*PolyLog[3, -E^(-x)]
 

Rubi [A] (verified)

Time = 0.84 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.06, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.389, Rules used = {2693, 27, 2615, 2620, 3011, 2720, 7143}

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^2}{3 e^x+e^{2 x}+2} \, dx\)

\(\Big \downarrow \) 2693

\(\displaystyle 2 \int \frac {x^2}{2 \left (1+e^x\right )}dx-2 \int \frac {x^2}{2 \left (2+e^x\right )}dx\)

\(\Big \downarrow \) 27

\(\displaystyle \int \frac {x^2}{1+e^x}dx-\int \frac {x^2}{2+e^x}dx\)

\(\Big \downarrow \) 2615

\(\displaystyle -\int \frac {e^x x^2}{1+e^x}dx+\frac {1}{2} \int \frac {e^x x^2}{2+e^x}dx+\frac {x^3}{6}\)

\(\Big \downarrow \) 2620

\(\displaystyle \frac {1}{2} \left (x^2 \log \left (\frac {e^x}{2}+1\right )-2 \int x \log \left (1+\frac {e^x}{2}\right )dx\right )+2 \int x \log \left (1+e^x\right )dx+\frac {x^3}{6}-x^2 \log \left (e^x+1\right )\)

\(\Big \downarrow \) 3011

\(\displaystyle \frac {1}{2} \left (x^2 \log \left (\frac {e^x}{2}+1\right )-2 \left (\int \operatorname {PolyLog}\left (2,-\frac {e^x}{2}\right )dx-x \operatorname {PolyLog}\left (2,-\frac {e^x}{2}\right )\right )\right )+2 \left (\int \operatorname {PolyLog}\left (2,-e^x\right )dx-x \operatorname {PolyLog}\left (2,-e^x\right )\right )+\frac {x^3}{6}-x^2 \log \left (e^x+1\right )\)

\(\Big \downarrow \) 2720

\(\displaystyle \frac {1}{2} \left (x^2 \log \left (\frac {e^x}{2}+1\right )-2 \left (\int e^{-x} \operatorname {PolyLog}\left (2,-\frac {e^x}{2}\right )de^x-x \operatorname {PolyLog}\left (2,-\frac {e^x}{2}\right )\right )\right )+2 \left (\int e^{-x} \operatorname {PolyLog}\left (2,-e^x\right )de^x-x \operatorname {PolyLog}\left (2,-e^x\right )\right )+\frac {x^3}{6}-x^2 \log \left (e^x+1\right )\)

\(\Big \downarrow \) 7143

\(\displaystyle \frac {1}{2} \left (x^2 \log \left (\frac {e^x}{2}+1\right )-2 \left (\operatorname {PolyLog}\left (3,-\frac {e^x}{2}\right )-x \operatorname {PolyLog}\left (2,-\frac {e^x}{2}\right )\right )\right )+2 \left (\operatorname {PolyLog}\left (3,-e^x\right )-x \operatorname {PolyLog}\left (2,-e^x\right )\right )+\frac {x^3}{6}-x^2 \log \left (e^x+1\right )\)

Input:

Int[x^2/(2 + 3*E^x + E^(2*x)),x]
 

Output:

x^3/6 - x^2*Log[1 + E^x] + 2*(-(x*PolyLog[2, -E^x]) + PolyLog[3, -E^x]) + 
(x^2*Log[1 + E^x/2] - 2*(-(x*PolyLog[2, -1/2*E^x]) + PolyLog[3, -1/2*E^x]) 
)/2
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2615
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] - Simp[ 
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 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 2693
Int[((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 
/(b - q + 2*c*F^u), x], x] - Simp[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 2720
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Simp[v/D[v, x] 
   Subst[Int[FunctionOfExponentialFunction[u, x]/x, x], x, v], x]] /; Funct 
ionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; FreeQ 
[{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 3011
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] + Simp[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 7143
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S 
ymbol] :> 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]
 
Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.81

method result size
default \(\frac {x^{3}}{6}+\frac {x^{2} \ln \left (1+\frac {{\mathrm e}^{x}}{2}\right )}{2}-x^{2} \ln \left (1+{\mathrm e}^{x}\right )-2 x \operatorname {polylog}\left (2, -{\mathrm e}^{x}\right )+x \operatorname {polylog}\left (2, -\frac {{\mathrm e}^{x}}{2}\right )+2 \operatorname {polylog}\left (3, -{\mathrm e}^{x}\right )-\operatorname {polylog}\left (3, -\frac {{\mathrm e}^{x}}{2}\right )\) \(62\)
risch \(\frac {x^{3}}{6}+\frac {x^{2} \ln \left (1+\frac {{\mathrm e}^{x}}{2}\right )}{2}-x^{2} \ln \left (1+{\mathrm e}^{x}\right )-2 x \operatorname {polylog}\left (2, -{\mathrm e}^{x}\right )+x \operatorname {polylog}\left (2, -\frac {{\mathrm e}^{x}}{2}\right )+2 \operatorname {polylog}\left (3, -{\mathrm e}^{x}\right )-\operatorname {polylog}\left (3, -\frac {{\mathrm e}^{x}}{2}\right )\) \(62\)

Input:

int(x^2/(2+3*exp(x)+exp(2*x)),x,method=_RETURNVERBOSE)
 

Output:

1/6*x^3+1/2*x^2*ln(1+1/2*exp(x))-x^2*ln(1+exp(x))-2*x*polylog(2,-exp(x))+x 
*polylog(2,-1/2*exp(x))+2*polylog(3,-exp(x))-polylog(3,-1/2*exp(x))
 

Fricas [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.77 \[ \int \frac {x^2}{2+3 e^x+e^{2 x}} \, dx=\frac {1}{6} \, x^{3} - x^{2} \log \left (e^{x} + 1\right ) + \frac {1}{2} \, x^{2} \log \left (\frac {1}{2} \, e^{x} + 1\right ) + x {\rm Li}_2\left (-\frac {1}{2} \, e^{x}\right ) - 2 \, x {\rm Li}_2\left (-e^{x}\right ) - {\rm polylog}\left (3, -\frac {1}{2} \, e^{x}\right ) + 2 \, {\rm polylog}\left (3, -e^{x}\right ) \] Input:

integrate(x^2/(2+3*exp(x)+exp(2*x)),x, algorithm="fricas")
 

Output:

1/6*x^3 - x^2*log(e^x + 1) + 1/2*x^2*log(1/2*e^x + 1) + x*dilog(-1/2*e^x) 
- 2*x*dilog(-e^x) - polylog(3, -1/2*e^x) + 2*polylog(3, -e^x)
 

Sympy [F]

\[ \int \frac {x^2}{2+3 e^x+e^{2 x}} \, dx=\int \frac {x^{2}}{\left (e^{x} + 1\right ) \left (e^{x} + 2\right )}\, dx \] Input:

integrate(x**2/(2+3*exp(x)+exp(2*x)),x)
 

Output:

Integral(x**2/((exp(x) + 1)*(exp(x) + 2)), x)
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.77 \[ \int \frac {x^2}{2+3 e^x+e^{2 x}} \, dx=\frac {1}{6} \, x^{3} - x^{2} \log \left (e^{x} + 1\right ) + \frac {1}{2} \, x^{2} \log \left (\frac {1}{2} \, e^{x} + 1\right ) + x {\rm Li}_2\left (-\frac {1}{2} \, e^{x}\right ) - 2 \, x {\rm Li}_2\left (-e^{x}\right ) - {\rm Li}_{3}(-\frac {1}{2} \, e^{x}) + 2 \, {\rm Li}_{3}(-e^{x}) \] Input:

integrate(x^2/(2+3*exp(x)+exp(2*x)),x, algorithm="maxima")
 

Output:

1/6*x^3 - x^2*log(e^x + 1) + 1/2*x^2*log(1/2*e^x + 1) + x*dilog(-1/2*e^x) 
- 2*x*dilog(-e^x) - polylog(3, -1/2*e^x) + 2*polylog(3, -e^x)
 

Giac [F]

\[ \int \frac {x^2}{2+3 e^x+e^{2 x}} \, dx=\int { \frac {x^{2}}{e^{\left (2 \, x\right )} + 3 \, e^{x} + 2} \,d x } \] Input:

integrate(x^2/(2+3*exp(x)+exp(2*x)),x, algorithm="giac")
 

Output:

integrate(x^2/(e^(2*x) + 3*e^x + 2), x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {x^2}{2+3 e^x+e^{2 x}} \, dx=\int \frac {x^2}{{\mathrm {e}}^{2\,x}+3\,{\mathrm {e}}^x+2} \,d x \] Input:

int(x^2/(exp(2*x) + 3*exp(x) + 2),x)
 

Output:

int(x^2/(exp(2*x) + 3*exp(x) + 2), x)
 

Reduce [F]

\[ \int \frac {x^2}{2+3 e^x+e^{2 x}} \, dx=\int \frac {x^{2}}{e^{2 x}+3 e^{x}+2}d x \] Input:

int(x^2/(2+3*exp(x)+exp(2*x)),x)
 

Output:

int(x**2/(e**(2*x) + 3*e**x + 2),x)