\(\int \frac {-2 x^2+e^x (4 x-2 x^2)+e^{1+x} (e^x-x^2)}{5 e^{5+2 x} x^2+20 e^{4+x} x^3+20 e^3 x^4} \, dx\) [8407]

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

Optimal result

Integrand size = 68, antiderivative size = 28 \[ \int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{5 e^{5+2 x} x^2+20 e^{4+x} x^3+20 e^3 x^4} \, dx=\frac {-e^x+x}{5 e^3 x \left (e^{1+x}+2 x\right )} \]

[Out]

1/5/x/exp(3)/(2*x+exp(1+x))*(x-exp(x))

Rubi [F]

\[ \int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{5 e^{5+2 x} x^2+20 e^{4+x} x^3+20 e^3 x^4} \, dx=\int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{5 e^{5+2 x} x^2+20 e^{4+x} x^3+20 e^3 x^4} \, dx \]

[In]

Int[(-2*x^2 + E^x*(4*x - 2*x^2) + E^(1 + x)*(E^x - x^2))/(5*E^(5 + 2*x)*x^2 + 20*E^(4 + x)*x^3 + 20*E^3*x^4),x
]

[Out]

-1/5*1/(E^4*x) - (2*(2 + E)*Defer[Int][(E^(1 + x) + 2*x)^(-2), x])/(5*E^4) + (2*(2 + E)*Defer[Int][x/(E^(1 + x
) + 2*x)^2, x])/(5*E^4) - ((2 + E)*Defer[Int][(E^(1 + x) + 2*x)^(-1), x])/(5*E^4)

Rubi steps \begin{align*} \text {integral}& = \int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{5 e^3 x^2 \left (e^{1+x}+2 x\right )^2} \, dx \\ & = \frac {\int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{x^2 \left (e^{1+x}+2 x\right )^2} \, dx}{5 e^3} \\ & = \frac {\int \left (\frac {1}{e x^2}+\frac {2 (2+e) (-1+x)}{e \left (e^{1+x}+2 x\right )^2}-\frac {2+e}{e \left (e^{1+x}+2 x\right )}\right ) \, dx}{5 e^3} \\ & = -\frac {1}{5 e^4 x}-\frac {(2+e) \int \frac {1}{e^{1+x}+2 x} \, dx}{5 e^4}+\frac {(2 (2+e)) \int \frac {-1+x}{\left (e^{1+x}+2 x\right )^2} \, dx}{5 e^4} \\ & = -\frac {1}{5 e^4 x}-\frac {(2+e) \int \frac {1}{e^{1+x}+2 x} \, dx}{5 e^4}+\frac {(2 (2+e)) \int \left (-\frac {1}{\left (e^{1+x}+2 x\right )^2}+\frac {x}{\left (e^{1+x}+2 x\right )^2}\right ) \, dx}{5 e^4} \\ & = -\frac {1}{5 e^4 x}-\frac {(2+e) \int \frac {1}{e^{1+x}+2 x} \, dx}{5 e^4}-\frac {(2 (2+e)) \int \frac {1}{\left (e^{1+x}+2 x\right )^2} \, dx}{5 e^4}+\frac {(2 (2+e)) \int \frac {x}{\left (e^{1+x}+2 x\right )^2} \, dx}{5 e^4} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.02 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.00 \[ \int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{5 e^{5+2 x} x^2+20 e^{4+x} x^3+20 e^3 x^4} \, dx=\frac {-e^x+x}{5 e^3 x \left (e^{1+x}+2 x\right )} \]

[In]

Integrate[(-2*x^2 + E^x*(4*x - 2*x^2) + E^(1 + x)*(E^x - x^2))/(5*E^(5 + 2*x)*x^2 + 20*E^(4 + x)*x^3 + 20*E^3*
x^4),x]

[Out]

(-E^x + x)/(5*E^3*x*(E^(1 + x) + 2*x))

Maple [A] (verified)

Time = 0.79 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.93

