3.86.30 \(\int \frac {e^{-x} (27+45 x+21 x^2+3 x^3+e^x (-20 x^2-12 x^3-2 x^4))}{9 x^2+6 x^3+x^4} \, dx\)

Optimal. Leaf size=26 \[ 4-\frac {3 e^{-x}}{x}-2 x+\frac {2}{3+x}-5 \log (5) \]

________________________________________________________________________________________

Rubi [A]  time = 0.98, antiderivative size = 21, normalized size of antiderivative = 0.81, number of steps used = 27, number of rules used = 7, integrand size = 57, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.123, Rules used = {1594, 27, 6742, 2177, 2178, 2199, 683} \begin {gather*} -2 x+\frac {2}{x+3}-\frac {3 e^{-x}}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(27 + 45*x + 21*x^2 + 3*x^3 + E^x*(-20*x^2 - 12*x^3 - 2*x^4))/(E^x*(9*x^2 + 6*x^3 + x^4)),x]

[Out]

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

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[((c + d*x)^(m
 + 1)*(b*F^(g*(e + f*x)))^n)/(d*(m + 1)), x] - Dist[(f*g*n*Log[F])/(d*(m + 1)), 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] && LtQ[m, -1] && IntegerQ[2*m] &&  !$UseGamma ===
True

Rule 2178

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - (c*f)/d))*ExpIntegral
Ei[(f*g*(c + d*x)*Log[F])/d])/d, x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !$UseGamma === True

Rule 2199

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

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 {e^{-x} \left (27+45 x+21 x^2+3 x^3+e^x \left (-20 x^2-12 x^3-2 x^4\right )\right )}{x^2 \left (9+6 x+x^2\right )} \, dx\\ &=\int \frac {e^{-x} \left (27+45 x+21 x^2+3 x^3+e^x \left (-20 x^2-12 x^3-2 x^4\right )\right )}{x^2 (3+x)^2} \, dx\\ &=\int \left (\frac {21 e^{-x}}{(3+x)^2}+\frac {27 e^{-x}}{x^2 (3+x)^2}+\frac {45 e^{-x}}{x (3+x)^2}+\frac {3 e^{-x} x}{(3+x)^2}-\frac {2 \left (10+6 x+x^2\right )}{(3+x)^2}\right ) \, dx\\ &=-\left (2 \int \frac {10+6 x+x^2}{(3+x)^2} \, dx\right )+3 \int \frac {e^{-x} x}{(3+x)^2} \, dx+21 \int \frac {e^{-x}}{(3+x)^2} \, dx+27 \int \frac {e^{-x}}{x^2 (3+x)^2} \, dx+45 \int \frac {e^{-x}}{x (3+x)^2} \, dx\\ &=-\frac {21 e^{-x}}{3+x}-2 \int \left (1+\frac {1}{(3+x)^2}\right ) \, dx+3 \int \left (-\frac {3 e^{-x}}{(3+x)^2}+\frac {e^{-x}}{3+x}\right ) \, dx-21 \int \frac {e^{-x}}{3+x} \, dx+27 \int \left (\frac {e^{-x}}{9 x^2}-\frac {2 e^{-x}}{27 x}+\frac {e^{-x}}{9 (3+x)^2}+\frac {2 e^{-x}}{27 (3+x)}\right ) \, dx+45 \int \left (\frac {e^{-x}}{9 x}-\frac {e^{-x}}{3 (3+x)^2}-\frac {e^{-x}}{9 (3+x)}\right ) \, dx\\ &=-2 x+\frac {2}{3+x}-\frac {21 e^{-x}}{3+x}-21 e^3 \text {Ei}(-3-x)-2 \int \frac {e^{-x}}{x} \, dx+2 \int \frac {e^{-x}}{3+x} \, dx+3 \int \frac {e^{-x}}{x^2} \, dx+3 \int \frac {e^{-x}}{(3+x)^2} \, dx+3 \int \frac {e^{-x}}{3+x} \, dx+5 \int \frac {e^{-x}}{x} \, dx-5 \int \frac {e^{-x}}{3+x} \, dx-9 \int \frac {e^{-x}}{(3+x)^2} \, dx-15 \int \frac {e^{-x}}{(3+x)^2} \, dx\\ &=-\frac {3 e^{-x}}{x}-2 x+\frac {2}{3+x}-21 e^3 \text {Ei}(-3-x)+3 \text {Ei}(-x)-3 \int \frac {e^{-x}}{x} \, dx-3 \int \frac {e^{-x}}{3+x} \, dx+9 \int \frac {e^{-x}}{3+x} \, dx+15 \int \frac {e^{-x}}{3+x} \, dx\\ &=-\frac {3 e^{-x}}{x}-2 x+\frac {2}{3+x}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.37, size = 21, normalized size = 0.81 \begin {gather*} -\frac {3 e^{-x}}{x}-2 x+\frac {2}{3+x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(27 + 45*x + 21*x^2 + 3*x^3 + E^x*(-20*x^2 - 12*x^3 - 2*x^4))/(E^x*(9*x^2 + 6*x^3 + x^4)),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.57, size = 36, normalized size = 1.38 \begin {gather*} -\frac {{\left (2 \, {\left (x^{3} + 3 \, x^{2} - x\right )} e^{x} + 3 \, x + 9\right )} e^{\left (-x\right )}}{x^{2} + 3 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x^4-12*x^3-20*x^2)*exp(x)+3*x^3+21*x^2+45*x+27)/(x^4+6*x^3+9*x^2)/exp(x),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.20, size = 38, normalized size = 1.46 \begin {gather*} -\frac {2 \, x^{3} + 6 \, x^{2} + 3 \, x e^{\left (-x\right )} - 2 \, x + 9 \, e^{\left (-x\right )}}{x^{2} + 3 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x^4-12*x^3-20*x^2)*exp(x)+3*x^3+21*x^2+45*x+27)/(x^4+6*x^3+9*x^2)/exp(x),x, algorithm="giac")

