\(\int \frac {-\frac {e^{-4+4 x}}{x^4}+\frac {4 e^{-3+3 x}}{x^2}-17 x^2+34 x^3-x^4+\frac {e^{-2+2 x} (-30 x+26 x^2)}{x^2}+\frac {e^{-1+x} (-4 x^2-28 x^3)}{x}}{-4 e^{-3+3 x}+\frac {e^{-4+4 x}}{x^2}+x^4-2 x^5+x^6+\frac {e^{-2+2 x} (-2 x^3+6 x^4)}{x^2}+\frac {e^{-1+x} (4 x^4-4 x^5)}{x}} \, dx\) [9311]

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

Optimal result

Integrand size = 157, antiderivative size = 31 \[ \int \frac {-\frac {e^{-4+4 x}}{x^4}+\frac {4 e^{-3+3 x}}{x^2}-17 x^2+34 x^3-x^4+\frac {e^{-2+2 x} \left (-30 x+26 x^2\right )}{x^2}+\frac {e^{-1+x} \left (-4 x^2-28 x^3\right )}{x}}{-4 e^{-3+3 x}+\frac {e^{-4+4 x}}{x^2}+x^4-2 x^5+x^6+\frac {e^{-2+2 x} \left (-2 x^3+6 x^4\right )}{x^2}+\frac {e^{-1+x} \left (4 x^4-4 x^5\right )}{x}} \, dx=1+\frac {1}{x}+4 \left (4+\frac {4}{x-\left (-\frac {e^{-1+x}}{x}+x\right )^2}\right ) \]

[Out]

17+1/x+16/(x-(x-exp(x-ln(x)-1))^2)

Rubi [F]

\[ \int \frac {-\frac {e^{-4+4 x}}{x^4}+\frac {4 e^{-3+3 x}}{x^2}-17 x^2+34 x^3-x^4+\frac {e^{-2+2 x} \left (-30 x+26 x^2\right )}{x^2}+\frac {e^{-1+x} \left (-4 x^2-28 x^3\right )}{x}}{-4 e^{-3+3 x}+\frac {e^{-4+4 x}}{x^2}+x^4-2 x^5+x^6+\frac {e^{-2+2 x} \left (-2 x^3+6 x^4\right )}{x^2}+\frac {e^{-1+x} \left (4 x^4-4 x^5\right )}{x}} \, dx=\int \frac {-\frac {e^{-4+4 x}}{x^4}+\frac {4 e^{-3+3 x}}{x^2}-17 x^2+34 x^3-x^4+\frac {e^{-2+2 x} \left (-30 x+26 x^2\right )}{x^2}+\frac {e^{-1+x} \left (-4 x^2-28 x^3\right )}{x}}{-4 e^{-3+3 x}+\frac {e^{-4+4 x}}{x^2}+x^4-2 x^5+x^6+\frac {e^{-2+2 x} \left (-2 x^3+6 x^4\right )}{x^2}+\frac {e^{-1+x} \left (4 x^4-4 x^5\right )}{x}} \, dx \]

[In]

Int[(-(E^(-4 + 4*x)/x^4) + (4*E^(-3 + 3*x))/x^2 - 17*x^2 + 34*x^3 - x^4 + (E^(-2 + 2*x)*(-30*x + 26*x^2))/x^2
+ (E^(-1 + x)*(-4*x^2 - 28*x^3))/x)/(-4*E^(-3 + 3*x) + E^(-4 + 4*x)/x^2 + x^4 - 2*x^5 + x^6 + (E^(-2 + 2*x)*(-
2*x^3 + 6*x^4))/x^2 + (E^(-1 + x)*(4*x^4 - 4*x^5))/x),x]

[Out]

