\(\int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} (1-20 x^3)+e^{-2+2 x} (3+3 x+30 x^2-70 x^3-60 x^4)+e^{-1+x} (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5)}{1+e^{-3+3 x}+3 x+3 x^2+x^3+e^{-2+2 x} (3+3 x)+e^{-1+x} (3+6 x+3 x^2)} \, dx\) [7727]

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

Optimal result

Integrand size = 156, antiderivative size = 24 \[ \int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )}{1+e^{-3+3 x}+3 x+3 x^2+x^3+e^{-2+2 x} (3+3 x)+e^{-1+x} \left (3+6 x+3 x^2\right )} \, dx=2+x-5 \left (x^2-\frac {x}{1+e^{-1+x}+x}\right )^2 \]

[Out]

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

Rubi [F]

\[ \int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )}{1+e^{-3+3 x}+3 x+3 x^2+x^3+e^{-2+2 x} (3+3 x)+e^{-1+x} \left (3+6 x+3 x^2\right )} \, dx=\int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )}{1+e^{-3+3 x}+3 x+3 x^2+x^3+e^{-2+2 x} (3+3 x)+e^{-1+x} \left (3+6 x+3 x^2\right )} \, dx \]

[In]

Int[(1 - 7*x + 33*x^2 + 31*x^3 - 40*x^4 - 60*x^5 - 20*x^6 + E^(-3 + 3*x)*(1 - 20*x^3) + E^(-2 + 2*x)*(3 + 3*x
+ 30*x^2 - 70*x^3 - 60*x^4) + E^(-1 + x)*(3 - 4*x + 73*x^2 - 20*x^3 - 130*x^4 - 60*x^5))/(1 + E^(-3 + 3*x) + 3
*x + 3*x^2 + x^3 + E^(-2 + 2*x)*(3 + 3*x) + E^(-1 + x)*(3 + 6*x + 3*x^2)),x]

[Out]

x - 5*x^4 - 10*E^3*Defer[Int][x^3/(E + E^x + E*x)^3, x] - 10*E^2*Defer[Int][x/(E + E^x + E*x)^2, x] + 10*E^2*D
efer[Int][x^2/(E + E^x + E*x)^2, x] + 10*E^2*Defer[Int][x^4/(E + E^x + E*x)^2, x] + 30*E*Defer[Int][x^2/(E + E
^x + E*x), x] - 10*E*Defer[Int][x^3/(E + E^x + E*x), x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {e^3 \left (1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )\right )}{\left (e+e^x+e x\right )^3} \, dx \\ & = e^3 \int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )}{\left (e+e^x+e x\right )^3} \, dx \\ & = e^3 \int \left (-\frac {10 x^3}{\left (e+e^x+e x\right )^3}-\frac {10 (-3+x) x^2}{e^2 \left (e+e^x+e x\right )}+\frac {1-20 x^3}{e^3}+\frac {10 x \left (-1+x+x^3\right )}{e \left (e+e^x+e x\right )^2}\right ) \, dx \\ & = -\left ((10 e) \int \frac {(-3+x) x^2}{e+e^x+e x} \, dx\right )+\left (10 e^2\right ) \int \frac {x \left (-1+x+x^3\right )}{\left (e+e^x+e x\right )^2} \, dx-\left (10 e^3\right ) \int \frac {x^3}{\left (e+e^x+e x\right )^3} \, dx+\int \left (1-20 x^3\right ) \, dx \\ & = x-5 x^4-(10 e) \int \left (-\frac {3 x^2}{e+e^x+e x}+\frac {x^3}{e+e^x+e x}\right ) \, dx+\left (10 e^2\right ) \int \left (-\frac {x}{\left (e+e^x+e x\right )^2}+\frac {x^2}{\left (e+e^x+e x\right )^2}+\frac {x^4}{\left (e+e^x+e x\right )^2}\right ) \, dx-\left (10 e^3\right ) \int \frac {x^3}{\left (e+e^x+e x\right )^3} \, dx \\ & = x-5 x^4-(10 e) \int \frac {x^3}{e+e^x+e x} \, dx+(30 e) \int \frac {x^2}{e+e^x+e x} \, dx-\left (10 e^2\right ) \int \frac {x}{\left (e+e^x+e x\right )^2} \, dx+\left (10 e^2\right ) \int \frac {x^2}{\left (e+e^x+e x\right )^2} \, dx+\left (10 e^2\right ) \int \frac {x^4}{\left (e+e^x+e x\right )^2} \, dx-\left (10 e^3\right ) \int \frac {x^3}{\left (e+e^x+e x\right )^3} \, dx \\ \end{align*}

