\(\int \frac {3 e^{-x} x (9 x^2-9 x^3+e^{3 x} (-4+14 x-6 x^2)+e^{2 x} (16-46 x+42 x^2-9 x^3)+e^x (24 x-42 x^2+18 x^3))}{e^{4 x} x+9 x^3+e^{3 x} (-8 x+6 x^2)+e^x (24 x^2-18 x^3)+e^{2 x} (16 x-30 x^2+9 x^3)} \, dx\) [3261]

   Optimal result
   Rubi [F]
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (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 = 139, antiderivative size = 32 \[ \int \frac {3 e^{-x} x \left (9 x^2-9 x^3+e^{3 x} \left (-4+14 x-6 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )+e^x \left (24 x-42 x^2+18 x^3\right )\right )}{e^{4 x} x+9 x^3+e^{3 x} \left (-8 x+6 x^2\right )+e^x \left (24 x^2-18 x^3\right )+e^{2 x} \left (16 x-30 x^2+9 x^3\right )} \, dx=\frac {3 e^{-x} x}{1+\frac {e^x}{-4+3 \left (x-e^{-x} x\right )}} \]

[Out]

exp(ln(x)+ln(3)-x)/(1+exp(x)/(3*x-3*x/exp(x)-4))

Rubi [F]

\[ \int \frac {3 e^{-x} x \left (9 x^2-9 x^3+e^{3 x} \left (-4+14 x-6 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )+e^x \left (24 x-42 x^2+18 x^3\right )\right )}{e^{4 x} x+9 x^3+e^{3 x} \left (-8 x+6 x^2\right )+e^x \left (24 x^2-18 x^3\right )+e^{2 x} \left (16 x-30 x^2+9 x^3\right )} \, dx=\int \frac {3 e^{-x} x \left (9 x^2-9 x^3+e^{3 x} \left (-4+14 x-6 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )+e^x \left (24 x-42 x^2+18 x^3\right )\right )}{e^{4 x} x+9 x^3+e^{3 x} \left (-8 x+6 x^2\right )+e^x \left (24 x^2-18 x^3\right )+e^{2 x} \left (16 x-30 x^2+9 x^3\right )} \, dx \]

[In]

Int[(3*x*(9*x^2 - 9*x^3 + E^(3*x)*(-4 + 14*x - 6*x^2) + E^(2*x)*(16 - 46*x + 42*x^2 - 9*x^3) + E^x*(24*x - 42*
x^2 + 18*x^3)))/(E^x*(E^(4*x)*x + 9*x^3 + E^(3*x)*(-8*x + 6*x^2) + E^x*(24*x^2 - 18*x^3) + E^(2*x)*(16*x - 30*
x^2 + 9*x^3))),x]

[Out]

300*Defer[Int][x/(-4*E^x + E^(2*x) - 3*x + 3*E^x*x)^2, x] - 486*Defer[Int][x^2/(-4*E^x + E^(2*x) - 3*x + 3*E^x
*x)^2, x] + 225*Defer[Int][x^2/(E^x*(-4*E^x + E^(2*x) - 3*x + 3*E^x*x)^2), x] + 324*Defer[Int][x^3/(-4*E^x + E
^(2*x) - 3*x + 3*E^x*x)^2, x] - 243*Defer[Int][x^3/(E^x*(-4*E^x + E^(2*x) - 3*x + 3*E^x*x)^2), x] - 81*Defer[I
nt][x^4/(-4*E^x + E^(2*x) - 3*x + 3*E^x*x)^2, x] + 81*Defer[Int][x^4/(E^x*(-4*E^x + E^(2*x) - 3*x + 3*E^x*x)^2
), x] - 12*Defer[Int][(-4*E^x + E^(2*x) - 3*x + 3*E^x*x)^(-1), x] + 42*Defer[Int][x/(-4*E^x + E^(2*x) - 3*x +
3*E^x*x), x] + 66*Defer[Int][x/(E^x*(-4*E^x + E^(2*x) - 3*x + 3*E^x*x)), x] - 18*Defer[Int][x^2/(-4*E^x + E^(2
*x) - 3*x + 3*E^x*x), x] - 72*Defer[Int][x^2/(E^x*(-4*E^x + E^(2*x) - 3*x + 3*E^x*x)), x] + 27*Defer[Int][x^3/
(E^x*(-4*E^x + E^(2*x) - 3*x + 3*E^x*x)), x]

Rubi steps \begin{align*} \text {integral}& = 3 \int \frac {e^{-x} x \left (9 x^2-9 x^3+e^{3 x} \left (-4+14 x-6 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )+e^x \left (24 x-42 x^2+18 x^3\right )\right )}{e^{4 x} x+9 x^3+e^{3 x} \left (-8 x+6 x^2\right )+e^x \left (24 x^2-18 x^3\right )+e^{2 x} \left (16 x-30 x^2+9 x^3\right )} \, dx \\ & = 3 \int \frac {e^{-x} \left (-9 (-1+x) x^2-2 e^{3 x} \left (2-7 x+3 x^2\right )+6 e^x x \left (4-7 x+3 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )\right )}{\left (e^{2 x}-3 x+e^x (-4+3 x)\right )^2} \, dx \\ & = 3 \int \left (-\frac {e^{-x} \left (4 e^x-22 x-14 e^x x+24 x^2+6 e^x x^2-9 x^3\right )}{-4 e^x+e^{2 x}-3 x+3 e^x x}-\frac {e^{-x} x \left (-100 e^x-75 x+162 e^x x+81 x^2-108 e^x x^2-27 x^3+27 e^x x^3\right )}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2}\right ) \, dx \\ & = -\left (3 \int \frac {e^{-x} \left (4 e^x-22 x-14 e^x x+24 x^2+6 e^x x^2-9 x^3\right )}{-4 e^x+e^{2 x}-3 x+3 e^x x} \, dx\right )-3 \int \frac {e^{-x} x \left (-100 e^x-75 x+162 e^x x+81 x^2-108 e^x x^2-27 x^3+27 e^x x^3\right )}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2} \, dx \\ & = -\left (3 \int \left (-\frac {100 x}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2}+\frac {162 x^2}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2}-\frac {75 e^{-x} x^2}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2}-\frac {108 x^3}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2}+\frac {81 e^{-x} x^3}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2}+\frac {27 x^4}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2}-\frac {27 e^{-x} x^4}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2}\right ) \, dx\right )-3 \int \left (\frac {4}{-4 e^x+e^{2 x}-3 x+3 e^x x}-\frac {14 x}{-4 e^x+e^{2 x}-3 x+3 e^x x}-\frac {22 e^{-x} x}{-4 e^x+e^{2 x}-3 x+3 e^x x}+\frac {6 x^2}{-4 e^x+e^{2 x}-3 x+3 e^x x}+\frac {24 e^{-x} x^2}{-4 e^x+e^{2 x}-3 x+3 e^x x}-\frac {9 e^{-x} x^3}{-4 e^x+e^{2 x}-3 x+3 e^x x}\right ) \, dx \\ & = -\left (12 \int \frac {1}{-4 e^x+e^{2 x}-3 x+3 e^x x} \, dx\right )-18 \int \frac {x^2}{-4 e^x+e^{2 x}-3 x+3 e^x x} \, dx+27 \int \frac {e^{-x} x^3}{-4 e^x+e^{2 x}-3 x+3 e^x x} \, dx+42 \int \frac {x}{-4 e^x+e^{2 x}-3 x+3 e^x x} \, dx+66 \int \frac {e^{-x} x}{-4 e^x+e^{2 x}-3 x+3 e^x x} \, dx-72 \int \frac {e^{-x} x^2}{-4 e^x+e^{2 x}-3 x+3 e^x x} \, dx-81 \int \frac {x^4}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2} \, dx+81 \int \frac {e^{-x} x^4}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2} \, dx+225 \int \frac {e^{-x} x^2}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2} \, dx-243 \int \frac {e^{-x} x^3}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2} \, dx+300 \int \frac {x}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2} \, dx+324 \int \frac {x^3}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2} \, dx-486 \int \frac {x^2}{\left (-4 e^x+e^{2 x}-3 x+3 e^x x\right )^2} \, dx \\ \end{align*}