x^(-1) - 64*E^3*Defer[Int][(E^x*x^3)/(E^(2*x) - 2*E^(1 + x)*x^2 - E^2*x^3 + E^2*x^4)^2, x] - 48*E^4*Defer[Int]
[x^4/(E^(2*x) - 2*E^(1 + x)*x^2 - E^2*x^3 + E^2*x^4)^2, x] + 32*E^3*Defer[Int][(E^x*x^4)/(E^(2*x) - 2*E^(1 + x
)*x^2 - E^2*x^3 + E^2*x^4)^2, x] + 96*E^4*Defer[Int][x^5/(E^(2*x) - 2*E^(1 + x)*x^2 - E^2*x^3 + E^2*x^4)^2, x]
 - 32*E^4*Defer[Int][x^6/(E^(2*x) - 2*E^(1 + x)*x^2 - E^2*x^3 + E^2*x^4)^2, x] - 32*E^2*Defer[Int][x/(E^(2*x)
- 2*E^(1 + x)*x^2 - E^2*x^3 + E^2*x^4), x] + 32*E^2*Defer[Int][x^2/(E^(2*x) - 2*E^(1 + x)*x^2 - E^2*x^3 + E^2*
x^4), x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {-e^{4 x}+4 e^{1+3 x} x^2-4 e^{3+x} x^5 (1+7 x)+2 e^{2+2 x} x^3 (-15+13 x)-e^4 x^6 \left (17-34 x+x^2\right )}{x^2 \left (e^{2 x}-2 e^{1+x} x^2+e^2 (-1+x) x^3\right )^2} \, dx \\ & = \int \left (-\frac {1}{x^2}-\frac {16 e^3 x^3 \left (4 e^x+3 e x-2 e^x x-6 e x^2+2 e x^3\right )}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2}+\frac {32 e^2 (-1+x) x}{e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4}\right ) \, dx \\ & = \frac {1}{x}+\left (32 e^2\right ) \int \frac {(-1+x) x}{e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4} \, dx-\left (16 e^3\right ) \int \frac {x^3 \left (4 e^x+3 e x-2 e^x x-6 e x^2+2 e x^3\right )}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2} \, dx \\ & = \frac {1}{x}+\left (32 e^2\right ) \int \left (-\frac {x}{e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4}+\frac {x^2}{e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4}\right ) \, dx-\left (16 e^3\right ) \int \left (\frac {4 e^x x^3}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2}+\frac {3 e x^4}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2}-\frac {2 e^x x^4}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2}-\frac {6 e x^5}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2}+\frac {2 e x^6}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2}\right ) \, dx \\ & = \frac {1}{x}-\left (32 e^2\right ) \int \frac {x}{e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4} \, dx+\left (32 e^2\right ) \int \frac {x^2}{e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4} \, dx+\left (32 e^3\right ) \int \frac {e^x x^4}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2} \, dx-\left (64 e^3\right ) \int \frac {e^x x^3}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2} \, dx-\left (32 e^4\right ) \int \frac {x^6}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2} \, dx-\left (48 e^4\right ) \int \frac {x^4}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2} \, dx+\left (96 e^4\right ) \int \frac {x^5}{\left (e^{2 x}-2 e^{1+x} x^2-e^2 x^3+e^2 x^4\right )^2} \, dx \\ \end{align*}

Mathematica [A] (verified)

Time = 8.79 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.29 \[ \int \frac {-\frac {e^{-4+4 x}}{x^4}+\frac {4 e^{-3+3 x}}{x^2}-17 x^2+34 x^3-x^4+\frac {e^{-2+2 x} \left (-30 x+26 x^2\right )}{x^2}+\frac {e^{-1+x} \left (-4 x^2-28 x^3\right )}{x}}{-4 e^{-3+3 x}+\frac {e^{-4+4 x}}{x^2}+x^4-2 x^5+x^6+\frac {e^{-2+2 x} \left (-2 x^3+6 x^4\right )}{x^2}+\frac {e^{-1+x} \left (4 x^4-4 x^5\right )}{x}} \, dx=\frac {1}{x}-\frac {16 e^2 x^2}{e^{2 x}-2 e^{1+x} x^2+e^2 (-1+x) x^3} \]

[In]

