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

   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 [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 108, antiderivative size = 30 \[ \int \frac {e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (-1-2 x+x^3+e^{-x+\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (1+x-x^2\right )+\frac {e^4 \left (5+10 x-16 x^2+2 x^3\right )}{x+x^2-x^3}\right )}{-1-x+x^2} \, dx=-x+e^{x-\frac {e^4 (-5+x)}{x-(-1+x) x^2}} x \]

[Out]

x/exp(exp(4-ln(x-(-1+x)*x^2))*(-5+x)-x)-x

Rubi [F]

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

[In]

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

[Out]

-x + Defer[Int][E^(x - (E^4*(-5 + x))/(x + x^2 - x^3)), x] - (28*Defer[Int][E^(4 + x - (E^4*(-5 + x))/(x + x^2
 - x^3))/(1 + Sqrt[5] - 2*x)^2, x])/5 + (18*(1 + Sqrt[5])*Defer[Int][E^(4 + x - (E^4*(-5 + x))/(x + x^2 - x^3)
)/(1 + Sqrt[5] - 2*x)^2, x])/5 - (2*Defer[Int][E^(4 + x - (E^4*(-5 + x))/(x + x^2 - x^3))/(1 + Sqrt[5] - 2*x),
 x])/Sqrt[5] - 5*Defer[Int][E^(4 + x - (E^4*(-5 + x))/(x + x^2 - x^3))/x, x] + Defer[Int][E^(x - (E^4*(-5 + x)
)/(x + x^2 - x^3))*x, x] + ((25 - 9*Sqrt[5])*Defer[Int][E^(4 + x - (E^4*(-5 + x))/(x + x^2 - x^3))/(-1 - Sqrt[
5] + 2*x), x])/5 - (28*Defer[Int][E^(4 + x - (E^4*(-5 + x))/(x + x^2 - x^3))/(-1 + Sqrt[5] + 2*x)^2, x])/5 + (
18*(1 - Sqrt[5])*Defer[Int][E^(4 + x - (E^4*(-5 + x))/(x + x^2 - x^3))/(-1 + Sqrt[5] + 2*x)^2, x])/5 - (2*Defe
r[Int][E^(4 + x - (E^4*(-5 + x))/(x + x^2 - x^3))/(-1 + Sqrt[5] + 2*x), x])/Sqrt[5] + ((25 + 9*Sqrt[5])*Defer[
Int][E^(4 + x - (E^4*(-5 + x))/(x + x^2 - x^3))/(-1 + Sqrt[5] + 2*x), x])/5

Rubi steps \begin{align*} \text {integral}& = \int \left (-1+\frac {e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (-5 e^4+\left (1-10 e^4\right ) x+3 \left (1+\frac {16 e^4}{3}\right ) x^2+\left (1-2 e^4\right ) x^3-3 x^4-x^5+x^6\right )}{x \left (1+x-x^2\right )^2}\right ) \, dx \\ & = -x+\int \frac {e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (-5 e^4+\left (1-10 e^4\right ) x+3 \left (1+\frac {16 e^4}{3}\right ) x^2+\left (1-2 e^4\right ) x^3-3 x^4-x^5+x^6\right )}{x \left (1+x-x^2\right )^2} \, dx \\ & = -x+\int \frac {e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (x (1+x) \left (1+x-x^2\right )^2-e^4 \left (5+10 x-16 x^2+2 x^3\right )\right )}{x \left (1+x-x^2\right )^2} \, dx \\ & = -x+\int \left (e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}}-\frac {5 e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{x}+e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} x+\frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}} (-7+9 x)}{\left (-1-x+x^2\right )^2}+\frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}} (-7+5 x)}{-1-x+x^2}\right ) \, dx \\ & = -x-5 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{x} \, dx+\int e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \, dx+\int e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} x \, dx+\int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}} (-7+9 x)}{\left (-1-x+x^2\right )^2} \, dx+\int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}} (-7+5 x)}{-1-x+x^2} \, dx \\ & = -x-5 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{x} \, dx+\int e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \, dx+\int e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} x \, dx+\int \left (\frac {\left (5-\frac {9}{\sqrt {5}}\right ) e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{-1-\sqrt {5}+2 x}+\frac {\left (5+\frac {9}{\sqrt {5}}\right ) e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{-1+\sqrt {5}+2 x}\right ) \, dx+\int \left (-\frac {7 e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{\left (-1-x+x^2\right )^2}+\frac {9 e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}} x}{\left (-1-x+x^2\right )^2}\right ) \, dx \\ & = -x-5 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{x} \, dx-7 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{\left (-1-x+x^2\right )^2} \, dx+9 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}} x}{\left (-1-x+x^2\right )^2} \, dx+\frac {1}{5} \left (25-9 \sqrt {5}\right ) \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{-1-\sqrt {5}+2 x} \, dx+\frac {1}{5} \left (25+9 \sqrt {5}\right ) \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{-1+\sqrt {5}+2 x} \, dx+\int e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \, dx+\int e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} x \, dx \\ & = -x-5 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{x} \, dx-7 \int \left (\frac {4 e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{5 \left (1+\sqrt {5}-2 x\right )^2}+\frac {4 e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{5 \sqrt {5} \left (1+\sqrt {5}-2 x\right )}+\frac {4 e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{5 \left (-1+\sqrt {5}+2 x\right )^2}+\frac {4 e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{5 \sqrt {5} \left (-1+\sqrt {5}+2 x\right )}\right ) \, dx+9 \int \left (\frac {2 \left (1+\sqrt {5}\right ) e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{5 \left (1+\sqrt {5}-2 x\right )^2}+\frac {2 e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{5 \sqrt {5} \left (1+\sqrt {5}-2 x\right )}+\frac {2 \left (1-\sqrt {5}\right ) e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{5 \left (-1+\sqrt {5}+2 x\right )^2}+\frac {2 e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{5 \sqrt {5} \left (-1+\sqrt {5}+2 x\right )}\right ) \, dx+\frac {1}{5} \left (25-9 \sqrt {5}\right ) \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{-1-\sqrt {5}+2 x} \, dx+\frac {1}{5} \left (25+9 \sqrt {5}\right ) \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{-1+\sqrt {5}+2 x} \, dx+\int e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \, dx+\int e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} x \, dx \\ & = -x-5 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{x} \, dx-\frac {28}{5} \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{\left (1+\sqrt {5}-2 x\right )^2} \, dx-\frac {28}{5} \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{\left (-1+\sqrt {5}+2 x\right )^2} \, dx+\frac {18 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{1+\sqrt {5}-2 x} \, dx}{5 \sqrt {5}}+\frac {18 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{-1+\sqrt {5}+2 x} \, dx}{5 \sqrt {5}}-\frac {28 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{1+\sqrt {5}-2 x} \, dx}{5 \sqrt {5}}-\frac {28 \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{-1+\sqrt {5}+2 x} \, dx}{5 \sqrt {5}}+\frac {1}{5} \left (25-9 \sqrt {5}\right ) \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{-1-\sqrt {5}+2 x} \, dx+\frac {1}{5} \left (18 \left (1-\sqrt {5}\right )\right ) \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{\left (-1+\sqrt {5}+2 x\right )^2} \, dx+\frac {1}{5} \left (18 \left (1+\sqrt {5}\right )\right ) \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{\left (1+\sqrt {5}-2 x\right )^2} \, dx+\frac {1}{5} \left (25+9 \sqrt {5}\right ) \int \frac {e^{4+x-\frac {e^4 (-5+x)}{x+x^2-x^3}}}{-1+\sqrt {5}+2 x} \, dx+\int e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \, dx+\int e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} x \, dx \\ \end{align*}

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.72 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.47

method result size
risch \(-x +x \,{\mathrm e}^{\frac {x^{4}-x^{3}+x \,{\mathrm e}^{4}-x^{2}-5 \,{\mathrm e}^{4}}{\left (x^{2}-x -1\right ) x}}\) \(44\)
default \(-x +\frac {\left (x^{3}-x^{2}-x \right ) {\mathrm e}^{-\frac {\left (-5+x \right ) {\mathrm e}^{4}}{-x^{3}+x^{2}+x}+x}}{x^{2}-x -1}\) \(53\)
parts \(-x +\frac {\left (x^{3}-x^{2}-x \right ) {\mathrm e}^{-\frac {\left (-5+x \right ) {\mathrm e}^{4}}{-x^{3}+x^{2}+x}+x}}{x^{2}-x -1}\) \(53\)
parallelrisch \(-\frac {\left (18 \,{\mathrm e}^{\left (-5+x \right ) {\mathrm e}^{-\ln \left (-x^{3}+x^{2}+x \right )+4}-x} x -18 x -9 \,{\mathrm e}^{\left (-5+x \right ) {\mathrm e}^{-\ln \left (-x^{3}+x^{2}+x \right )+4}-x}\right ) {\mathrm e}^{-\frac {\left (-5+x \right ) {\mathrm e}^{4}}{-x^{3}+x^{2}+x}+x}}{18}\) \(89\)
norman \(\frac {\left (x^{3}+{\mathrm e}^{\frac {\left (-5+x \right ) {\mathrm e}^{4}}{-x^{3}+x^{2}+x}-x}+2 x \,{\mathrm e}^{\frac {\left (-5+x \right ) {\mathrm e}^{4}}{-x^{3}+x^{2}+x}-x}-x -x^{2}-x^{3} {\mathrm e}^{\frac {\left (-5+x \right ) {\mathrm e}^{4}}{-x^{3}+x^{2}+x}-x}\right ) {\mathrm e}^{-\frac {\left (-5+x \right ) {\mathrm e}^{4}}{-x^{3}+x^{2}+x}+x}}{x^{2}-x -1}\) \(126\)

[In]

int(((-x^2+x+1)*exp((-5+x)*exp(-ln(-x^3+x^2+x)+4)-x)+(2*x^3-16*x^2+10*x+5)*exp(-ln(-x^3+x^2+x)+4)+x^3-2*x-1)/(
x^2-x-1)/exp((-5+x)*exp(-ln(-x^3+x^2+x)+4)-x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.40 \[ \int \frac {e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (-1-2 x+x^3+e^{-x+\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (1+x-x^2\right )+\frac {e^4 \left (5+10 x-16 x^2+2 x^3\right )}{x+x^2-x^3}\right )}{-1-x+x^2} \, dx=x e^{\left (\frac {x^{4} - x^{3} - x^{2} + {\left (x - 5\right )} e^{4}}{x^{3} - x^{2} - x}\right )} - x \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

integrate(((-x**2+x+1)*exp((-5+x)*exp(-ln(-x**3+x**2+x)+4)-x)+(2*x**3-16*x**2+10*x+5)*exp(-ln(-x**3+x**2+x)+4)
+x**3-2*x-1)/(x**2-x-1)/exp((-5+x)*exp(-ln(-x**3+x**2+x)+4)-x),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.42 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.50 \[ \int \frac {e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (-1-2 x+x^3+e^{-x+\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (1+x-x^2\right )+\frac {e^4 \left (5+10 x-16 x^2+2 x^3\right )}{x+x^2-x^3}\right )}{-1-x+x^2} \, dx=x e^{\left (x - \frac {5 \, x e^{4}}{x^{2} - x - 1} + \frac {6 \, e^{4}}{x^{2} - x - 1} + \frac {5 \, e^{4}}{x}\right )} - x \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.47 \[ \int \frac {e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (-1-2 x+x^3+e^{-x+\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (1+x-x^2\right )+\frac {e^4 \left (5+10 x-16 x^2+2 x^3\right )}{x+x^2-x^3}\right )}{-1-x+x^2} \, dx=x e^{\left (\frac {x^{4} - x^{3} - x^{2} + x e^{4} - 5 \, e^{4}}{x^{3} - x^{2} - x}\right )} - x \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 8.49 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.43 \[ \int \frac {e^{x-\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (-1-2 x+x^3+e^{-x+\frac {e^4 (-5+x)}{x+x^2-x^3}} \left (1+x-x^2\right )+\frac {e^4 \left (5+10 x-16 x^2+2 x^3\right )}{x+x^2-x^3}\right )}{-1-x+x^2} \, dx=x\,{\mathrm {e}}^{\frac {5\,{\mathrm {e}}^4}{-x^3+x^2+x}}\,{\mathrm {e}}^x\,{\mathrm {e}}^{-\frac {x\,{\mathrm {e}}^4}{-x^3+x^2+x}}-x \]

[In]

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

[Out]

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