Mathematica [A] (verified)

Time = 3.60 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.28 \[ \int \frac {3 e^{-x} x \left (9 x^2-9 x^3+e^{3 x} \left (-4+14 x-6 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )+e^x \left (24 x-42 x^2+18 x^3\right )\right )}{e^{4 x} x+9 x^3+e^{3 x} \left (-8 x+6 x^2\right )+e^x \left (24 x^2-18 x^3\right )+e^{2 x} \left (16 x-30 x^2+9 x^3\right )} \, dx=\frac {3 e^{-x} x \left (-3 x+e^x (-4+3 x)\right )}{e^{2 x}-3 x+e^x (-4+3 x)} \]

[In]

Integrate[(3*x*(9*x^2 - 9*x^3 + E^(3*x)*(-4 + 14*x - 6*x^2) + E^(2*x)*(16 - 46*x + 42*x^2 - 9*x^3) + E^x*(24*x
 - 42*x^2 + 18*x^3)))/(E^x*(E^(4*x)*x + 9*x^3 + E^(3*x)*(-8*x + 6*x^2) + E^x*(24*x^2 - 18*x^3) + E^(2*x)*(16*x
 - 30*x^2 + 9*x^3))),x]

[Out]

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

Maple [A] (verified)

Time = 3.74 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.09

