\(\int \frac {-9 x^2+18 x^3-9 x^4+e^{\frac {2}{-1+x}} (9 x^2-24 x^3+9 x^4)}{1-2 x+x^2} \, dx\) [6550]

   Optimal result
   Rubi [B] (verified)
   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 = 53, antiderivative size = 16 \[ \int \frac {-9 x^2+18 x^3-9 x^4+e^{\frac {2}{-1+x}} \left (9 x^2-24 x^3+9 x^4\right )}{1-2 x+x^2} \, dx=3 \left (-1+e^{\frac {2}{-1+x}}\right ) x^3 \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(77\) vs. \(2(16)=32\).

Time = 0.37 (sec) , antiderivative size = 77, normalized size of antiderivative = 4.81, number of steps used = 29, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.189, Rules used = {27, 6820, 12, 14, 6874, 2237, 2241, 2240, 2258, 2245} \[ \int \frac {-9 x^2+18 x^3-9 x^4+e^{\frac {2}{-1+x}} \left (9 x^2-24 x^3+9 x^4\right )}{1-2 x+x^2} \, dx=-3 x^3-3 e^{-\frac {2}{1-x}} (1-x)^3+9 e^{-\frac {2}{1-x}} (1-x)^2-9 e^{-\frac {2}{1-x}} (1-x)+3 e^{-\frac {2}{1-x}} \]

[In]

Int[(-9*x^2 + 18*x^3 - 9*x^4 + E^(2/(-1 + x))*(9*x^2 - 24*x^3 + 9*x^4))/(1 - 2*x + x^2),x]

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 2237

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_)), x_Symbol] :> Simp[(c + d*x)*(F^(a + b*(c + d*x)^n)/d), x]
- Dist[b*n*Log[F], Int[(c + d*x)^n*F^(a + b*(c + d*x)^n), x], x] /; FreeQ[{F, a, b, c, d}, x] && IntegerQ[2/n]
 && ILtQ[n, 0]

Rule 2240

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Simp[(e + f*x)^n*(
F^(a + b*(c + d*x)^n)/(b*f*n*(c + d*x)^n*Log[F])), x] /; FreeQ[{F, a, b, c, d, e, f, n}, x] && EqQ[m, n - 1] &
& EqQ[d*e - c*f, 0]

Rule 2241

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x_)), x_Symbol] :> Simp[F^a*(ExpIntegralEi[
b*(c + d*x)^n*Log[F]]/(f*n)), x] /; FreeQ[{F, a, b, c, d, e, f, n}, x] && EqQ[d*e - c*f, 0]

Rule 2245

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^(m
+ 1)*(F^(a + b*(c + d*x)^n)/(d*(m + 1))), x] - Dist[b*n*(Log[F]/(m + 1)), Int[(c + d*x)^(m + n)*F^(a + b*(c +
d*x)^n), x], x] /; FreeQ[{F, a, b, c, d}, x] && IntegerQ[2*((m + 1)/n)] && LtQ[-4, (m + 1)/n, 5] && IntegerQ[n
] && ((GtQ[n, 0] && LtQ[m, -1]) || (GtQ[-n, 0] && LeQ[-n, m + 1]))

Rule 2258

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*(u_), x_Symbol] :> Int[ExpandLinearProduct[F^(a + b*(c + d*
x)^n), u, c, d, x], x] /; FreeQ[{F, a, b, c, d, n}, x] && PolynomialQ[u, x]

