\(\int \frac {e^{\frac {-5-14 x-5 x^2-x^3-x^4+(-2 x^2-x^3) \log (3)}{1+2 x+x^2}} (-4+4 x-3 x^2-5 x^3-2 x^4+(-4 x-3 x^2-x^3) \log (3))}{1+3 x+3 x^2+x^3} \, dx\) [4628]

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

Optimal result

Integrand size = 100, antiderivative size = 27 \[ \int \frac {e^{\frac {-5-14 x-5 x^2-x^3-x^4+\left (-2 x^2-x^3\right ) \log (3)}{1+2 x+x^2}} \left (-4+4 x-3 x^2-5 x^3-2 x^4+\left (-4 x-3 x^2-x^3\right ) \log (3)\right )}{1+3 x+3 x^2+x^3} \, dx=e^{-5+\frac {x (2+x) (-2+x (1-x-\log (3)))}{(1+x)^2}} \]

[Out]

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

Rubi [F]

\[ \int \frac {e^{\frac {-5-14 x-5 x^2-x^3-x^4+\left (-2 x^2-x^3\right ) \log (3)}{1+2 x+x^2}} \left (-4+4 x-3 x^2-5 x^3-2 x^4+\left (-4 x-3 x^2-x^3\right ) \log (3)\right )}{1+3 x+3 x^2+x^3} \, dx=\int \frac {\exp \left (\frac {-5-14 x-5 x^2-x^3-x^4+\left (-2 x^2-x^3\right ) \log (3)}{1+2 x+x^2}\right ) \left (-4+4 x-3 x^2-5 x^3-2 x^4+\left (-4 x-3 x^2-x^3\right ) \log (3)\right )}{1+3 x+3 x^2+x^3} \, dx \]

[In]

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

[Out]

(1 - Log[3])*Defer[Int][E^(-((5 + 14*x + x^4 + x^3*(1 + Log[3]) + x^2*(5 + Log[9]))/(1 + x)^2)), x] - 2*Defer[
Int][x/E^((5 + 14*x + x^4 + x^3*(1 + Log[3]) + x^2*(5 + Log[9]))/(1 + x)^2), x] - (8 - Log[9])*Defer[Int][1/(E
^((5 + 14*x + x^4 + x^3*(1 + Log[3]) + x^2*(5 + Log[9]))/(1 + x)^2)*(1 + x)^3), x] + (3 - Log[3])*Defer[Int][1
/(E^((5 + 14*x + x^4 + x^3*(1 + Log[3]) + x^2*(5 + Log[9]))/(1 + x)^2)*(1 + x)^2), x]

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

Mathematica [A] (verified)