method result size
parallelrisch \(\frac {{\mathrm e}^{-3} \left (x -{\mathrm e}^{x}\right )}{5 x \left (2 x +{\mathrm e}^{1+x}\right )}\) \(26\)
norman \(\frac {\frac {{\mathrm e}^{-3} x}{5}-\frac {{\mathrm e}^{-3} {\mathrm e}^{x}}{5}}{x \left ({\mathrm e} \,{\mathrm e}^{x}+2 x \right )}\) \(32\)
risch \(-\frac {{\mathrm e}^{-4}}{5 x}+\frac {{\mathrm e}^{-4} {\mathrm e}}{10 x +5 \,{\mathrm e}^{1+x}}+\frac {2 \,{\mathrm e}^{-4}}{5 \left (2 x +{\mathrm e}^{1+x}\right )}\) \(39\)
parts \(\frac {{\mathrm e}^{-3}}{10 x +5 \,{\mathrm e}^{1+x}}-\frac {{\mathrm e}^{-3} {\mathrm e}^{x}}{5 x \left ({\mathrm e} \,{\mathrm e}^{x}+2 x \right )}\) \(40\)

[In]

int(((exp(x)-x^2)*exp(1+x)+(-2*x^2+4*x)*exp(x)-2*x^2)/(5*x^2*exp(3)*exp(1+x)^2+20*x^3*exp(3)*exp(1+x)+20*x^4*e
xp(3)),x,method=_RETURNVERBOSE)

[Out]

1/5/x/exp(3)/(2*x+exp(1+x))*(x-exp(x))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.04 \[ \int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{5 e^{5+2 x} x^2+20 e^{4+x} x^3+20 e^3 x^4} \, dx=\frac {x e^{4} - e^{\left (x + 4\right )}}{5 \, {\left (2 \, x^{2} e^{7} + x e^{\left (x + 8\right )}\right )}} \]

[In]

integrate(((exp(x)-x^2)*exp(1+x)+(-2*x^2+4*x)*exp(x)-2*x^2)/(5*x^2*exp(3)*exp(1+x)^2+20*x^3*exp(3)*exp(1+x)+20
*x^4*exp(3)),x, algorithm="fricas")

[Out]

1/5*(x*e^4 - e^(x + 4))/(2*x^2*e^7 + x*e^(x + 8))

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.96 \[ \int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{5 e^{5+2 x} x^2+20 e^{4+x} x^3+20 e^3 x^4} \, dx=\frac {2 + e}{10 x e^{4} + 5 e^{5} e^{x}} - \frac {1}{5 x e^{4}} \]

[In]

integrate(((exp(x)-x**2)*exp(1+x)+(-2*x**2+4*x)*exp(x)-2*x**2)/(5*x**2*exp(3)*exp(1+x)**2+20*x**3*exp(3)*exp(1
+x)+20*x**4*exp(3)),x)

[Out]

(2 + E)/(10*x*exp(4) + 5*exp(5)*exp(x)) - exp(-4)/(5*x)

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.86 \[ \int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{5 e^{5+2 x} x^2+20 e^{4+x} x^3+20 e^3 x^4} \, dx=\frac {x - e^{x}}{5 \, {\left (2 \, x^{2} e^{3} + x e^{\left (x + 4\right )}\right )}} \]

[In]

integrate(((exp(x)-x^2)*exp(1+x)+(-2*x^2+4*x)*exp(x)-2*x^2)/(5*x^2*exp(3)*exp(1+x)^2+20*x^3*exp(3)*exp(1+x)+20
*x^4*exp(3)),x, algorithm="maxima")

[Out]

1/5*(x - e^x)/(2*x^2*e^3 + x*e^(x + 4))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 211 vs. \(2 (23) = 46\).

