3.66.50 \(\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. Leaf size=16 \[ 3 \left (-1+e^{\frac {2}{-1+x}}\right ) x^3 \]

[Out]

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

________________________________________________________________________________________

Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(77\) vs. \(2(16)=32\).
time = 0.38, antiderivative size = 77, normalized size of antiderivative = 4.81, number of steps used = 29, number of rules used = 10, integrand size = 53, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.189, Rules used = {27, 6820, 12, 14, 6874, 2237, 2241, 2240, 2258, 2245} \begin {gather*} -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}} \end {gather*}

Antiderivative was successfully verified.

[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 {gather*} \begin {aligned} \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 {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 19, normalized size = 1.19 \begin {gather*} 3 \left (1+\left (-1+e^{\frac {2}{-1+x}}\right ) x^3\right ) \end {gather*}

Antiderivative was successfully verified.

[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 [B] Leaf count of result is larger than twice the leaf count of optimal. \(72\) vs. \(2(15)=30\).
time = 2.67, size = 73, normalized size = 4.56

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.34, size = 19, normalized size = 1.19 \begin {gather*} 3 \, x^{3} e^{\left (\frac {2}{x - 1}\right )} - 3 \, x^{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 19, normalized size = 1.19 \begin {gather*} 3 \, x^{3} e^{\left (\frac {2}{x - 1}\right )} - 3 \, x^{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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]
time = 0.06, size = 15, normalized size = 0.94 \begin {gather*} 3 x^{3} e^{\frac {2}{x - 1}} - 3 x^{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 75 vs. \(2 (15) = 30\).
time = 0.41, size = 75, normalized size = 4.69 \begin {gather*} 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 )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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]
time = 4.16, size = 15, normalized size = 0.94 \begin {gather*} 3\,x^3\,\left ({\mathrm {e}}^{\frac {2}{x-1}}-1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________