[Out]

-(2*x^3 + 6*x^2 + 3*x*e^(-x) - 2*x + 9*e^(-x))/(x^2 + 3*x)

________________________________________________________________________________________

maple [A]  time = 0.06, size = 21, normalized size = 0.81




method result size



risch \(\frac {2}{3+x}-2 x -\frac {3 \,{\mathrm e}^{-x}}{x}\) \(21\)
norman \(\frac {\left (-9+20 \,{\mathrm e}^{x} x -3 x -2 \,{\mathrm e}^{x} x^{3}\right ) {\mathrm e}^{-x}}{\left (3+x \right ) x}\) \(31\)
default \(\frac {2}{3+x}-2 x -\frac {3 \,{\mathrm e}^{-x} \left (2 x +3\right )}{\left (3+x \right ) x}+\frac {3 \,{\mathrm e}^{-x}}{3+x}\) \(42\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((-2*x^4-12*x^3-20*x^2)*exp(x)+3*x^3+21*x^2+45*x+27)/(x^4+6*x^3+9*x^2)/exp(x),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.41, size = 34, normalized size = 1.31 \begin {gather*} -\frac {2 \, x^{3} + 6 \, x^{2} + 3 \, {\left (x + 3\right )} e^{\left (-x\right )} - 2 \, x}{x^{2} + 3 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x^4-12*x^3-20*x^2)*exp(x)+3*x^3+21*x^2+45*x+27)/(x^4+6*x^3+9*x^2)/exp(x),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 5.34, size = 31, normalized size = 1.19 \begin {gather*} -2\,x-\frac {9\,{\mathrm {e}}^{-x}+x\,\left (3\,{\mathrm {e}}^{-x}-2\right )}{x\,\left (x+3\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((exp(-x)*(45*x - exp(x)*(20*x^2 + 12*x^3 + 2*x^4) + 21*x^2 + 3*x^3 + 27))/(9*x^2 + 6*x^3 + x^4),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.17, size = 14, normalized size = 0.54 \begin {gather*} - 2 x + \frac {2}{x + 3} - \frac {3 e^{- x}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x**4-12*x**3-20*x**2)*exp(x)+3*x**3+21*x**2+45*x+27)/(x**4+6*x**3+9*x**2)/exp(x),x)

[Out]

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

________________________________________________________________________________________