Integrate[(-(E^(-4 + 4*x)/x^4) + (4*E^(-3 + 3*x))/x^2 - 17*x^2 + 34*x^3 - x^4 + (E^(-2 + 2*x)*(-30*x + 26*x^2)
)/x^2 + (E^(-1 + x)*(-4*x^2 - 28*x^3))/x)/(-4*E^(-3 + 3*x) + E^(-4 + 4*x)/x^2 + x^4 - 2*x^5 + x^6 + (E^(-2 + 2
*x)*(-2*x^3 + 6*x^4))/x^2 + (E^(-1 + x)*(4*x^4 - 4*x^5))/x),x]

[Out]

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

Maple [A] (verified)

Time = 0.39 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.03

method result size
risch \(\frac {1}{x}-\frac {16}{\frac {{\mathrm e}^{-2+2 x}}{x^{2}}-2 \,{\mathrm e}^{-1+x}+x^{2}-x}\) \(32\)
parallelrisch \(\frac {x^{2}-2 x \,{\mathrm e}^{x -\ln \left (x \right )-1}+\frac {{\mathrm e}^{-2+2 x}}{x^{2}}-17 x}{x \left (\frac {{\mathrm e}^{-2+2 x}}{x^{2}}-2 x \,{\mathrm e}^{x -\ln \left (x \right )-1}+x^{2}-x \right )}\) \(63\)

[In]

int((-exp(x-ln(x)-1)^4+4*x*exp(x-ln(x)-1)^3+(26*x^2-30*x)*exp(x-ln(x)-1)^2+(-28*x^3-4*x^2)*exp(x-ln(x)-1)-x^4+
34*x^3-17*x^2)/(x^2*exp(x-ln(x)-1)^4-4*x^3*exp(x-ln(x)-1)^3+(6*x^4-2*x^3)*exp(x-ln(x)-1)^2+(-4*x^5+4*x^4)*exp(
x-ln(x)-1)+x^6-2*x^5+x^4),x,method=_RETURNVERBOSE)

[Out]

1/x-16/(1/x^2*exp(-2+2*x)-2*exp(-1+x)+x^2-x)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (27) = 54\).

Time = 0.26 (sec) , antiderivative size = 65, normalized size of antiderivative = 2.10 \[ \int \frac {-\frac {e^{-4+4 x}}{x^4}+\frac {4 e^{-3+3 x}}{x^2}-17 x^2+34 x^3-x^4+\frac {e^{-2+2 x} \left (-30 x+26 x^2\right )}{x^2}+\frac {e^{-1+x} \left (-4 x^2-28 x^3\right )}{x}}{-4 e^{-3+3 x}+\frac {e^{-4+4 x}}{x^2}+x^4-2 x^5+x^6+\frac {e^{-2+2 x} \left (-2 x^3+6 x^4\right )}{x^2}+\frac {e^{-1+x} \left (4 x^4-4 x^5\right )}{x}} \, dx=\frac {x^{2} - 2 \, x e^{\left (x - \log \left (x\right ) - 1\right )} - 17 \, x + e^{\left (2 \, x - 2 \, \log \left (x\right ) - 2\right )}}{x^{3} - 2 \, x^{2} e^{\left (x - \log \left (x\right ) - 1\right )} - x^{2} + x e^{\left (2 \, x - 2 \, \log \left (x\right ) - 2\right )}} \]

[In]

integrate((-exp(x-log(x)-1)^4+4*x*exp(x-log(x)-1)^3+(26*x^2-30*x)*exp(x-log(x)-1)^2+(-28*x^3-4*x^2)*exp(x-log(
x)-1)-x^4+34*x^3-17*x^2)/(x^2*exp(x-log(x)-1)^4-4*x^3*exp(x-log(x)-1)^3+(6*x^4-2*x^3)*exp(x-log(x)-1)^2+(-4*x^
5+4*x^4)*exp(x-log(x)-1)+x^6-2*x^5+x^4),x, algorithm="fricas")

[Out]

(x^2 - 2*x*e^(x - log(x) - 1) - 17*x + e^(2*x - 2*log(x) - 2))/(x^3 - 2*x^2*e^(x - log(x) - 1) - x^2 + x*e^(2*
x - 2*log(x) - 2))