Time = 0.29 (sec) , antiderivative size = 211, normalized size of antiderivative = 7.54 \[ \int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{5 e^{5+2 x} x^2+20 e^{4+x} x^3+20 e^3 x^4} \, dx=\frac {2 \, {\left (x + 4\right )}^{3} e^{7} - 26 \, {\left (x + 4\right )}^{2} e^{7} + {\left (x + 4\right )}^{2} e^{\left (x + 8\right )} - 2 \, {\left (x + 4\right )}^{2} e^{\left (x + 7\right )} + 112 \, {\left (x + 4\right )} e^{7} - {\left (x + 4\right )} e^{\left (2 \, x + 8\right )} - 9 \, {\left (x + 4\right )} e^{\left (x + 8\right )} + 18 \, {\left (x + 4\right )} e^{\left (x + 7\right )} - 160 \, e^{7} + 5 \, e^{\left (2 \, x + 8\right )} + 20 \, e^{\left (x + 8\right )} - 40 \, e^{\left (x + 7\right )}}{5 \, {\left (4 \, {\left (x + 4\right )}^{4} e^{10} - 68 \, {\left (x + 4\right )}^{3} e^{10} + 4 \, {\left (x + 4\right )}^{3} e^{\left (x + 11\right )} + 432 \, {\left (x + 4\right )}^{2} e^{10} + {\left (x + 4\right )}^{2} e^{\left (2 \, x + 12\right )} - 52 \, {\left (x + 4\right )}^{2} e^{\left (x + 11\right )} - 1216 \, {\left (x + 4\right )} e^{10} - 9 \, {\left (x + 4\right )} e^{\left (2 \, x + 12\right )} + 224 \, {\left (x + 4\right )} e^{\left (x + 11\right )} + 1280 \, e^{10} + 20 \, e^{\left (2 \, x + 12\right )} - 320 \, e^{\left (x + 11\right )}\right )}} \]

[In]

integrate(((exp(x)-x^2)*exp(1+x)+(-2*x^2+4*x)*exp(x)-2*x^2)/(5*x^2*exp(3)*exp(1+x)^2+20*x^3*exp(3)*exp(1+x)+20
*x^4*exp(3)),x, algorithm="giac")

[Out]

1/5*(2*(x + 4)^3*e^7 - 26*(x + 4)^2*e^7 + (x + 4)^2*e^(x + 8) - 2*(x + 4)^2*e^(x + 7) + 112*(x + 4)*e^7 - (x +
 4)*e^(2*x + 8) - 9*(x + 4)*e^(x + 8) + 18*(x + 4)*e^(x + 7) - 160*e^7 + 5*e^(2*x + 8) + 20*e^(x + 8) - 40*e^(
x + 7))/(4*(x + 4)^4*e^10 - 68*(x + 4)^3*e^10 + 4*(x + 4)^3*e^(x + 11) + 432*(x + 4)^2*e^10 + (x + 4)^2*e^(2*x
 + 12) - 52*(x + 4)^2*e^(x + 11) - 1216*(x + 4)*e^10 - 9*(x + 4)*e^(2*x + 12) + 224*(x + 4)*e^(x + 11) + 1280*
e^10 + 20*e^(2*x + 12) - 320*e^(x + 11))

Mupad [B] (verification not implemented)

Time = 13.49 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.82 \[ \int \frac {-2 x^2+e^x \left (4 x-2 x^2\right )+e^{1+x} \left (e^x-x^2\right )}{5 e^{5+2 x} x^2+20 e^{4+x} x^3+20 e^3 x^4} \, dx=\frac {x-{\mathrm {e}}^x}{5\,x\,\left ({\mathrm {e}}^{x+4}+2\,x\,{\mathrm {e}}^3\right )} \]

[In]

int((exp(x + 1)*(exp(x) - x^2) + exp(x)*(4*x - 2*x^2) - 2*x^2)/(20*x^4*exp(3) + 5*x^2*exp(3)*exp(2*x + 2) + 20
*x^3*exp(x + 1)*exp(3)),x)

[Out]

(x - exp(x))/(5*x*(exp(x + 4) + 2*x*exp(3)))