3.7.10 \(\int \frac {-9+x+7 x^2-2 x^3+e^x (3 x-x^2)}{-3 x+x^2} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.26, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {1593, 6742, 2194, 1620} \begin {gather*} -x^2+x-e^x+\log (3-x)+3 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-E^x + x - x^2 + Log[3 - x] + 3*Log[x]

Rule 1593

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 1620

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[Px*(a + b*x)
^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && PolyQ[Px, x] && (IntegersQ[m, n] || IGtQ[m, -2]) &&
GtQ[Expon[Px, x], 2]

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 {-9+x+7 x^2-2 x^3+e^x \left (3 x-x^2\right )}{(-3+x) x} \, dx\\ &=\int \left (-e^x+\frac {-9+x+7 x^2-2 x^3}{(-3+x) x}\right ) \, dx\\ &=-\int e^x \, dx+\int \frac {-9+x+7 x^2-2 x^3}{(-3+x) x} \, dx\\ &=-e^x+\int \left (1+\frac {1}{-3+x}+\frac {3}{x}-2 x\right ) \, dx\\ &=-e^x+x-x^2+\log (3-x)+3 \log (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.07, size = 22, normalized size = 1.00 \begin {gather*} -e^x+x-x^2+\log (3-x)+3 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-E^x + x - x^2 + Log[3 - x] + 3*Log[x]

________________________________________________________________________________________

fricas [A]  time = 0.68, size = 19, normalized size = 0.86 \begin {gather*} -x^{2} + x - e^{x} + \log \left (x - 3\right ) + 3 \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x^2 + x - e^x + log(x - 3) + 3*log(x)

________________________________________________________________________________________

giac [A]  time = 0.33, size = 19, normalized size = 0.86 \begin {gather*} -x^{2} + x - e^{x} + \log \left (x - 3\right ) + 3 \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x^2 + x - e^x + log(x - 3) + 3*log(x)

________________________________________________________________________________________

maple [A]  time = 0.30, size = 20, normalized size = 0.91




method result size



default \(\ln \left (x -3\right )+3 \ln \relax (x )+x -x^{2}-{\mathrm e}^{x}\) \(20\)
norman \(\ln \left (x -3\right )+3 \ln \relax (x )+x -x^{2}-{\mathrm e}^{x}\) \(20\)
risch \(\ln \left (x -3\right )+3 \ln \relax (x )+x -x^{2}-{\mathrm e}^{x}\) \(20\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(x-3)+3*ln(x)+x-x^2-exp(x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 19, normalized size = 0.86 \begin {gather*} x+\ln \left (x-3\right )-{\mathrm {e}}^x+3\,\ln \relax (x)-x^2 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(x + exp(x)*(3*x - x^2) + 7*x^2 - 2*x^3 - 9)/(3*x - x^2),x)

[Out]

x + log(x - 3) - exp(x) + 3*log(x) - x^2

________________________________________________________________________________________

sympy [A]  time = 0.15, size = 17, normalized size = 0.77 \begin {gather*} - x^{2} + x - e^{x} + 3 \log {\relax (x )} + \log {\left (x - 3 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-x**2+3*x)*exp(x)-2*x**3+7*x**2+x-9)/(x**2-3*x),x)

[Out]

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

________________________________________________________________________________________