3.28.24 \(\int \frac {e^{-x} (9 x^2-15 x^3+7 x^4-x^5+e^x (42 x^2-30 x^3+5 x^4+e^{\frac {2-x^2}{x}} (18-12 x+11 x^2-6 x^3+x^4)))}{9 x^2-6 x^3+x^4} \, dx\)

Optimal. Leaf size=32 \[ 2-e^{\frac {2}{x}-x}+\frac {3}{-3+x}+5 x+e^{-x} x \]

________________________________________________________________________________________

Rubi [A]  time = 1.00, antiderivative size = 43, normalized size of antiderivative = 1.34, number of steps used = 9, number of rules used = 7, integrand size = 95, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {1594, 27, 6688, 6706, 2176, 2194, 683} \begin {gather*} -e^{-x} (1-x)-e^{\frac {2}{x}-x}+e^{-x}+5 x-\frac {3}{3-x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(9*x^2 - 15*x^3 + 7*x^4 - x^5 + E^x*(42*x^2 - 30*x^3 + 5*x^4 + E^((2 - x^2)/x)*(18 - 12*x + 11*x^2 - 6*x^3
 + x^4)))/(E^x*(9*x^2 - 6*x^3 + x^4)),x]

[Out]

-E^(2/x - x) + E^(-x) - (1 - x)/E^x - 3/(3 - x) + 5*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 683

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
 e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[2*c*d - b*e,
 0] && IGtQ[p, 0] &&  !(EqQ[m, 3] && NeQ[p, 1])

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 6688

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

Rule 6706

