3.18.38 \(\int \frac {e^{-2 x} (4-12 x+9 x^2-2 x^3+e^{2 x} (4-8 x+2 x^2))}{4-4 x+x^2} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.31, antiderivative size = 36, normalized size of antiderivative = 1.64, number of steps used = 7, number of rules used = 5, integrand size = 47, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.106, Rules used = {27, 6688, 2176, 2194, 683} \begin {gather*} -\frac {1}{2} e^{-2 x} (1-2 x)+\frac {e^{-2 x}}{2}+2 x-\frac {4}{2-x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(4 - 12*x + 9*x^2 - 2*x^3 + E^(2*x)*(4 - 8*x + 2*x^2))/(E^(2*x)*(4 - 4*x + x^2)),x]

[Out]

1/(2*E^(2*x)) - (1 - 2*x)/(2*E^(2*x)) - 4/(2 - x) + 2*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 6688

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 18, normalized size = 0.82 \begin {gather*} \frac {4}{-2+x}+2 x+e^{-2 x} x \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(4 - 12*x + 9*x^2 - 2*x^3 + E^(2*x)*(4 - 8*x + 2*x^2))/(E^(2*x)*(4 - 4*x + x^2)),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.67, size = 31, normalized size = 1.41 \begin {gather*} \frac {{\left (x^{2} + 2 \, {\left (x^{2} - 2 \, x + 2\right )} e^{\left (2 \, x\right )} - 2 \, x\right )} e^{\left (-2 \, x\right )}}{x - 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x^2-8*x+4)*exp(x)^2-2*x^3+9*x^2-12*x+4)/(x^2-4*x+4)/exp(x)^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.18, size = 31, normalized size = 1.41 \begin {gather*} \frac {x^{2} e^{\left (-2 \, x\right )} + 2 \, x^{2} - 2 \, x e^{\left (-2 \, x\right )} - 4 \, x + 4}{x - 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x^2-8*x+4)*exp(x)^2-2*x^3+9*x^2-12*x+4)/(x^2-4*x+4)/exp(x)^2,x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.33, size = 18, normalized size = 0.82




method result size



risch \(\frac {4}{x -2}+2 x +{\mathrm e}^{-2 x} x\) \(18\)
default \(\frac {4}{x -2}+2 x -\frac {9 \,{\mathrm e}^{-2 x}}{2}+\frac {\left (2 x +9\right ) {\mathrm e}^{-2 x}}{2}\) \(29\)
norman \(\frac {\left (x^{2}-4 \,{\mathrm e}^{2 x}-2 x +2 \,{\mathrm e}^{2 x} x^{2}\right ) {\mathrm e}^{-2 x}}{x -2}\) \(33\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((2*x^2-8*x+4)*exp(x)^2-2*x^3+9*x^2-12*x+4)/(x^2-4*x+4)/exp(x)^2,x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x^2-8*x+4)*exp(x)^2-2*x^3+9*x^2-12*x+4)/(x^2-4*x+4)/exp(x)^2,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.10, size = 17, normalized size = 0.77 \begin {gather*} 2\,x+x\,{\mathrm {e}}^{-2\,x}+\frac {4}{x-2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((exp(-2*x)*(exp(2*x)*(2*x^2 - 8*x + 4) - 12*x + 9*x^2 - 2*x^3 + 4))/(x^2 - 4*x + 4),x)

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2*x**2-8*x+4)*exp(x)**2-2*x**3+9*x**2-12*x+4)/(x**2-4*x+4)/exp(x)**2,x)

[Out]

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

________________________________________________________________________________________