3.32.76 \(\int \frac {5-2 x+x^2+e^{-2+x^2} (-1+12 x-23 x^2+14 x^3-2 x^4)}{1-2 x+x^2} \, dx\) [3176]

Optimal. Leaf size=29 \[ 4+x+(5-x) \left (e^{-2+x^2}-\frac {x}{-x+x^2}\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.24, antiderivative size = 30, normalized size of antiderivative = 1.03, number of steps used = 11, number of rules used = 7, integrand size = 47, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.149, Rules used = {27, 6874, 697, 2258, 2235, 2240, 2243} \begin {gather*} -e^{x^2-2} x+5 e^{x^2-2}+x+\frac {4}{1-x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(5 - 2*x + x^2 + E^(-2 + x^2)*(-1 + 12*x - 23*x^2 + 14*x^3 - 2*x^4))/(1 - 2*x + x^2),x]

[Out]

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

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 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2240

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Simp[(e + f*x)^n*(
F^(a + b*(c + d*x)^n)/(b*f*n*(c + d*x)^n*Log[F])), x] /; FreeQ[{F, a, b, c, d, e, f, n}, x] && EqQ[m, n - 1] &
& EqQ[d*e - c*f, 0]

Rule 2243

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^(m
- n + 1)*(F^(a + b*(c + d*x)^n)/(b*d*n*Log[F])), x] - Dist[(m - n + 1)/(b*n*Log[F]), Int[(c + d*x)^(m - n)*F^(
a + b*(c + d*x)^n), x], x] /; FreeQ[{F, a, b, c, d}, x] && IntegerQ[2*((m + 1)/n)] && LtQ[0, (m + 1)/n, 5] &&
IntegerQ[n] && (LtQ[0, n, m + 1] || LtQ[m, n, 0])

Rule 2258

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*(u_), x_Symbol] :> Int[ExpandLinearProduct[F^(a + b*(c + d*
x)^n), u, c, d, x], x] /; FreeQ[{F, a, b, c, d, n}, x] && PolynomialQ[u, x]

Rule 6874

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {5-2 x+x^2+e^{-2+x^2} \left (-1+12 x-23 x^2+14 x^3-2 x^4\right )}{(-1+x)^2} \, dx\\ &=\int \left (\frac {5-2 x+x^2}{(-1+x)^2}-e^{-2+x^2} \left (1-10 x+2 x^2\right )\right ) \, dx\\ &=\int \frac {5-2 x+x^2}{(-1+x)^2} \, dx-\int e^{-2+x^2} \left (1-10 x+2 x^2\right ) \, dx\\ &=\int \left (1+\frac {4}{(-1+x)^2}\right ) \, dx-\int \left (e^{-2+x^2}-10 e^{-2+x^2} x+2 e^{-2+x^2} x^2\right ) \, dx\\ &=\frac {4}{1-x}+x-2 \int e^{-2+x^2} x^2 \, dx+10 \int e^{-2+x^2} x \, dx-\int e^{-2+x^2} \, dx\\ &=5 e^{-2+x^2}+\frac {4}{1-x}+x-e^{-2+x^2} x-\frac {\sqrt {\pi } \text {erfi}(x)}{2 e^2}+\int e^{-2+x^2} \, dx\\ &=5 e^{-2+x^2}+\frac {4}{1-x}+x-e^{-2+x^2} x\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.12, size = 28, normalized size = 0.97 \begin {gather*} 5 e^{-2+x^2}-\frac {4}{-1+x}+x-e^{-2+x^2} x \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(5 - 2*x + x^2 + E^(-2 + x^2)*(-1 + 12*x - 23*x^2 + 14*x^3 - 2*x^4))/(1 - 2*x + x^2),x]

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 1.46, size = 27, normalized size = 0.93

method result size
risch \(x -\frac {4}{x -1}+\left (5-x \right ) {\mathrm e}^{x^{2}-2}\) \(22\)
default \(-{\mathrm e}^{x^{2}} {\mathrm e}^{-2} x +5 \,{\mathrm e}^{x^{2}} {\mathrm e}^{-2}+x -\frac {4}{x -1}\) \(27\)
norman \(\frac {x^{2}+6 x \,{\mathrm e}^{x^{2}-2}-{\mathrm e}^{x^{2}-2} x^{2}-5 \,{\mathrm e}^{x^{2}-2}-5}{x -1}\) \(40\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((-2*x^4+14*x^3-23*x^2+12*x-1)*exp(x^2-2)+x^2-2*x+5)/(x^2-2*x+1),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 20, normalized size = 0.69 \begin {gather*} -{\left (x - 5\right )} e^{\left (x^{2} - 2\right )} + x - \frac {4}{x - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x^4+14*x^3-23*x^2+12*x-1)*exp(x^2-2)+x^2-2*x+5)/(x^2-2*x+1),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.45, size = 30, normalized size = 1.03 \begin {gather*} \frac {x^{2} - {\left (x^{2} - 6 \, x + 5\right )} e^{\left (x^{2} - 2\right )} - x - 4}{x - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x^4+14*x^3-23*x^2+12*x-1)*exp(x^2-2)+x^2-2*x+5)/(x^2-2*x+1),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.06, size = 15, normalized size = 0.52 \begin {gather*} x + \left (5 - x\right ) e^{x^{2} - 2} - \frac {4}{x - 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x**4+14*x**3-23*x**2+12*x-1)*exp(x**2-2)+x**2-2*x+5)/(x**2-2*x+1),x)

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 50, normalized size = 1.72 \begin {gather*} \frac {x^{2} e^{2} - x^{2} e^{\left (x^{2}\right )} - x e^{2} + 6 \, x e^{\left (x^{2}\right )} - 4 \, e^{2} - 5 \, e^{\left (x^{2}\right )}}{x e^{2} - e^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x^4+14*x^3-23*x^2+12*x-1)*exp(x^2-2)+x^2-2*x+5)/(x^2-2*x+1),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.11, size = 26, normalized size = 0.90 \begin {gather*} \frac {\left (x-5\right )\,\left (x+{\mathrm {e}}^{x^2-2}-x\,{\mathrm {e}}^{x^2-2}\right )}{x-1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(2*x + exp(x^2 - 2)*(23*x^2 - 12*x - 14*x^3 + 2*x^4 + 1) - x^2 - 5)/(x^2 - 2*x + 1),x)

[Out]

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

________________________________________________________________________________________