3.67.59 \(\int \frac {-20+40 x-29 x^2+2 x^3-x^4+e^{x^2} (2 x^3-4 x^4+2 x^5)}{x^2-2 x^3+x^4} \, dx\)

Optimal. Leaf size=30 \[ e^{x^2}+5 \left (-3+\frac {4}{x}\right )-\frac {(9-x) x}{1-x} \]

________________________________________________________________________________________

Rubi [A]  time = 0.40, antiderivative size = 23, normalized size of antiderivative = 0.77, number of steps used = 13, number of rules used = 6, integrand size = 57, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {1594, 27, 6742, 44, 2209, 43} \begin {gather*} e^{x^2}-x-\frac {8}{1-x}+\frac {20}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-20 + 40*x - 29*x^2 + 2*x^3 - x^4 + E^x^2*(2*x^3 - 4*x^4 + 2*x^5))/(x^2 - 2*x^3 + x^4),x]

[Out]

E^x^2 - 8/(1 - x) + 20/x - x

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 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 1594

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.) + (c_.)*(x_)^(r_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^
(q - p) + c*x^(r - p))^n, x] /; FreeQ[{a, b, c, p, q, r}, x] && IntegerQ[n] && PosQ[q - p] && PosQ[r - p]

Rule 2209

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 6742

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-20+40 x-29 x^2+2 x^3-x^4+e^{x^2} \left (2 x^3-4 x^4+2 x^5\right )}{x^2 \left (1-2 x+x^2\right )} \, dx\\ &=\int \frac {-20+40 x-29 x^2+2 x^3-x^4+e^{x^2} \left (2 x^3-4 x^4+2 x^5\right )}{(-1+x)^2 x^2} \, dx\\ &=\int \left (-\frac {29}{(-1+x)^2}-\frac {20}{(-1+x)^2 x^2}+\frac {40}{(-1+x)^2 x}+2 e^{x^2} x+\frac {2 x}{(-1+x)^2}-\frac {x^2}{(-1+x)^2}\right ) \, dx\\ &=-\frac {29}{1-x}+2 \int e^{x^2} x \, dx+2 \int \frac {x}{(-1+x)^2} \, dx-20 \int \frac {1}{(-1+x)^2 x^2} \, dx+40 \int \frac {1}{(-1+x)^2 x} \, dx-\int \frac {x^2}{(-1+x)^2} \, dx\\ &=e^{x^2}-\frac {29}{1-x}+2 \int \left (\frac {1}{(-1+x)^2}+\frac {1}{-1+x}\right ) \, dx-20 \int \left (\frac {1}{(-1+x)^2}-\frac {2}{-1+x}+\frac {1}{x^2}+\frac {2}{x}\right ) \, dx+40 \int \left (\frac {1}{1-x}+\frac {1}{(-1+x)^2}+\frac {1}{x}\right ) \, dx-\int \left (1+\frac {1}{(-1+x)^2}+\frac {2}{-1+x}\right ) \, dx\\ &=e^{x^2}-\frac {8}{1-x}+\frac {20}{x}-x\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.14, size = 23, normalized size = 0.77 \begin {gather*} e^{x^2}-\frac {8}{1-x}+\frac {20}{x}-x \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-20 + 40*x - 29*x^2 + 2*x^3 - x^4 + E^x^2*(2*x^3 - 4*x^4 + 2*x^5))/(x^2 - 2*x^3 + x^4),x]

[Out]

E^x^2 - 8/(1 - x) + 20/x - x

________________________________________________________________________________________

fricas [A]  time = 0.61, size = 37, normalized size = 1.23 \begin {gather*} -\frac {x^{3} - x^{2} - {\left (x^{2} - x\right )} e^{\left (x^{2}\right )} - 28 \, x + 20}{x^{2} - x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x^5-4*x^4+2*x^3)*exp(x^2)-x^4+2*x^3-29*x^2+40*x-20)/(x^4-2*x^3+x^2),x, algorithm="fricas")

[Out]

-(x^3 - x^2 - (x^2 - x)*e^(x^2) - 28*x + 20)/(x^2 - x)

________________________________________________________________________________________

giac [A]  time = 0.39, size = 39, normalized size = 1.30 \begin {gather*} -\frac {x^{3} - x^{2} e^{\left (x^{2}\right )} - x^{2} + x e^{\left (x^{2}\right )} - 28 \, x + 20}{x^{2} - x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x^5-4*x^4+2*x^3)*exp(x^2)-x^4+2*x^3-29*x^2+40*x-20)/(x^4-2*x^3+x^2),x, algorithm="giac")

[Out]

-(x^3 - x^2*e^(x^2) - x^2 + x*e^(x^2) - 28*x + 20)/(x^2 - x)

________________________________________________________________________________________

maple [A]  time = 0.11, size = 23, normalized size = 0.77




method result size



risch \(-x +\frac {28 x -20}{x \left (x -1\right )}+{\mathrm e}^{x^{2}}\) \(23\)
norman \(\frac {-20+x^{2} {\mathrm e}^{x^{2}}+29 x -x^{3}-{\mathrm e}^{x^{2}} x}{x \left (x -1\right )}\) \(35\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((2*x^5-4*x^4+2*x^3)*exp(x^2)-x^4+2*x^3-29*x^2+40*x-20)/(x^4-2*x^3+x^2),x,method=_RETURNVERBOSE)

[Out]

-x+(28*x-20)/x/(x-1)+exp(x^2)

________________________________________________________________________________________

maxima [A]  time = 0.40, size = 31, normalized size = 1.03 \begin {gather*} -x + \frac {20 \, {\left (2 \, x - 1\right )}}{x^{2} - x} - \frac {12}{x - 1} + e^{\left (x^{2}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x^5-4*x^4+2*x^3)*exp(x^2)-x^4+2*x^3-29*x^2+40*x-20)/(x^4-2*x^3+x^2),x, algorithm="maxima")

[Out]

-x + 20*(2*x - 1)/(x^2 - x) - 12/(x - 1) + e^(x^2)

________________________________________________________________________________________

mupad [B]  time = 4.21, size = 22, normalized size = 0.73 \begin {gather*} {\mathrm {e}}^{x^2}-x+\frac {28\,x-20}{x\,\left (x-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((40*x + exp(x^2)*(2*x^3 - 4*x^4 + 2*x^5) - 29*x^2 + 2*x^3 - x^4 - 20)/(x^2 - 2*x^3 + x^4),x)

[Out]

exp(x^2) - x + (28*x - 20)/(x*(x - 1))

________________________________________________________________________________________

sympy [A]  time = 0.16, size = 15, normalized size = 0.50 \begin {gather*} - x - \frac {20 - 28 x}{x^{2} - x} + e^{x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x**5-4*x**4+2*x**3)*exp(x**2)-x**4+2*x**3-29*x**2+40*x-20)/(x**4-2*x**3+x**2),x)

[Out]

-x - (20 - 28*x)/(x**2 - x) + exp(x**2)

________________________________________________________________________________________