Sympy [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00 \[ \int \frac {-\frac {e^{-4+4 x}}{x^4}+\frac {4 e^{-3+3 x}}{x^2}-17 x^2+34 x^3-x^4+\frac {e^{-2+2 x} \left (-30 x+26 x^2\right )}{x^2}+\frac {e^{-1+x} \left (-4 x^2-28 x^3\right )}{x}}{-4 e^{-3+3 x}+\frac {e^{-4+4 x}}{x^2}+x^4-2 x^5+x^6+\frac {e^{-2+2 x} \left (-2 x^3+6 x^4\right )}{x^2}+\frac {e^{-1+x} \left (4 x^4-4 x^5\right )}{x}} \, dx=- \frac {16 x^{2}}{x^{4} - x^{3} - 2 x^{2} e^{x - 1} + e^{2 x - 2}} + \frac {1}{x} \]

[In]

integrate((-exp(x-ln(x)-1)**4+4*x*exp(x-ln(x)-1)**3+(26*x**2-30*x)*exp(x-ln(x)-1)**2+(-28*x**3-4*x**2)*exp(x-l
n(x)-1)-x**4+34*x**3-17*x**2)/(x**2*exp(x-ln(x)-1)**4-4*x**3*exp(x-ln(x)-1)**3+(6*x**4-2*x**3)*exp(x-ln(x)-1)*
*2+(-4*x**5+4*x**4)*exp(x-ln(x)-1)+x**6-2*x**5+x**4),x)

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 59 vs. \(2 (27) = 54\).

Time = 0.26 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.90 \[ \int \frac {-\frac {e^{-4+4 x}}{x^4}+\frac {4 e^{-3+3 x}}{x^2}-17 x^2+34 x^3-x^4+\frac {e^{-2+2 x} \left (-30 x+26 x^2\right )}{x^2}+\frac {e^{-1+x} \left (-4 x^2-28 x^3\right )}{x}}{-4 e^{-3+3 x}+\frac {e^{-4+4 x}}{x^2}+x^4-2 x^5+x^6+\frac {e^{-2+2 x} \left (-2 x^3+6 x^4\right )}{x^2}+\frac {e^{-1+x} \left (4 x^4-4 x^5\right )}{x}} \, dx=\frac {x^{4} e^{2} - 17 \, x^{3} e^{2} - 2 \, x^{2} e^{\left (x + 1\right )} + e^{\left (2 \, x\right )}}{x^{5} e^{2} - x^{4} e^{2} - 2 \, x^{3} e^{\left (x + 1\right )} + x e^{\left (2 \, x\right )}} \]

[In]

integrate((-exp(x-log(x)-1)^4+4*x*exp(x-log(x)-1)^3+(26*x^2-30*x)*exp(x-log(x)-1)^2+(-28*x^3-4*x^2)*exp(x-log(
x)-1)-x^4+34*x^3-17*x^2)/(x^2*exp(x-log(x)-1)^4-4*x^3*exp(x-log(x)-1)^3+(6*x^4-2*x^3)*exp(x-log(x)-1)^2+(-4*x^
5+4*x^4)*exp(x-log(x)-1)+x^6-2*x^5+x^4),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 59 vs. \(2 (27) = 54\).

Time = 0.33 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.90 \[ \int \frac {-\frac {e^{-4+4 x}}{x^4}+\frac {4 e^{-3+3 x}}{x^2}-17 x^2+34 x^3-x^4+\frac {e^{-2+2 x} \left (-30 x+26 x^2\right )}{x^2}+\frac {e^{-1+x} \left (-4 x^2-28 x^3\right )}{x}}{-4 e^{-3+3 x}+\frac {e^{-4+4 x}}{x^2}+x^4-2 x^5+x^6+\frac {e^{-2+2 x} \left (-2 x^3+6 x^4\right )}{x^2}+\frac {e^{-1+x} \left (4 x^4-4 x^5\right )}{x}} \, dx=\frac {x^{4} e^{2} - 33 \, x^{3} e^{2} - 2 \, x^{2} e^{\left (x + 1\right )} + e^{\left (2 \, x\right )}}{x^{5} e^{2} - x^{4} e^{2} - 2 \, x^{3} e^{\left (x + 1\right )} + x e^{\left (2 \, x\right )}} \]

[In]

integrate((-exp(x-log(x)-1)^4+4*x*exp(x-log(x)-1)^3+(26*x^2-30*x)*exp(x-log(x)-1)^2+(-28*x^3-4*x^2)*exp(x-log(
x)-1)-x^4+34*x^3-17*x^2)/(x^2*exp(x-log(x)-1)^4-4*x^3*exp(x-log(x)-1)^3+(6*x^4-2*x^3)*exp(x-log(x)-1)^2+(-4*x^
5+4*x^4)*exp(x-log(x)-1)+x^6-2*x^5+x^4),x, algorithm="giac")

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \frac {-\frac {e^{-4+4 x}}{x^4}+\frac {4 e^{-3+3 x}}{x^2}-17 x^2+34 x^3-x^4+\frac {e^{-2+2 x} \left (-30 x+26 x^2\right )}{x^2}+\frac {e^{-1+x} \left (-4 x^2-28 x^3\right )}{x}}{-4 e^{-3+3 x}+\frac {e^{-4+4 x}}{x^2}+x^4-2 x^5+x^6+\frac {e^{-2+2 x} \left (-2 x^3+6 x^4\right )}{x^2}+\frac {e^{-1+x} \left (4 x^4-4 x^5\right )}{x}} \, dx=\int -\frac {{\mathrm {e}}^{4\,x-4\,\ln \left (x\right )-4}+{\mathrm {e}}^{2\,x-2\,\ln \left (x\right )-2}\,\left (30\,x-26\,x^2\right )+{\mathrm {e}}^{x-\ln \left (x\right )-1}\,\left (28\,x^3+4\,x^2\right )-4\,x\,{\mathrm {e}}^{3\,x-3\,\ln \left (x\right )-3}+17\,x^2-34\,x^3+x^4}{x^2\,{\mathrm {e}}^{4\,x-4\,\ln \left (x\right )-4}-4\,x^3\,{\mathrm {e}}^{3\,x-3\,\ln \left (x\right )-3}-{\mathrm {e}}^{2\,x-2\,\ln \left (x\right )-2}\,\left (2\,x^3-6\,x^4\right )+{\mathrm {e}}^{x-\ln \left (x\right )-1}\,\left (4\,x^4-4\,x^5\right )+x^4-2\,x^5+x^6} \,d x \]

[In]

int(-(exp(4*x - 4*log(x) - 4) + exp(2*x - 2*log(x) - 2)*(30*x - 26*x^2) + exp(x - log(x) - 1)*(4*x^2 + 28*x^3)
 - 4*x*exp(3*x - 3*log(x) - 3) + 17*x^2 - 34*x^3 + x^4)/(x^2*exp(4*x - 4*log(x) - 4) - 4*x^3*exp(3*x - 3*log(x
) - 3) - exp(2*x - 2*log(x) - 2)*(2*x^3 - 6*x^4) + exp(x - log(x) - 1)*(4*x^4 - 4*x^5) + x^4 - 2*x^5 + x^6),x)

[Out]

int(-(exp(4*x - 4*log(x) - 4) + exp(2*x - 2*log(x) - 2)*(30*x - 26*x^2) + exp(x - log(x) - 1)*(4*x^2 + 28*x^3)
 - 4*x*exp(3*x - 3*log(x) - 3) + 17*x^2 - 34*x^3 + x^4)/(x^2*exp(4*x - 4*log(x) - 4) - 4*x^3*exp(3*x - 3*log(x
) - 3) - exp(2*x - 2*log(x) - 2)*(2*x^3 - 6*x^4) + exp(x - log(x) - 1)*(4*x^4 - 4*x^5) + x^4 - 2*x^5 + x^6), x
)