\(\int \frac {-9 x+14 x^2-3 x^3+e^x (-6-2 x+x^2)}{-3 x^2+4 x^3-x^4+e^x (-3 x+x^2)} \, dx\) [1078]

   Optimal result
   Rubi [F]
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 56, antiderivative size = 23 \[ \int \frac {-9 x+14 x^2-3 x^3+e^x \left (-6-2 x+x^2\right )}{-3 x^2+4 x^3-x^4+e^x \left (-3 x+x^2\right )} \, dx=\log \left (\frac {x^2 \left (e^x+x-x^2\right )}{500 (-3+x)}\right ) \]

[Out]

ln(1/500*x^2/(-3+x)*(x+exp(x)-x^2))

Rubi [F]

\[ \int \frac {-9 x+14 x^2-3 x^3+e^x \left (-6-2 x+x^2\right )}{-3 x^2+4 x^3-x^4+e^x \left (-3 x+x^2\right )} \, dx=\int \frac {-9 x+14 x^2-3 x^3+e^x \left (-6-2 x+x^2\right )}{-3 x^2+4 x^3-x^4+e^x \left (-3 x+x^2\right )} \, dx \]

[In]

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

[Out]

x - Log[3 - x] + 2*Log[x] + Defer[Int][(E^x + x - x^2)^(-1), x] + 3*Defer[Int][x/(-E^x - x + x^2), x] - Defer[
Int][x^2/(-E^x - x + x^2), x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {9 x-14 x^2+3 x^3-e^x \left (-6-2 x+x^2\right )}{(3-x) x \left (e^x+x-x^2\right )} \, dx \\ & = \int \left (\frac {1-3 x+x^2}{e^x+x-x^2}+\frac {-6-2 x+x^2}{(-3+x) x}\right ) \, dx \\ & = \int \frac {1-3 x+x^2}{e^x+x-x^2} \, dx+\int \frac {-6-2 x+x^2}{(-3+x) x} \, dx \\ & = \int \left (1+\frac {1}{3-x}+\frac {2}{x}\right ) \, dx+\int \left (\frac {1}{e^x+x-x^2}+\frac {3 x}{-e^x-x+x^2}-\frac {x^2}{-e^x-x+x^2}\right ) \, dx \\ & = x-\log (3-x)+2 \log (x)+3 \int \frac {x}{-e^x-x+x^2} \, dx+\int \frac {1}{e^x+x-x^2} \, dx-\int \frac {x^2}{-e^x-x+x^2} \, dx \\ \end{align*}

Mathematica [A] (verified)

Time = 2.02 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.04 \[ \int \frac {-9 x+14 x^2-3 x^3+e^x \left (-6-2 x+x^2\right )}{-3 x^2+4 x^3-x^4+e^x \left (-3 x+x^2\right )} \, dx=-\log (3-x)+2 \log (x)+\log \left (e^x+x-x^2\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.96

method result size
risch \(2 \ln \left (x \right )-\ln \left (-3+x \right )+\ln \left (x +{\mathrm e}^{x}-x^{2}\right )\) \(22\)
norman \(2 \ln \left (x \right )-\ln \left (-3+x \right )+\ln \left (x^{2}-x -{\mathrm e}^{x}\right )\) \(24\)
parallelrisch \(2 \ln \left (x \right )-\ln \left (-3+x \right )+\ln \left (x^{2}-x -{\mathrm e}^{x}\right )\) \(24\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.91 \[ \int \frac {-9 x+14 x^2-3 x^3+e^x \left (-6-2 x+x^2\right )}{-3 x^2+4 x^3-x^4+e^x \left (-3 x+x^2\right )} \, dx=\log \left (-x^{2} + x + e^{x}\right ) - \log \left (x - 3\right ) + 2 \, \log \left (x\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.83 \[ \int \frac {-9 x+14 x^2-3 x^3+e^x \left (-6-2 x+x^2\right )}{-3 x^2+4 x^3-x^4+e^x \left (-3 x+x^2\right )} \, dx=2 \log {\left (x \right )} - \log {\left (x - 3 \right )} + \log {\left (- x^{2} + x + e^{x} \right )} \]

[In]

integrate(((x**2-2*x-6)*exp(x)-3*x**3+14*x**2-9*x)/((x**2-3*x)*exp(x)-x**4+4*x**3-3*x**2),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.91 \[ \int \frac {-9 x+14 x^2-3 x^3+e^x \left (-6-2 x+x^2\right )}{-3 x^2+4 x^3-x^4+e^x \left (-3 x+x^2\right )} \, dx=\log \left (-x^{2} + x + e^{x}\right ) - \log \left (x - 3\right ) + 2 \, \log \left (x\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.91 \[ \int \frac {-9 x+14 x^2-3 x^3+e^x \left (-6-2 x+x^2\right )}{-3 x^2+4 x^3-x^4+e^x \left (-3 x+x^2\right )} \, dx=\log \left (-x^{2} + x + e^{x}\right ) - \log \left (x - 3\right ) + 2 \, \log \left (x\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00 \[ \int \frac {-9 x+14 x^2-3 x^3+e^x \left (-6-2 x+x^2\right )}{-3 x^2+4 x^3-x^4+e^x \left (-3 x+x^2\right )} \, dx=\ln \left (x^2-{\mathrm {e}}^x-x\right )-\ln \left (x-3\right )+2\,\ln \left (x\right ) \]

[In]

int((9*x + exp(x)*(2*x - x^2 + 6) - 14*x^2 + 3*x^3)/(exp(x)*(3*x - x^2) + 3*x^2 - 4*x^3 + x^4),x)

[Out]

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