method result size
risch \(\frac {3 x \left (3 x -4-3 x \,{\mathrm e}^{-x}\right )}{{\mathrm e}^{2 x}+3 \,{\mathrm e}^{x} x -4 \,{\mathrm e}^{x}-3 x}\) \(35\)
norman \(\frac {\left (-12 \,{\mathrm e}^{x} x -9 x^{2}+9 \,{\mathrm e}^{x} x^{2}\right ) {\mathrm e}^{-x}}{{\mathrm e}^{2 x}+3 \,{\mathrm e}^{x} x -4 \,{\mathrm e}^{x}-3 x}\) \(43\)
parallelrisch \(\frac {16 \,{\mathrm e}^{\ln \left (x \right )+\ln \left (3\right )-x} x \,{\mathrm e}^{2 x}-12 \,{\mathrm e}^{\ln \left (x \right )+\ln \left (3\right )-x} {\mathrm e}^{2 x} x^{2}-4 \,{\mathrm e}^{\ln \left (x \right )+\ln \left (3\right )-x} {\mathrm e}^{3 x} x +9 \,{\mathrm e}^{\ln \left (x \right )+\ln \left (3\right )-x} x^{3} {\mathrm e}^{x}-9 x^{3} {\mathrm e}^{\ln \left (x \right )+\ln \left (3\right )-x}}{3 x^{2} \left ({\mathrm e}^{2 x}+3 \,{\mathrm e}^{x} x -4 \,{\mathrm e}^{x}-3 x \right )}\) \(106\)

[In]