Rule 6820

Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; SimplerIntegrandQ[v, u, x]]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \int \frac {-9 x^2+18 x^3-9 x^4+e^{\frac {2}{-1+x}} \left (9 x^2-24 x^3+9 x^4\right )}{(-1+x)^2} \, dx \\ & = \int 3 x^2 \left (-3+\frac {e^{\frac {2}{-1+x}} \left (3-8 x+3 x^2\right )}{(-1+x)^2}\right ) \, dx \\ & = 3 \int x^2 \left (-3+\frac {e^{\frac {2}{-1+x}} \left (3-8 x+3 x^2\right )}{(-1+x)^2}\right ) \, dx \\ & = 3 \int \left (-3 x^2+\frac {e^{\frac {2}{-1+x}} x^2 \left (3-8 x+3 x^2\right )}{(-1+x)^2}\right ) \, dx \\ & = -3 x^3+3 \int \frac {e^{\frac {2}{-1+x}} x^2 \left (3-8 x+3 x^2\right )}{(-1+x)^2} \, dx \\ & = -3 x^3+3 \int \left (-4 e^{\frac {2}{-1+x}}-\frac {2 e^{\frac {2}{-1+x}}}{(-1+x)^2}-\frac {6 e^{\frac {2}{-1+x}}}{-1+x}-2 e^{\frac {2}{-1+x}} x+3 e^{\frac {2}{-1+x}} x^2\right ) \, dx \\ & = -3 x^3-6 \int \frac {e^{\frac {2}{-1+x}}}{(-1+x)^2} \, dx-6 \int e^{\frac {2}{-1+x}} x \, dx+9 \int e^{\frac {2}{-1+x}} x^2 \, dx-12 \int e^{\frac {2}{-1+x}} \, dx-18 \int \frac {e^{\frac {2}{-1+x}}}{-1+x} \, dx \\ & = 3 e^{-\frac {2}{1-x}}+12 e^{-\frac {2}{1-x}} (1-x)-3 x^3+18 \text {Ei}\left (-\frac {2}{1-x}\right )-6 \int \left (e^{\frac {2}{-1+x}}+e^{\frac {2}{-1+x}} (-1+x)\right ) \, dx+9 \int \left (e^{\frac {2}{-1+x}}+2 e^{\frac {2}{-1+x}} (-1+x)+e^{\frac {2}{-1+x}} (-1+x)^2\right ) \, dx-24 \int \frac {e^{\frac {2}{-1+x}}}{-1+x} \, dx \\ & = 3 e^{-\frac {2}{1-x}}+12 e^{-\frac {2}{1-x}} (1-x)-3 x^3+42 \text {Ei}\left (-\frac {2}{1-x}\right )-6 \int e^{\frac {2}{-1+x}} \, dx-6 \int e^{\frac {2}{-1+x}} (-1+x) \, dx+9 \int e^{\frac {2}{-1+x}} \, dx+9 \int e^{\frac {2}{-1+x}} (-1+x)^2 \, dx+18 \int e^{\frac {2}{-1+x}} (-1+x) \, dx \\ & = 3 e^{-\frac {2}{1-x}}+9 e^{-\frac {2}{1-x}} (1-x)+6 e^{-\frac {2}{1-x}} (1-x)^2-3 e^{-\frac {2}{1-x}} (1-x)^3-3 x^3+42 \text {Ei}\left (-\frac {2}{1-x}\right )-6 \int e^{\frac {2}{-1+x}} \, dx+6 \int e^{\frac {2}{-1+x}} (-1+x) \, dx-12 \int \frac {e^{\frac {2}{-1+x}}}{-1+x} \, dx+18 \int e^{\frac {2}{-1+x}} \, dx+18 \int \frac {e^{\frac {2}{-1+x}}}{-1+x} \, dx \\ & = 3 e^{-\frac {2}{1-x}}-3 e^{-\frac {2}{1-x}} (1-x)+9 e^{-\frac {2}{1-x}} (1-x)^2-3 e^{-\frac {2}{1-x}} (1-x)^3-3 x^3+36 \text {Ei}\left (-\frac {2}{1-x}\right )+6 \int e^{\frac {2}{-1+x}} \, dx-12 \int \frac {e^{\frac {2}{-1+x}}}{-1+x} \, dx+36 \int \frac {e^{\frac {2}{-1+x}}}{-1+x} \, dx \\ & = 3 e^{-\frac {2}{1-x}}-9 e^{-\frac {2}{1-x}} (1-x)+9 e^{-\frac {2}{1-x}} (1-x)^2-3 e^{-\frac {2}{1-x}} (1-x)^3-3 x^3+12 \text {Ei}\left (-\frac {2}{1-x}\right )+12 \int \frac {e^{\frac {2}{-1+x}}}{-1+x} \, dx \\ & = 3 e^{-\frac {2}{1-x}}-9 e^{-\frac {2}{1-x}} (1-x)+9 e^{-\frac {2}{1-x}} (1-x)^2-3 e^{-\frac {2}{1-x}} (1-x)^3-3 x^3 \\ \end{align*}

Mathematica [A] (verified)

Time = 0.17 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.19 \[ \int \frac {-9 x^2+18 x^3-9 x^4+e^{\frac {2}{-1+x}} \left (9 x^2-24 x^3+9 x^4\right )}{1-2 x+x^2} \, dx=3 \left (1+\left (-1+e^{\frac {2}{-1+x}}\right ) x^3\right ) \]

[In]

Integrate[(-9*x^2 + 18*x^3 - 9*x^4 + E^(2/(-1 + x))*(9*x^2 - 24*x^3 + 9*x^4))/(1 - 2*x + x^2),x]

[Out]

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

Maple [A] (verified)

Time = 0.63 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.25