Mathematica [A] (verified)

Time = 4.93 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.71 \[ \int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )}{1+e^{-3+3 x}+3 x+3 x^2+x^3+e^{-2+2 x} (3+3 x)+e^{-1+x} \left (3+6 x+3 x^2\right )} \, dx=x-5 x^4-\frac {5 e^2 x^2}{\left (e+e^x+e x\right )^2}+\frac {10 e x^3}{e+e^x+e x} \]

[In]

Integrate[(1 - 7*x + 33*x^2 + 31*x^3 - 40*x^4 - 60*x^5 - 20*x^6 + E^(-3 + 3*x)*(1 - 20*x^3) + E^(-2 + 2*x)*(3
+ 3*x + 30*x^2 - 70*x^3 - 60*x^4) + E^(-1 + x)*(3 - 4*x + 73*x^2 - 20*x^3 - 130*x^4 - 60*x^5))/(1 + E^(-3 + 3*
x) + 3*x + 3*x^2 + x^3 + E^(-2 + 2*x)*(3 + 3*x) + E^(-1 + x)*(3 + 6*x + 3*x^2)),x]

[Out]

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

Maple [A] (verified)

Time = 0.32 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.62

method result size
risch \(-5 x^{4}+x +\frac {5 x^{2} \left (2 x^{2}+2 x \,{\mathrm e}^{-1+x}+2 x -1\right )}{\left (1+x +{\mathrm e}^{-1+x}\right )^{2}}\) \(39\)
norman \(\frac {{\mathrm e}^{-2+2 x} x +3 \,{\mathrm e}^{-2+2 x}+6 \,{\mathrm e}^{-1+x}+7 x +8 x \,{\mathrm e}^{-1+x}+11 x^{3}+5 x^{4}-10 x^{5}-5 x^{6}+2 x^{2} {\mathrm e}^{-1+x}+10 x^{3} {\mathrm e}^{-1+x}-10 x^{4} {\mathrm e}^{-1+x}-10 \,{\mathrm e}^{-1+x} x^{5}-5 \,{\mathrm e}^{-2+2 x} x^{4}+3}{\left (1+x +{\mathrm e}^{-1+x}\right )^{2}}\) \(112\)
parallelrisch \(-\frac {5 x^{6}+10 \,{\mathrm e}^{-1+x} x^{5}+5 \,{\mathrm e}^{-2+2 x} x^{4}+10 x^{5}+10 x^{4} {\mathrm e}^{-1+x}-5 x^{4}-10 x^{3} {\mathrm e}^{-1+x}-11 x^{3}-2 x^{2} {\mathrm e}^{-1+x}-{\mathrm e}^{-2+2 x} x +3 x^{2}-2 x \,{\mathrm e}^{-1+x}-x}{x^{2}+2 x \,{\mathrm e}^{-1+x}+{\mathrm e}^{-2+2 x}+2 x +2 \,{\mathrm e}^{-1+x}+1}\) \(124\)

[In]