int(((-6*x^2+14*x-4)*exp(x)^3+(-9*x^3+42*x^2-46*x+16)*exp(x)^2+(18*x^3-42*x^2+24*x)*exp(x)-9*x^3+9*x^2)*exp(ln
(x)+ln(3)-x)/(x*exp(x)^4+(6*x^2-8*x)*exp(x)^3+(9*x^3-30*x^2+16*x)*exp(x)^2+(-18*x^3+24*x^2)*exp(x)+9*x^3),x,me
thod=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 72 vs. \(2 (32) = 64\).

Time = 0.26 (sec) , antiderivative size = 72, normalized size of antiderivative = 2.25 \[ \int \frac {3 e^{-x} x \left (9 x^2-9 x^3+e^{3 x} \left (-4+14 x-6 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )+e^x \left (24 x-42 x^2+18 x^3\right )\right )}{e^{4 x} x+9 x^3+e^{3 x} \left (-8 x+6 x^2\right )+e^x \left (24 x^2-18 x^3\right )+e^{2 x} \left (16 x-30 x^2+9 x^3\right )} \, dx=\frac {{\left (3 \, x - 4\right )} e^{\left (-2 \, x + 2 \, \log \left (3\right ) + 2 \, \log \left (x\right )\right )} - e^{\left (-3 \, x + 3 \, \log \left (3\right ) + 3 \, \log \left (x\right )\right )}}{{\left (3 \, x - 4\right )} e^{\left (-x + \log \left (3\right ) + \log \left (x\right )\right )} + 3 \, x - e^{\left (-2 \, x + 2 \, \log \left (3\right ) + 2 \, \log \left (x\right )\right )}} \]

[In]

integrate(((-6*x^2+14*x-4)*exp(x)^3+(-9*x^3+42*x^2-46*x+16)*exp(x)^2+(18*x^3-42*x^2+24*x)*exp(x)-9*x^3+9*x^2)*
exp(log(x)+log(3)-x)/(x*exp(x)^4+(6*x^2-8*x)*exp(x)^3+(9*x^3-30*x^2+16*x)*exp(x)^2+(-18*x^3+24*x^2)*exp(x)+9*x
^3),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.91 \[ \int \frac {3 e^{-x} x \left (9 x^2-9 x^3+e^{3 x} \left (-4+14 x-6 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )+e^x \left (24 x-42 x^2+18 x^3\right )\right )}{e^{4 x} x+9 x^3+e^{3 x} \left (-8 x+6 x^2\right )+e^x \left (24 x^2-18 x^3\right )+e^{2 x} \left (16 x-30 x^2+9 x^3\right )} \, dx=3 x e^{- x} - \frac {3 x e^{x}}{- 3 x + \left (3 x - 4\right ) e^{x} + e^{2 x}} \]

[In]

integrate(((-6*x**2+14*x-4)*exp(x)**3+(-9*x**3+42*x**2-46*x+16)*exp(x)**2+(18*x**3-42*x**2+24*x)*exp(x)-9*x**3
+9*x**2)*exp(ln(x)+ln(3)-x)/(x*exp(x)**4+(6*x**2-8*x)*exp(x)**3+(9*x**3-30*x**2+16*x)*exp(x)**2+(-18*x**3+24*x
**2)*exp(x)+9*x**3),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.91 \[ \int \frac {3 e^{-x} x \left (9 x^2-9 x^3+e^{3 x} \left (-4+14 x-6 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )+e^x \left (24 x-42 x^2+18 x^3\right )\right )}{e^{4 x} x+9 x^3+e^{3 x} \left (-8 x+6 x^2\right )+e^x \left (24 x^2-18 x^3\right )+e^{2 x} \left (16 x-30 x^2+9 x^3\right )} \, dx=\frac {3 \, {\left (3 \, x^{2} - 4 \, x\right )}}{{\left (3 \, x - 4\right )} e^{x} - 3 \, x + e^{\left (2 \, x\right )}} \]

[In]

integrate(((-6*x^2+14*x-4)*exp(x)^3+(-9*x^3+42*x^2-46*x+16)*exp(x)^2+(18*x^3-42*x^2+24*x)*exp(x)-9*x^3+9*x^2)*
exp(log(x)+log(3)-x)/(x*exp(x)^4+(6*x^2-8*x)*exp(x)^3+(9*x^3-30*x^2+16*x)*exp(x)^2+(-18*x^3+24*x^2)*exp(x)+9*x
^3),x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.62 \[ \int \frac {3 e^{-x} x \left (9 x^2-9 x^3+e^{3 x} \left (-4+14 x-6 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )+e^x \left (24 x-42 x^2+18 x^3\right )\right )}{e^{4 x} x+9 x^3+e^{3 x} \left (-8 x+6 x^2\right )+e^x \left (24 x^2-18 x^3\right )+e^{2 x} \left (16 x-30 x^2+9 x^3\right )} \, dx=\frac {3 \, {\left (3 \, x^{2} e^{x} - 3 \, x^{2} - x e^{\left (2 \, x\right )} - 4 \, x e^{x}\right )}}{3 \, x e^{\left (2 \, x\right )} - 3 \, x e^{x} + e^{\left (3 \, x\right )} - 4 \, e^{\left (2 \, x\right )}} \]

[In]

integrate(((-6*x^2+14*x-4)*exp(x)^3+(-9*x^3+42*x^2-46*x+16)*exp(x)^2+(18*x^3-42*x^2+24*x)*exp(x)-9*x^3+9*x^2)*
exp(log(x)+log(3)-x)/(x*exp(x)^4+(6*x^2-8*x)*exp(x)^3+(9*x^3-30*x^2+16*x)*exp(x)^2+(-18*x^3+24*x^2)*exp(x)+9*x
^3),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 9.29 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.44 \[ \int \frac {3 e^{-x} x \left (9 x^2-9 x^3+e^{3 x} \left (-4+14 x-6 x^2\right )+e^{2 x} \left (16-46 x+42 x^2-9 x^3\right )+e^x \left (24 x-42 x^2+18 x^3\right )\right )}{e^{4 x} x+9 x^3+e^{3 x} \left (-8 x+6 x^2\right )+e^x \left (24 x^2-18 x^3\right )+e^{2 x} \left (16 x-30 x^2+9 x^3\right )} \, dx=\frac {12\,x\,{\mathrm {e}}^x-9\,x^2\,{\mathrm {e}}^x+9\,x^2}{4\,{\mathrm {e}}^{2\,x}-{\mathrm {e}}^{3\,x}-3\,x\,{\mathrm {e}}^{2\,x}+3\,x\,{\mathrm {e}}^x} \]

[In]

int(-(exp(log(3) - x + log(x))*(exp(3*x)*(6*x^2 - 14*x + 4) + exp(2*x)*(46*x - 42*x^2 + 9*x^3 - 16) - 9*x^2 +
9*x^3 - exp(x)*(24*x - 42*x^2 + 18*x^3)))/(exp(x)*(24*x^2 - 18*x^3) - exp(3*x)*(8*x - 6*x^2) + x*exp(4*x) + ex
p(2*x)*(16*x - 30*x^2 + 9*x^3) + 9*x^3),x)

[Out]

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