method result size
risch \(3 x^{3} {\mathrm e}^{\frac {2}{-1+x}}-3 x^{3}\) \(20\)
parallelrisch \(3 x^{3} {\mathrm e}^{\frac {2}{-1+x}}-3 x^{3}-12\) \(21\)
norman \(\frac {3 x^{3}-3 x^{4}-3 x^{3} {\mathrm e}^{\frac {2}{-1+x}}+3 x^{4} {\mathrm e}^{\frac {2}{-1+x}}}{-1+x}\) \(44\)
parts \(-3 x^{3}+9 \,{\mathrm e}^{\frac {2}{-1+x}} \left (-1+x \right )+3 \,{\mathrm e}^{\frac {2}{-1+x}} \left (-1+x \right )^{3}+9 \,{\mathrm e}^{\frac {2}{-1+x}} \left (-1+x \right )^{2}+3 \,{\mathrm e}^{\frac {2}{-1+x}}\) \(60\)
derivativedivides \(-3 \left (-1+x \right )^{3}-9 \left (-1+x \right )^{2}+9-9 x +3 \,{\mathrm e}^{\frac {2}{-1+x}} \left (-1+x \right )^{3}+9 \,{\mathrm e}^{\frac {2}{-1+x}} \left (-1+x \right )^{2}+9 \,{\mathrm e}^{\frac {2}{-1+x}} \left (-1+x \right )+3 \,{\mathrm e}^{\frac {2}{-1+x}}\) \(73\)
default \(-3 \left (-1+x \right )^{3}-9 \left (-1+x \right )^{2}+9-9 x +3 \,{\mathrm e}^{\frac {2}{-1+x}} \left (-1+x \right )^{3}+9 \,{\mathrm e}^{\frac {2}{-1+x}} \left (-1+x \right )^{2}+9 \,{\mathrm e}^{\frac {2}{-1+x}} \left (-1+x \right )+3 \,{\mathrm e}^{\frac {2}{-1+x}}\) \(73\)

[In]

int(((9*x^4-24*x^3+9*x^2)*exp(2/(-1+x))-9*x^4+18*x^3-9*x^2)/(x^2-2*x+1),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.19 \[ \int \frac {-9 x^2+18 x^3-9 x^4+e^{\frac {2}{-1+x}} \left (9 x^2-24 x^3+9 x^4\right )}{1-2 x+x^2} \, dx=3 \, x^{3} e^{\left (\frac {2}{x - 1}\right )} - 3 \, x^{3} \]

[In]

integrate(((9*x^4-24*x^3+9*x^2)*exp(2/(-1+x))-9*x^4+18*x^3-9*x^2)/(x^2-2*x+1),x, algorithm="fricas")

[Out]

3*x^3*e^(2/(x - 1)) - 3*x^3

Sympy [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.94 \[ \int \frac {-9 x^2+18 x^3-9 x^4+e^{\frac {2}{-1+x}} \left (9 x^2-24 x^3+9 x^4\right )}{1-2 x+x^2} \, dx=3 x^{3} e^{\frac {2}{x - 1}} - 3 x^{3} \]

[In]

integrate(((9*x**4-24*x**3+9*x**2)*exp(2/(-1+x))-9*x**4+18*x**3-9*x**2)/(x**2-2*x+1),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.19 \[ \int \frac {-9 x^2+18 x^3-9 x^4+e^{\frac {2}{-1+x}} \left (9 x^2-24 x^3+9 x^4\right )}{1-2 x+x^2} \, dx=3 \, x^{3} e^{\left (\frac {2}{x - 1}\right )} - 3 \, x^{3} \]

[In]

integrate(((9*x^4-24*x^3+9*x^2)*exp(2/(-1+x))-9*x^4+18*x^3-9*x^2)/(x^2-2*x+1),x, algorithm="maxima")

[Out]

3*x^3*e^(2/(x - 1)) - 3*x^3

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 75 vs. \(2 (15) = 30\).

Time = 0.27 (sec) , antiderivative size = 75, normalized size of antiderivative = 4.69 \[ \int \frac {-9 x^2+18 x^3-9 x^4+e^{\frac {2}{-1+x}} \left (9 x^2-24 x^3+9 x^4\right )}{1-2 x+x^2} \, dx=3 \, {\left (x - 1\right )}^{3} {\left (\frac {3 \, e^{\left (\frac {2}{x - 1}\right )}}{x - 1} - \frac {3}{x - 1} + \frac {3 \, e^{\left (\frac {2}{x - 1}\right )}}{{\left (x - 1\right )}^{2}} - \frac {3}{{\left (x - 1\right )}^{2}} + \frac {e^{\left (\frac {2}{x - 1}\right )}}{{\left (x - 1\right )}^{3}} + e^{\left (\frac {2}{x - 1}\right )} - 1\right )} \]

[In]

integrate(((9*x^4-24*x^3+9*x^2)*exp(2/(-1+x))-9*x^4+18*x^3-9*x^2)/(x^2-2*x+1),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 11.89 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.94 \[ \int \frac {-9 x^2+18 x^3-9 x^4+e^{\frac {2}{-1+x}} \left (9 x^2-24 x^3+9 x^4\right )}{1-2 x+x^2} \, dx=3\,x^3\,\left ({\mathrm {e}}^{\frac {2}{x-1}}-1\right ) \]

[In]

int((exp(2/(x - 1))*(9*x^2 - 24*x^3 + 9*x^4) - 9*x^2 + 18*x^3 - 9*x^4)/(x^2 - 2*x + 1),x)

[Out]

3*x^3*(exp(2/(x - 1)) - 1)