3.13.84 \(\int \frac {-18+24 x-12 x^2+e^x (1-x-x^2+x^3)}{6-12 x+6 x^2} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 30, normalized size of antiderivative = 1.20, number of steps used = 8, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {27, 12, 6742, 2176, 2194, 683} \begin {gather*} -2 x-\frac {e^x}{6}+\frac {1}{6} e^x (x+1)-\frac {1}{1-x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, 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 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 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 {-18+24 x-12 x^2+e^x \left (1-x-x^2+x^3\right )}{6 (-1+x)^2} \, dx\\ &=\frac {1}{6} \int \frac {-18+24 x-12 x^2+e^x \left (1-x-x^2+x^3\right )}{(-1+x)^2} \, dx\\ &=\frac {1}{6} \int \left (e^x (1+x)-\frac {6 \left (3-4 x+2 x^2\right )}{(-1+x)^2}\right ) \, dx\\ &=\frac {1}{6} \int e^x (1+x) \, dx-\int \frac {3-4 x+2 x^2}{(-1+x)^2} \, dx\\ &=\frac {1}{6} e^x (1+x)-\frac {\int e^x \, dx}{6}-\int \left (2+\frac {1}{(-1+x)^2}\right ) \, dx\\ &=-\frac {e^x}{6}-\frac {1}{1-x}-2 x+\frac {1}{6} e^x (1+x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 19, normalized size = 0.76 \begin {gather*} \frac {1}{-1+x}-2 (-1+x)+\frac {e^x x}{6} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 1.02, size = 28, normalized size = 1.12 \begin {gather*} -\frac {12 \, x^{2} - {\left (x^{2} - x\right )} e^{x} - 12 \, x - 6}{6 \, {\left (x - 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^3-x^2-x+1)*exp(x)-12*x^2+24*x-18)/(6*x^2-12*x+6),x, algorithm="fricas")

[Out]

-1/6*(12*x^2 - (x^2 - x)*e^x - 12*x - 6)/(x - 1)

________________________________________________________________________________________

giac [A]  time = 0.25, size = 28, normalized size = 1.12 \begin {gather*} \frac {x^{2} e^{x} - 12 \, x^{2} - x e^{x} + 12 \, x + 6}{6 \, {\left (x - 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^3-x^2-x+1)*exp(x)-12*x^2+24*x-18)/(6*x^2-12*x+6),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.24, size = 15, normalized size = 0.60




method result size



default \(\frac {{\mathrm e}^{x} x}{6}+\frac {1}{x -1}-2 x\) \(15\)
risch \(\frac {{\mathrm e}^{x} x}{6}+\frac {1}{x -1}-2 x\) \(15\)
norman \(\frac {-2 x^{2}-\frac {{\mathrm e}^{x} x}{6}+\frac {{\mathrm e}^{x} x^{2}}{6}+3}{x -1}\) \(26\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^3-x^2-x+1)*exp(x)-12*x^2+24*x-18)/(6*x^2-12*x+6),x, algorithm="maxima")

[Out]

1/6*x*e^x - 2*x - 1/6*e*exp_integral_e(2, -x + 1)/(x - 1) + 1/(x - 1) - 1/6*integrate(e^x/(x^2 - 2*x + 1), x)

________________________________________________________________________________________

mupad [B]  time = 0.92, size = 18, normalized size = 0.72 \begin {gather*} x\,\left (\frac {{\mathrm {e}}^x}{6}-2\right )+\frac {6}{6\,x-6} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(exp(x)*(x + x^2 - x^3 - 1) - 24*x + 12*x^2 + 18)/(6*x^2 - 12*x + 6),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.14, size = 14, normalized size = 0.56 \begin {gather*} \frac {x e^{x}}{6} - 2 x + \frac {1}{x - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x**3-x**2-x+1)*exp(x)-12*x**2+24*x-18)/(6*x**2-12*x+6),x)

[Out]

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

________________________________________________________________________________________