int(((-20*x^3+1)*exp(-1+x)^3+(-60*x^4-70*x^3+30*x^2+3*x+3)*exp(-1+x)^2+(-60*x^5-130*x^4-20*x^3+73*x^2-4*x+3)*e
xp(-1+x)-20*x^6-60*x^5-40*x^4+31*x^3+33*x^2-7*x+1)/(exp(-1+x)^3+(3*x+3)*exp(-1+x)^2+(3*x^2+6*x+3)*exp(-1+x)+x^
3+3*x^2+3*x+1),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

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

Time = 0.31 (sec) , antiderivative size = 102, normalized size of antiderivative = 4.25 \[ \int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )}{1+e^{-3+3 x}+3 x+3 x^2+x^3+e^{-2+2 x} (3+3 x)+e^{-1+x} \left (3+6 x+3 x^2\right )} \, dx=-\frac {5 \, x^{6} + 10 \, x^{5} - 5 \, x^{4} - 11 \, x^{3} + 3 \, x^{2} + {\left (5 \, x^{4} - x\right )} e^{\left (2 \, x - 2\right )} + 2 \, {\left (5 \, x^{5} + 5 \, x^{4} - 5 \, x^{3} - x^{2} - x\right )} e^{\left (x - 1\right )} - x}{x^{2} + 2 \, {\left (x + 1\right )} e^{\left (x - 1\right )} + 2 \, x + e^{\left (2 \, x - 2\right )} + 1} \]

[In]

integrate(((-20*x^3+1)*exp(-1+x)^3+(-60*x^4-70*x^3+30*x^2+3*x+3)*exp(-1+x)^2+(-60*x^5-130*x^4-20*x^3+73*x^2-4*
x+3)*exp(-1+x)-20*x^6-60*x^5-40*x^4+31*x^3+33*x^2-7*x+1)/(exp(-1+x)^3+(3*x+3)*exp(-1+x)^2+(3*x^2+6*x+3)*exp(-1
+x)+x^3+3*x^2+3*x+1),x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (19) = 38\).

Time = 0.11 (sec) , antiderivative size = 56, normalized size of antiderivative = 2.33 \[ \int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )}{1+e^{-3+3 x}+3 x+3 x^2+x^3+e^{-2+2 x} (3+3 x)+e^{-1+x} \left (3+6 x+3 x^2\right )} \, dx=- 5 x^{4} + x + \frac {10 x^{4} + 10 x^{3} e^{x - 1} + 10 x^{3} - 5 x^{2}}{x^{2} + 2 x + \left (2 x + 2\right ) e^{x - 1} + e^{2 x - 2} + 1} \]

[In]

integrate(((-20*x**3+1)*exp(-1+x)**3+(-60*x**4-70*x**3+30*x**2+3*x+3)*exp(-1+x)**2+(-60*x**5-130*x**4-20*x**3+
73*x**2-4*x+3)*exp(-1+x)-20*x**6-60*x**5-40*x**4+31*x**3+33*x**2-7*x+1)/(exp(-1+x)**3+(3*x+3)*exp(-1+x)**2+(3*
x**2+6*x+3)*exp(-1+x)+x**3+3*x**2+3*x+1),x)

[Out]

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

Maxima [B] (verification not implemented)

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

Time = 0.25 (sec) , antiderivative size = 126, normalized size of antiderivative = 5.25 \[ \int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )}{1+e^{-3+3 x}+3 x+3 x^2+x^3+e^{-2+2 x} (3+3 x)+e^{-1+x} \left (3+6 x+3 x^2\right )} \, dx=-\frac {5 \, x^{6} e^{2} + 10 \, x^{5} e^{2} - 5 \, x^{4} e^{2} - 11 \, x^{3} e^{2} + 3 \, x^{2} e^{2} - x e^{2} + {\left (5 \, x^{4} - x\right )} e^{\left (2 \, x\right )} + 2 \, {\left (5 \, x^{5} e + 5 \, x^{4} e - 5 \, x^{3} e - x^{2} e - x e\right )} e^{x}}{x^{2} e^{2} + 2 \, x e^{2} + 2 \, {\left (x e + e\right )} e^{x} + e^{2} + e^{\left (2 \, x\right )}} \]

[In]