Int[(F_)^(v_)*(u_), x_Symbol] :> With[{q = DerivativeDivides[v, u, x]}, Simp[(q*F^v)/Log[F], x] /;  !FalseQ[q]
] /; FreeQ[F, x]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {e^{-x} \left (9 x^2-15 x^3+7 x^4-x^5+e^x \left (42 x^2-30 x^3+5 x^4+e^{\frac {2-x^2}{x}} \left (18-12 x+11 x^2-6 x^3+x^4\right )\right )\right )}{x^2 \left (9-6 x+x^2\right )} \, dx\\ &=\int \frac {e^{-x} \left (9 x^2-15 x^3+7 x^4-x^5+e^x \left (42 x^2-30 x^3+5 x^4+e^{\frac {2-x^2}{x}} \left (18-12 x+11 x^2-6 x^3+x^4\right )\right )\right )}{(-3+x)^2 x^2} \, dx\\ &=\int \left (e^{\frac {2}{x}-x} \left (1+\frac {2}{x^2}\right )-e^{-x} (-1+x)+\frac {42-30 x+5 x^2}{(-3+x)^2}\right ) \, dx\\ &=\int e^{\frac {2}{x}-x} \left (1+\frac {2}{x^2}\right ) \, dx-\int e^{-x} (-1+x) \, dx+\int \frac {42-30 x+5 x^2}{(-3+x)^2} \, dx\\ &=-e^{\frac {2}{x}-x}-e^{-x} (1-x)-\int e^{-x} \, dx+\int \left (5-\frac {3}{(-3+x)^2}\right ) \, dx\\ &=-e^{\frac {2}{x}-x}+e^{-x}-e^{-x} (1-x)-\frac {3}{3-x}+5 x\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 33, normalized size = 1.03 \begin {gather*} -e^{\frac {2}{x}-x}+\frac {3}{-3+x}+5 (-3+x)+e^{-x} x \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(9*x^2 - 15*x^3 + 7*x^4 - x^5 + E^x*(42*x^2 - 30*x^3 + 5*x^4 + E^((2 - x^2)/x)*(18 - 12*x + 11*x^2 -
 6*x^3 + x^4)))/(E^x*(9*x^2 - 6*x^3 + x^4)),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 46, normalized size = 1.44 \begin {gather*} \frac {{\left (x^{2} + {\left (5 \, x^{2} - {\left (x - 3\right )} e^{\left (-\frac {x^{2} - 2}{x}\right )} - 15 \, x + 3\right )} e^{x} - 3 \, x\right )} e^{\left (-x\right )}}{x - 3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((((x^4-6*x^3+11*x^2-12*x+18)*exp((-x^2+2)/x)+5*x^4-30*x^3+42*x^2)*exp(x)-x^5+7*x^4-15*x^3+9*x^2)/(x^
4-6*x^3+9*x^2)/exp(x),x, algorithm="fricas")

[Out]

(x^2 + (5*x^2 - (x - 3)*e^(-(x^2 - 2)/x) - 15*x + 3)*e^x - 3*x)*e^(-x)/(x - 3)

________________________________________________________________________________________

giac [A]  time = 0.20, size = 58, normalized size = 1.81 \begin {gather*} \frac {x^{2} e^{\left (-x\right )} + 5 \, x^{2} - 3 \, x e^{\left (-x\right )} - x e^{\left (-\frac {x^{2} - 2}{x}\right )} - 15 \, x + 3 \, e^{\left (-\frac {x^{2} - 2}{x}\right )} + 3}{x - 3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((((x^4-6*x^3+11*x^2-12*x+18)*exp((-x^2+2)/x)+5*x^4-30*x^3+42*x^2)*exp(x)-x^5+7*x^4-15*x^3+9*x^2)/(x^
4-6*x^3+9*x^2)/exp(x),x, algorithm="giac")

[Out]

(x^2*e^(-x) + 5*x^2 - 3*x*e^(-x) - x*e^(-(x^2 - 2)/x) - 15*x + 3*e^(-(x^2 - 2)/x) + 3)/(x - 3)

________________________________________________________________________________________

maple [A]  time = 0.22, size = 31, normalized size = 0.97




method result size



risch \(5 x +\frac {3}{x -3}+x \,{\mathrm e}^{-x}-{\mathrm e}^{-\frac {x^{2}-2}{x}}\) \(31\)
norman \(\frac {\left (x^{3}-42 \,{\mathrm e}^{x} x -3 x^{2}+5 \,{\mathrm e}^{x} x^{3}+3 \,{\mathrm e}^{x} x \,{\mathrm e}^{\frac {-x^{2}+2}{x}}-{\mathrm e}^{x} x^{2} {\mathrm e}^{\frac {-x^{2}+2}{x}}\right ) {\mathrm e}^{-x}}{x \left (x -3\right )}\) \(71\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int((((x^4-6*x^3+11*x^2-12*x+18)*exp((-x^2+2)/x)+5*x^4-30*x^3+42*x^2)*exp(x)-x^5+7*x^4-15*x^3+9*x^2)/(x^4-6*x^
3+9*x^2)/exp(x),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {{\left (x^{2} + {\left (5 \, x^{2} - 15 \, x + 3\right )} e^{x} - {\left (x - 3\right )} e^{\frac {2}{x}} - 3 \, x\right )} e^{\left (-x\right )}}{x - 3} - \frac {9 \, e^{\left (-3\right )} E_{2}\left (x - 3\right )}{x - 3} - 9 \, \int \frac {e^{\left (-x\right )}}{x^{2} - 6 \, x + 9}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((((x^4-6*x^3+11*x^2-12*x+18)*exp((-x^2+2)/x)+5*x^4-30*x^3+42*x^2)*exp(x)-x^5+7*x^4-15*x^3+9*x^2)/(x^
4-6*x^3+9*x^2)/exp(x),x, algorithm="maxima")

[Out]

(x^2 + (5*x^2 - 15*x + 3)*e^x - (x - 3)*e^(2/x) - 3*x)*e^(-x)/(x - 3) - 9*e^(-3)*exp_integral_e(2, x - 3)/(x -
 3) - 9*integrate(e^(-x)/(x^2 - 6*x + 9), x)

________________________________________________________________________________________

mupad [B]  time = 2.58, size = 29, normalized size = 0.91 \begin {gather*} 5\,x-{\mathrm {e}}^{\frac {2}{x}-x}+x\,{\mathrm {e}}^{-x}+\frac {3}{x-3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((exp(-x)*(9*x^2 - 15*x^3 + 7*x^4 - x^5 + exp(x)*(exp(-(x^2 - 2)/x)*(11*x^2 - 12*x - 6*x^3 + x^4 + 18) + 42
*x^2 - 30*x^3 + 5*x^4)))/(9*x^2 - 6*x^3 + x^4),x)

[Out]

5*x - exp(2/x - x) + x*exp(-x) + 3/(x - 3)

________________________________________________________________________________________

sympy [A]  time = 0.31, size = 20, normalized size = 0.62 \begin {gather*} 5 x + x e^{- x} - e^{\frac {2 - x^{2}}{x}} + \frac {3}{x - 3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((((x**4-6*x**3+11*x**2-12*x+18)*exp((-x**2+2)/x)+5*x**4-30*x**3+42*x**2)*exp(x)-x**5+7*x**4-15*x**3+
9*x**2)/(x**4-6*x**3+9*x**2)/exp(x),x)

[Out]

5*x + x*exp(-x) - exp((2 - x**2)/x) + 3/(x - 3)

________________________________________________________________________________________