Time = 7.97 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.52 \[ \int \frac {e^{\frac {-5-14 x-5 x^2-x^3-x^4+\left (-2 x^2-x^3\right ) \log (3)}{1+2 x+x^2}} \left (-4+4 x-3 x^2-5 x^3-2 x^4+\left (-4 x-3 x^2-x^3\right ) \log (3)\right )}{1+3 x+3 x^2+x^3} \, dx=3^{-\frac {x^2 (2+x)}{(1+x)^2}} e^{-\frac {5+14 x+5 x^2+x^3+x^4}{(1+x)^2}} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.25 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.41

method result size
risch \({\mathrm e}^{-\frac {x^{3} \ln \left (3\right )+x^{4}+2 x^{2} \ln \left (3\right )+x^{3}+5 x^{2}+14 x +5}{\left (1+x \right )^{2}}}\) \(38\)
gosper \({\mathrm e}^{-\frac {x^{3} \ln \left (3\right )+x^{4}+2 x^{2} \ln \left (3\right )+x^{3}+5 x^{2}+14 x +5}{x^{2}+2 x +1}}\) \(43\)
parallelrisch \({\mathrm e}^{\frac {\left (-x^{3}-2 x^{2}\right ) \ln \left (3\right )-x^{4}-x^{3}-5 x^{2}-14 x -5}{x^{2}+2 x +1}}\) \(47\)
norman \(\frac {x^{2} {\mathrm e}^{\frac {\left (-x^{3}-2 x^{2}\right ) \ln \left (3\right )-x^{4}-x^{3}-5 x^{2}-14 x -5}{x^{2}+2 x +1}}+2 x \,{\mathrm e}^{\frac {\left (-x^{3}-2 x^{2}\right ) \ln \left (3\right )-x^{4}-x^{3}-5 x^{2}-14 x -5}{x^{2}+2 x +1}}+{\mathrm e}^{\frac {\left (-x^{3}-2 x^{2}\right ) \ln \left (3\right )-x^{4}-x^{3}-5 x^{2}-14 x -5}{x^{2}+2 x +1}}}{\left (1+x \right )^{2}}\) \(153\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.52 \[ \int \frac {e^{\frac {-5-14 x-5 x^2-x^3-x^4+\left (-2 x^2-x^3\right ) \log (3)}{1+2 x+x^2}} \left (-4+4 x-3 x^2-5 x^3-2 x^4+\left (-4 x-3 x^2-x^3\right ) \log (3)\right )}{1+3 x+3 x^2+x^3} \, dx=e^{\left (-\frac {x^{4} + x^{3} + 5 \, x^{2} + {\left (x^{3} + 2 \, x^{2}\right )} \log \left (3\right ) + 14 \, x + 5}{x^{2} + 2 \, x + 1}\right )} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.44 \[ \int \frac {e^{\frac {-5-14 x-5 x^2-x^3-x^4+\left (-2 x^2-x^3\right ) \log (3)}{1+2 x+x^2}} \left (-4+4 x-3 x^2-5 x^3-2 x^4+\left (-4 x-3 x^2-x^3\right ) \log (3)\right )}{1+3 x+3 x^2+x^3} \, dx=e^{\frac {- x^{4} - x^{3} - 5 x^{2} - 14 x + \left (- x^{3} - 2 x^{2}\right ) \log {\left (3 \right )} - 5}{x^{2} + 2 x + 1}} \]

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (23) = 46\).

Time = 0.50 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.04 \[ \int \frac {e^{\frac {-5-14 x-5 x^2-x^3-x^4+\left (-2 x^2-x^3\right ) \log (3)}{1+2 x+x^2}} \left (-4+4 x-3 x^2-5 x^3-2 x^4+\left (-4 x-3 x^2-x^3\right ) \log (3)\right )}{1+3 x+3 x^2+x^3} \, dx=e^{\left (-x^{2} - x \log \left (3\right ) + x - \frac {\log \left (3\right )}{x^{2} + 2 \, x + 1} + \frac {\log \left (3\right )}{x + 1} + \frac {4}{x^{2} + 2 \, x + 1} - \frac {3}{x + 1} - 6\right )} \]

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 106 vs. \(2 (23) = 46\).

Time = 0.27 (sec) , antiderivative size = 106, normalized size of antiderivative = 3.93 \[ \int \frac {e^{\frac {-5-14 x-5 x^2-x^3-x^4+\left (-2 x^2-x^3\right ) \log (3)}{1+2 x+x^2}} \left (-4+4 x-3 x^2-5 x^3-2 x^4+\left (-4 x-3 x^2-x^3\right ) \log (3)\right )}{1+3 x+3 x^2+x^3} \, dx=e^{\left (-\frac {x^{4}}{x^{2} + 2 \, x + 1} - \frac {x^{3} \log \left (3\right )}{x^{2} + 2 \, x + 1} - \frac {x^{3}}{x^{2} + 2 \, x + 1} - \frac {2 \, x^{2} \log \left (3\right )}{x^{2} + 2 \, x + 1} - \frac {5 \, x^{2}}{x^{2} + 2 \, x + 1} - \frac {14 \, x}{x^{2} + 2 \, x + 1} - \frac {5}{x^{2} + 2 \, x + 1}\right )} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.46 (sec) , antiderivative size = 98, normalized size of antiderivative = 3.63 \[ \int \frac {e^{\frac {-5-14 x-5 x^2-x^3-x^4+\left (-2 x^2-x^3\right ) \log (3)}{1+2 x+x^2}} \left (-4+4 x-3 x^2-5 x^3-2 x^4+\left (-4 x-3 x^2-x^3\right ) \log (3)\right )}{1+3 x+3 x^2+x^3} \, dx={\left (\frac {1}{3}\right )}^{\frac {x^3+2\,x^2}{x^2+2\,x+1}}\,{\mathrm {e}}^{-\frac {x^3}{x^2+2\,x+1}}\,{\mathrm {e}}^{-\frac {x^4}{x^2+2\,x+1}}\,{\mathrm {e}}^{-\frac {5\,x^2}{x^2+2\,x+1}}\,{\mathrm {e}}^{-\frac {5}{x^2+2\,x+1}}\,{\mathrm {e}}^{-\frac {14\,x}{x^2+2\,x+1}} \]

[In]

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

[Out]

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