integrate(((-20*x^3+1)*exp(-1+x)^3+(-60*x^4-70*x^3+30*x^2+3*x+3)*exp(-1+x)^2+(-60*x^5-130*x^4-20*x^3+73*x^2-4*
x+3)*exp(-1+x)-20*x^6-60*x^5-40*x^4+31*x^3+33*x^2-7*x+1)/(exp(-1+x)^3+(3*x+3)*exp(-1+x)^2+(3*x^2+6*x+3)*exp(-1
+x)+x^3+3*x^2+3*x+1),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

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

Time = 0.29 (sec) , antiderivative size = 135, normalized size of antiderivative = 5.62 \[ \int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )}{1+e^{-3+3 x}+3 x+3 x^2+x^3+e^{-2+2 x} (3+3 x)+e^{-1+x} \left (3+6 x+3 x^2\right )} \, dx=-\frac {5 \, x^{6} e^{2} + 10 \, x^{5} e^{2} + 10 \, x^{5} e^{\left (x + 1\right )} - 5 \, x^{4} e^{2} + 5 \, x^{4} e^{\left (2 \, x\right )} + 10 \, x^{4} e^{\left (x + 1\right )} - 11 \, x^{3} e^{2} - 10 \, x^{3} e^{\left (x + 1\right )} + 3 \, x^{2} e^{2} - 2 \, x^{2} e^{\left (x + 1\right )} - x e^{2} - x e^{\left (2 \, x\right )} - 2 \, x e^{\left (x + 1\right )}}{x^{2} e^{2} + 2 \, x e^{2} + 2 \, x e^{\left (x + 1\right )} + e^{2} + e^{\left (2 \, x\right )} + 2 \, e^{\left (x + 1\right )}} \]

[In]

integrate(((-20*x^3+1)*exp(-1+x)^3+(-60*x^4-70*x^3+30*x^2+3*x+3)*exp(-1+x)^2+(-60*x^5-130*x^4-20*x^3+73*x^2-4*
x+3)*exp(-1+x)-20*x^6-60*x^5-40*x^4+31*x^3+33*x^2-7*x+1)/(exp(-1+x)^3+(3*x+3)*exp(-1+x)^2+(3*x^2+6*x+3)*exp(-1
+x)+x^3+3*x^2+3*x+1),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 14.71 (sec) , antiderivative size = 85, normalized size of antiderivative = 3.54 \[ \int \frac {1-7 x+33 x^2+31 x^3-40 x^4-60 x^5-20 x^6+e^{-3+3 x} \left (1-20 x^3\right )+e^{-2+2 x} \left (3+3 x+30 x^2-70 x^3-60 x^4\right )+e^{-1+x} \left (3-4 x+73 x^2-20 x^3-130 x^4-60 x^5\right )}{1+e^{-3+3 x}+3 x+3 x^2+x^3+e^{-2+2 x} (3+3 x)+e^{-1+x} \left (3+6 x+3 x^2\right )} \, dx=-\frac {x\,\left (3\,x-{\mathrm {e}}^{2\,x-2}+5\,x^3\,{\mathrm {e}}^{2\,x-2}-11\,x^2-5\,x^3+10\,x^4+5\,x^5-1\right )-x\,{\mathrm {e}}^{x-1}\,\left (-10\,x^4-10\,x^3+10\,x^2+2\,x+2\right )}{{\left (x+{\mathrm {e}}^{x-1}+1\right )}^2} \]

[In]

int(-(7*x + exp(3*x - 3)*(20*x^3 - 1) + exp(x - 1)*(4*x - 73*x^2 + 20*x^3 + 130*x^4 + 60*x^5 - 3) - exp(2*x -
2)*(3*x + 30*x^2 - 70*x^3 - 60*x^4 + 3) - 33*x^2 - 31*x^3 + 40*x^4 + 60*x^5 + 20*x^6 - 1)/(3*x + exp(3*x - 3)
+ exp(x - 1)*(6*x + 3*x^2 + 3) + exp(2*x - 2)*(3*x + 3) + 3*x^2 + x^3 + 1),x)

[Out]

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