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

   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 = 85, antiderivative size = 28 \[ \int \frac {e^{4+2 x} \left (-18 x+12 x^2-2 x^3\right )+e^{2+x} \left (6 x^2+2 x^3-2 x^4\right )}{4 x^2+e^{4+2 x} \left (9-6 x+x^2\right )+e^{2+x} \left (-12 x+4 x^2\right )} \, dx=2-\frac {(3-x) x}{-1-2 e^{-2-x}+\frac {3}{x}} \]

[Out]

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

Rubi [F]

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

[In]

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

[Out]

-6*Defer[Int][(E^(2 + x)*x^2)/(-3*E^(2 + x) + 2*x + E^(2 + x)*x)^2, x] + 6*Defer[Int][(E^(2 + x)*x^3)/(-3*E^(2
 + x) + 2*x + E^(2 + x)*x)^2, x] - 2*Defer[Int][(E^(2 + x)*x^4)/(-3*E^(2 + x) + 2*x + E^(2 + x)*x)^2, x] + 6*D
efer[Int][(E^(2 + x)*x)/(-3*E^(2 + x) + 2*x + E^(2 + x)*x), x] - 2*Defer[Int][(E^(2 + x)*x^2)/(-3*E^(2 + x) +
2*x + E^(2 + x)*x), x]

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

Mathematica [A] (verified)

Time = 3.20 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.04 \[ \int \frac {e^{4+2 x} \left (-18 x+12 x^2-2 x^3\right )+e^{2+x} \left (6 x^2+2 x^3-2 x^4\right )}{4 x^2+e^{4+2 x} \left (9-6 x+x^2\right )+e^{2+x} \left (-12 x+4 x^2\right )} \, dx=-\frac {2 e^{2+x} (-3+x) x^2}{2 e^{2+x} (-3+x)+4 x} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.20 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.07

method result size
risch \(-x^{2}+\frac {2 x^{3}}{x \,{\mathrm e}^{2+x}-3 \,{\mathrm e}^{2+x}+2 x}\) \(30\)
norman \(\frac {3 x^{2} {\mathrm e}^{2+x}-{\mathrm e}^{2+x} x^{3}}{x \,{\mathrm e}^{2+x}-3 \,{\mathrm e}^{2+x}+2 x}\) \(39\)
parallelrisch \(-\frac {{\mathrm e}^{2+x} x^{3}-3 x^{2} {\mathrm e}^{2+x}}{x \,{\mathrm e}^{2+x}-3 \,{\mathrm e}^{2+x}+2 x}\) \(39\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.04 \[ \int \frac {e^{4+2 x} \left (-18 x+12 x^2-2 x^3\right )+e^{2+x} \left (6 x^2+2 x^3-2 x^4\right )}{4 x^2+e^{4+2 x} \left (9-6 x+x^2\right )+e^{2+x} \left (-12 x+4 x^2\right )} \, dx=-\frac {{\left (x^{3} - 3 \, x^{2}\right )} e^{\left (x + 2\right )}}{{\left (x - 3\right )} e^{\left (x + 2\right )} + 2 \, x} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.68 \[ \int \frac {e^{4+2 x} \left (-18 x+12 x^2-2 x^3\right )+e^{2+x} \left (6 x^2+2 x^3-2 x^4\right )}{4 x^2+e^{4+2 x} \left (9-6 x+x^2\right )+e^{2+x} \left (-12 x+4 x^2\right )} \, dx=\frac {2 x^{3}}{2 x + \left (x - 3\right ) e^{x + 2}} - x^{2} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.29 \[ \int \frac {e^{4+2 x} \left (-18 x+12 x^2-2 x^3\right )+e^{2+x} \left (6 x^2+2 x^3-2 x^4\right )}{4 x^2+e^{4+2 x} \left (9-6 x+x^2\right )+e^{2+x} \left (-12 x+4 x^2\right )} \, dx=-\frac {{\left (x^{3} e^{2} - 3 \, x^{2} e^{2}\right )} e^{x}}{{\left (x e^{2} - 3 \, e^{2}\right )} e^{x} + 2 \, x} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.36 \[ \int \frac {e^{4+2 x} \left (-18 x+12 x^2-2 x^3\right )+e^{2+x} \left (6 x^2+2 x^3-2 x^4\right )}{4 x^2+e^{4+2 x} \left (9-6 x+x^2\right )+e^{2+x} \left (-12 x+4 x^2\right )} \, dx=-\frac {x^{3} e^{\left (x + 2\right )} - 3 \, x^{2} e^{\left (x + 2\right )}}{x e^{\left (x + 2\right )} + 2 \, x - 3 \, e^{\left (x + 2\right )}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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