3.36.27 \(\int \frac {-1+2 x-e^2 x^2+e^{2+\frac {2}{x}} (2-2 x-x^2)+e^x (2 x^3-3 x^4+x^6)}{x^2-2 x^3+x^4} \, dx\)

Optimal. Leaf size=35 \[ e^x x^2+\frac {1-e^2 \left (1+e^{2/x}\right ) x}{x-x^2} \]

________________________________________________________________________________________

Rubi [A]  time = 0.58, antiderivative size = 48, normalized size of antiderivative = 1.37, number of steps used = 16, number of rules used = 8, integrand size = 66, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {1594, 27, 6742, 44, 2196, 2176, 2194, 2288} \begin {gather*} e^x x^2-\frac {e^{\frac {2}{x}+2}}{1-x}-\frac {e^2}{1-x}+\frac {1}{1-x}+\frac {1}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 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 2176

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[((c + d*x)^m
*(b*F^(g*(e + f*x)))^n)/(f*g*n*Log[F]), x] - Dist[(d*m)/(f*g*n*Log[F]), Int[(c + d*x)^(m - 1)*(b*F^(g*(e + f*x
)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && GtQ[m, 0] && IntegerQ[2*m] &&  !$UseGamma === True

Rule 2194

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2196

Int[(F_)^((c_.)*(v_))*(u_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), u, x], x] /; FreeQ[{F, c
}, x] && PolynomialQ[u, x] && LinearQ[v, x] &&  !$UseGamma === True

Rule 2288

Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = (v*y)/(Log[F]*D[u, x])}, Simp[F^u*z, x] /; EqQ[D[z,
x], w*y]] /; FreeQ[F, x]

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 {-1+2 x-e^2 x^2+e^{2+\frac {2}{x}} \left (2-2 x-x^2\right )+e^x \left (2 x^3-3 x^4+x^6\right )}{x^2 \left (1-2 x+x^2\right )} \, dx\\ &=\int \frac {-1+2 x-e^2 x^2+e^{2+\frac {2}{x}} \left (2-2 x-x^2\right )+e^x \left (2 x^3-3 x^4+x^6\right )}{(-1+x)^2 x^2} \, dx\\ &=\int \left (-\frac {e^2}{(-1+x)^2}-\frac {1}{(-1+x)^2 x^2}+\frac {2}{(-1+x)^2 x}+e^x x (2+x)-\frac {e^{2+\frac {2}{x}} \left (-2+2 x+x^2\right )}{(-1+x)^2 x^2}\right ) \, dx\\ &=-\frac {e^2}{1-x}+2 \int \frac {1}{(-1+x)^2 x} \, dx-\int \frac {1}{(-1+x)^2 x^2} \, dx+\int e^x x (2+x) \, dx-\int \frac {e^{2+\frac {2}{x}} \left (-2+2 x+x^2\right )}{(-1+x)^2 x^2} \, dx\\ &=-\frac {e^2}{1-x}-\frac {e^{2+\frac {2}{x}}}{1-x}+2 \int \left (\frac {1}{1-x}+\frac {1}{(-1+x)^2}+\frac {1}{x}\right ) \, dx-\int \left (\frac {1}{(-1+x)^2}-\frac {2}{-1+x}+\frac {1}{x^2}+\frac {2}{x}\right ) \, dx+\int \left (2 e^x x+e^x x^2\right ) \, dx\\ &=\frac {1}{1-x}-\frac {e^2}{1-x}-\frac {e^{2+\frac {2}{x}}}{1-x}+\frac {1}{x}+2 \int e^x x \, dx+\int e^x x^2 \, dx\\ &=\frac {1}{1-x}-\frac {e^2}{1-x}-\frac {e^{2+\frac {2}{x}}}{1-x}+\frac {1}{x}+2 e^x x+e^x x^2-2 \int e^x \, dx-2 \int e^x x \, dx\\ &=-2 e^x+\frac {1}{1-x}-\frac {e^2}{1-x}-\frac {e^{2+\frac {2}{x}}}{1-x}+\frac {1}{x}+e^x x^2+2 \int e^x \, dx\\ &=\frac {1}{1-x}-\frac {e^2}{1-x}-\frac {e^{2+\frac {2}{x}}}{1-x}+\frac {1}{x}+e^x x^2\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.12, size = 37, normalized size = 1.06 \begin {gather*} \frac {-1+e^2 x+e^{2+\frac {2}{x}} x+e^x (-1+x) x^3}{(-1+x) x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.74, size = 39, normalized size = 1.11 \begin {gather*} \frac {x e^{2} + {\left (x^{4} - x^{3}\right )} e^{x} + x e^{\left (\frac {2 \, {\left (x + 1\right )}}{x}\right )} - 1}{x^{2} - x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^6-3*x^4+2*x^3)*exp(x)+(-x^2-2*x+2)*exp(2)*exp(2/x)-x^2*exp(2)+2*x-1)/(x^4-2*x^3+x^2),x, algorith
m="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.17, size = 40, normalized size = 1.14 \begin {gather*} \frac {x^{4} e^{x} - x^{3} e^{x} + x e^{2} + x e^{\left (\frac {2 \, {\left (x + 1\right )}}{x}\right )} - 1}{x^{2} - x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^6-3*x^4+2*x^3)*exp(x)+(-x^2-2*x+2)*exp(2)*exp(2/x)-x^2*exp(2)+2*x-1)/(x^4-2*x^3+x^2),x, algorith
m="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.09, size = 38, normalized size = 1.09




method result size



risch \(\frac {{\mathrm e}^{2} x -1}{x \left (x -1\right )}+{\mathrm e}^{x} x^{2}+\frac {{\mathrm e}^{\frac {2 x +2}{x}}}{x -1}\) \(38\)
norman \(\frac {-1+{\mathrm e}^{2} x +{\mathrm e}^{x} x^{4}+{\mathrm e}^{2} {\mathrm e}^{\frac {2}{x}} x -{\mathrm e}^{x} x^{3}}{x \left (x -1\right )}\) \(39\)
default \({\mathrm e}^{x} x^{2}-\frac {1}{x -1}+\frac {1}{x}+\frac {{\mathrm e}^{2}}{x -1}+2 \,{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{\frac {2}{x}}}{2}+4 \,{\mathrm e}^{2} \expIntegralEi \left (1, -\frac {2}{x}+2\right )+\frac {{\mathrm e}^{\frac {2}{x}}}{\frac {1}{x}-1}\right )-2 \,{\mathrm e}^{2} \left (3 \,{\mathrm e}^{2} \expIntegralEi \left (1, -\frac {2}{x}+2\right )+\frac {{\mathrm e}^{\frac {2}{x}}}{\frac {1}{x}-1}\right )-{\mathrm e}^{2} \left (\frac {{\mathrm e}^{\frac {2}{x}}}{\frac {1}{x}-1}+2 \,{\mathrm e}^{2} \expIntegralEi \left (1, -\frac {2}{x}+2\right )\right )\) \(130\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((x^6-3*x^4+2*x^3)*exp(x)+(-x^2-2*x+2)*exp(2)*exp(2/x)-x^2*exp(2)+2*x-1)/(x^4-2*x^3+x^2),x,method=_RETURNV
ERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.72, size = 58, normalized size = 1.66 \begin {gather*} \frac {2 \, x - 1}{x^{2} - x} + \frac {{\left (x^{3} - x^{2}\right )} e^{x} + e^{\left (\frac {2}{x} + 2\right )}}{x - 1} + \frac {e^{2}}{x - 1} - \frac {2}{x - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^6-3*x^4+2*x^3)*exp(x)+(-x^2-2*x+2)*exp(2)*exp(2/x)-x^2*exp(2)+2*x-1)/(x^4-2*x^3+x^2),x, algorith
m="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 2.30, size = 38, normalized size = 1.09 \begin {gather*} x^2\,{\mathrm {e}}^x-\frac {x\,{\mathrm {e}}^2-1}{x-x^2}+\frac {{\mathrm {e}}^{\frac {2}{x}+2}}{x-1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(x^2*exp(2) - 2*x - exp(x)*(2*x^3 - 3*x^4 + x^6) + exp(2)*exp(2/x)*(2*x + x^2 - 2) + 1)/(x^2 - 2*x^3 + x^
4),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.52, size = 29, normalized size = 0.83 \begin {gather*} x^{2} e^{x} - \frac {- x e^{2} + 1}{x^{2} - x} + \frac {e^{2} e^{\frac {2}{x}}}{x - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x**6-3*x**4+2*x**3)*exp(x)+(-x**2-2*x+2)*exp(2)*exp(2/x)-x**2*exp(2)+2*x-1)/(x**4-2*x**3+x**2),x)

[Out]

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

________________________________________________________________________________________