\(\int \frac {40 x^3+42 x^4-2 x^6+e^{3 x} (2 x+6 x^2+2 x^3)+e^{2 x} (20 x+38 x^2-32 x^3-16 x^4)+e^x (50 x+40 x^2-182 x^3-24 x^4+16 x^5)+(-8 x^3-10 x^4-2 x^5+e^{2 x} (-4 x-10 x^2+2 x^3+2 x^4)+e^x (-20 x-28 x^2+60 x^3+20 x^4-2 x^5)) \log (9+27 x+9 x^2)+e^x (2 x+4 x^2-4 x^3-2 x^4) \log ^2(9+27 x+9 x^2)}{-x^3-3 x^4-x^5+e^{3 x} (1+3 x+x^2)+e^{2 x} (-3 x-9 x^2-3 x^3)+e^x (3 x^2+9 x^3+3 x^4)} \, dx\) [1993]

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

Optimal result

Integrand size = 279, antiderivative size = 32 \[ \int \frac {40 x^3+42 x^4-2 x^6+e^{3 x} \left (2 x+6 x^2+2 x^3\right )+e^{2 x} \left (20 x+38 x^2-32 x^3-16 x^4\right )+e^x \left (50 x+40 x^2-182 x^3-24 x^4+16 x^5\right )+\left (-8 x^3-10 x^4-2 x^5+e^{2 x} \left (-4 x-10 x^2+2 x^3+2 x^4\right )+e^x \left (-20 x-28 x^2+60 x^3+20 x^4-2 x^5\right )\right ) \log \left (9+27 x+9 x^2\right )+e^x \left (2 x+4 x^2-4 x^3-2 x^4\right ) \log ^2\left (9+27 x+9 x^2\right )}{-x^3-3 x^4-x^5+e^{3 x} \left (1+3 x+x^2\right )+e^{2 x} \left (-3 x-9 x^2-3 x^3\right )+e^x \left (3 x^2+9 x^3+3 x^4\right )} \, dx=\left (x+x \left (-2+\frac {5-\log \left (9 \left (x+(1+x)^2\right )\right )}{-e^x+x}\right )\right )^2 \] Output:

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

Mathematica [A] (verified)

Time = 0.13 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.06 \[ \int \frac {40 x^3+42 x^4-2 x^6+e^{3 x} \left (2 x+6 x^2+2 x^3\right )+e^{2 x} \left (20 x+38 x^2-32 x^3-16 x^4\right )+e^x \left (50 x+40 x^2-182 x^3-24 x^4+16 x^5\right )+\left (-8 x^3-10 x^4-2 x^5+e^{2 x} \left (-4 x-10 x^2+2 x^3+2 x^4\right )+e^x \left (-20 x-28 x^2+60 x^3+20 x^4-2 x^5\right )\right ) \log \left (9+27 x+9 x^2\right )+e^x \left (2 x+4 x^2-4 x^3-2 x^4\right ) \log ^2\left (9+27 x+9 x^2\right )}{-x^3-3 x^4-x^5+e^{3 x} \left (1+3 x+x^2\right )+e^{2 x} \left (-3 x-9 x^2-3 x^3\right )+e^x \left (3 x^2+9 x^3+3 x^4\right )} \, dx=\frac {x^2 \left (-5-e^x+x+\log \left (9 \left (1+3 x+x^2\right )\right )\right )^2}{\left (e^x-x\right )^2} \] Input:

Integrate[(40*x^3 + 42*x^4 - 2*x^6 + E^(3*x)*(2*x + 6*x^2 + 2*x^3) + E^(2* 
x)*(20*x + 38*x^2 - 32*x^3 - 16*x^4) + E^x*(50*x + 40*x^2 - 182*x^3 - 24*x 
^4 + 16*x^5) + (-8*x^3 - 10*x^4 - 2*x^5 + E^(2*x)*(-4*x - 10*x^2 + 2*x^3 + 
 2*x^4) + E^x*(-20*x - 28*x^2 + 60*x^3 + 20*x^4 - 2*x^5))*Log[9 + 27*x + 9 
*x^2] + E^x*(2*x + 4*x^2 - 4*x^3 - 2*x^4)*Log[9 + 27*x + 9*x^2]^2)/(-x^3 - 
 3*x^4 - x^5 + E^(3*x)*(1 + 3*x + x^2) + E^(2*x)*(-3*x - 9*x^2 - 3*x^3) + 
E^x*(3*x^2 + 9*x^3 + 3*x^4)),x]
 

Output:

(x^2*(-5 - E^x + x + Log[9*(1 + 3*x + x^2)])^2)/(E^x - x)^2
 

Rubi [F]

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {-2 x^6+42 x^4+40 x^3+e^{3 x} \left (2 x^3+6 x^2+2 x\right )+e^{2 x} \left (-16 x^4-32 x^3+38 x^2+20 x\right )+e^x \left (-2 x^4-4 x^3+4 x^2+2 x\right ) \log ^2\left (9 x^2+27 x+9\right )+e^x \left (16 x^5-24 x^4-182 x^3+40 x^2+50 x\right )+\left (-2 x^5-10 x^4-8 x^3+e^{2 x} \left (2 x^4+2 x^3-10 x^2-4 x\right )+e^x \left (-2 x^5+20 x^4+60 x^3-28 x^2-20 x\right )\right ) \log \left (9 x^2+27 x+9\right )}{-x^5-3 x^4-x^3+e^{3 x} \left (x^2+3 x+1\right )+e^{2 x} \left (-3 x^3-9 x^2-3 x\right )+e^x \left (3 x^4+9 x^3+3 x^2\right )} \, dx\)

\(\Big \downarrow \) 7292

\(\displaystyle \int \frac {-2 x^6+42 x^4+40 x^3+e^{3 x} \left (2 x^3+6 x^2+2 x\right )+e^{2 x} \left (-16 x^4-32 x^3+38 x^2+20 x\right )+e^x \left (-2 x^4-4 x^3+4 x^2+2 x\right ) \log ^2\left (9 x^2+27 x+9\right )+e^x \left (16 x^5-24 x^4-182 x^3+40 x^2+50 x\right )+\left (-2 x^5-10 x^4-8 x^3+e^{2 x} \left (2 x^4+2 x^3-10 x^2-4 x\right )+e^x \left (-2 x^5+20 x^4+60 x^3-28 x^2-20 x\right )\right ) \log \left (9 x^2+27 x+9\right )}{\left (e^x-x\right )^3 \left (x^2+3 x+1\right )}dx\)

\(\Big \downarrow \) 7279

\(\displaystyle \int \left (-\frac {2 (x-1) x^2 \left (\log \left (9 \left (x^2+3 x+1\right )\right )-5\right )^2}{\left (e^x-x\right )^3}+\frac {2 x \left (-5 x^3-7 x^2+x^2 \log \left (9 \left (x^2+3 x+1\right )\right )-5 x \log \left (9 \left (x^2+3 x+1\right )\right )-2 \log \left (9 \left (x^2+3 x+1\right )\right )+x^3 \log \left (9 \left (x^2+3 x+1\right )\right )+22 x+10\right )}{\left (e^x-x\right ) \left (x^2+3 x+1\right )}+\frac {2 x \left (x^4+7 x^3+10 x^2-2 x^2 \log \left (9 \left (x^2+3 x+1\right )\right )+2 x \log \left (9 \left (x^2+3 x+1\right )\right )+\log \left (9 \left (x^2+3 x+1\right )\right )-x^3 \log \left (9 \left (x^2+3 x+1\right )\right )-8 x-5\right ) \left (\log \left (9 \left (x^2+3 x+1\right )\right )-5\right )}{\left (e^x-x\right )^2 \left (x^2+3 x+1\right )}+2 x\right )dx\)

\(\Big \downarrow \) 7299

\(\displaystyle \int \left (-\frac {2 (x-1) x^2 \left (\log \left (9 \left (x^2+3 x+1\right )\right )-5\right )^2}{\left (e^x-x\right )^3}+\frac {2 x \left (-5 x^3-7 x^2+x^2 \log \left (9 \left (x^2+3 x+1\right )\right )-5 x \log \left (9 \left (x^2+3 x+1\right )\right )-2 \log \left (9 \left (x^2+3 x+1\right )\right )+x^3 \log \left (9 \left (x^2+3 x+1\right )\right )+22 x+10\right )}{\left (e^x-x\right ) \left (x^2+3 x+1\right )}+\frac {2 x \left (x^4+7 x^3+10 x^2-2 x^2 \log \left (9 \left (x^2+3 x+1\right )\right )+2 x \log \left (9 \left (x^2+3 x+1\right )\right )+\log \left (9 \left (x^2+3 x+1\right )\right )-x^3 \log \left (9 \left (x^2+3 x+1\right )\right )-8 x-5\right ) \left (\log \left (9 \left (x^2+3 x+1\right )\right )-5\right )}{\left (e^x-x\right )^2 \left (x^2+3 x+1\right )}+2 x\right )dx\)

Input:

Int[(40*x^3 + 42*x^4 - 2*x^6 + E^(3*x)*(2*x + 6*x^2 + 2*x^3) + E^(2*x)*(20 
*x + 38*x^2 - 32*x^3 - 16*x^4) + E^x*(50*x + 40*x^2 - 182*x^3 - 24*x^4 + 1 
6*x^5) + (-8*x^3 - 10*x^4 - 2*x^5 + E^(2*x)*(-4*x - 10*x^2 + 2*x^3 + 2*x^4 
) + E^x*(-20*x - 28*x^2 + 60*x^3 + 20*x^4 - 2*x^5))*Log[9 + 27*x + 9*x^2] 
+ E^x*(2*x + 4*x^2 - 4*x^3 - 2*x^4)*Log[9 + 27*x + 9*x^2]^2)/(-x^3 - 3*x^4 
 - x^5 + E^(3*x)*(1 + 3*x + x^2) + E^(2*x)*(-3*x - 9*x^2 - 3*x^3) + E^x*(3 
*x^2 + 9*x^3 + 3*x^4)),x]
 

Output:

$Aborted
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(90\) vs. \(2(33)=66\).

Time = 0.07 (sec) , antiderivative size = 91, normalized size of antiderivative = 2.84

\[\frac {x^{2} \ln \left (9 x^{2}+27 x +9\right )^{2}}{\left (x -{\mathrm e}^{x}\right )^{2}}+\frac {2 x^{2} \left (x -{\mathrm e}^{x}-5\right ) \ln \left (9 x^{2}+27 x +9\right )}{\left (x -{\mathrm e}^{x}\right )^{2}}+\frac {x^{2} \left (x^{2}-2 \,{\mathrm e}^{x} x +{\mathrm e}^{2 x}-10 x +10 \,{\mathrm e}^{x}+25\right )}{\left (x -{\mathrm e}^{x}\right )^{2}}\]

Input:

int(((-2*x^4-4*x^3+4*x^2+2*x)*exp(x)*ln(9*x^2+27*x+9)^2+((2*x^4+2*x^3-10*x 
^2-4*x)*exp(x)^2+(-2*x^5+20*x^4+60*x^3-28*x^2-20*x)*exp(x)-2*x^5-10*x^4-8* 
x^3)*ln(9*x^2+27*x+9)+(2*x^3+6*x^2+2*x)*exp(x)^3+(-16*x^4-32*x^3+38*x^2+20 
*x)*exp(x)^2+(16*x^5-24*x^4-182*x^3+40*x^2+50*x)*exp(x)-2*x^6+42*x^4+40*x^ 
3)/((x^2+3*x+1)*exp(x)^3+(-3*x^3-9*x^2-3*x)*exp(x)^2+(3*x^4+9*x^3+3*x^2)*e 
xp(x)-x^5-3*x^4-x^3),x)
 

Output:

x^2/(x-exp(x))^2*ln(9*x^2+27*x+9)^2+2*x^2*(x-exp(x)-5)/(x-exp(x))^2*ln(9*x 
^2+27*x+9)+x^2*(x^2-2*exp(x)*x+exp(2*x)-10*x+10*exp(x)+25)/(x-exp(x))^2
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 97 vs. \(2 (33) = 66\).

Time = 0.09 (sec) , antiderivative size = 97, normalized size of antiderivative = 3.03 \[ \int \frac {40 x^3+42 x^4-2 x^6+e^{3 x} \left (2 x+6 x^2+2 x^3\right )+e^{2 x} \left (20 x+38 x^2-32 x^3-16 x^4\right )+e^x \left (50 x+40 x^2-182 x^3-24 x^4+16 x^5\right )+\left (-8 x^3-10 x^4-2 x^5+e^{2 x} \left (-4 x-10 x^2+2 x^3+2 x^4\right )+e^x \left (-20 x-28 x^2+60 x^3+20 x^4-2 x^5\right )\right ) \log \left (9+27 x+9 x^2\right )+e^x \left (2 x+4 x^2-4 x^3-2 x^4\right ) \log ^2\left (9+27 x+9 x^2\right )}{-x^3-3 x^4-x^5+e^{3 x} \left (1+3 x+x^2\right )+e^{2 x} \left (-3 x-9 x^2-3 x^3\right )+e^x \left (3 x^2+9 x^3+3 x^4\right )} \, dx=\frac {x^{4} + x^{2} \log \left (9 \, x^{2} + 27 \, x + 9\right )^{2} - 10 \, x^{3} + x^{2} e^{\left (2 \, x\right )} + 25 \, x^{2} - 2 \, {\left (x^{3} - 5 \, x^{2}\right )} e^{x} + 2 \, {\left (x^{3} - x^{2} e^{x} - 5 \, x^{2}\right )} \log \left (9 \, x^{2} + 27 \, x + 9\right )}{x^{2} - 2 \, x e^{x} + e^{\left (2 \, x\right )}} \] Input:

integrate(((-2*x^4-4*x^3+4*x^2+2*x)*exp(x)*log(9*x^2+27*x+9)^2+((2*x^4+2*x 
^3-10*x^2-4*x)*exp(x)^2+(-2*x^5+20*x^4+60*x^3-28*x^2-20*x)*exp(x)-2*x^5-10 
*x^4-8*x^3)*log(9*x^2+27*x+9)+(2*x^3+6*x^2+2*x)*exp(x)^3+(-16*x^4-32*x^3+3 
8*x^2+20*x)*exp(x)^2+(16*x^5-24*x^4-182*x^3+40*x^2+50*x)*exp(x)-2*x^6+42*x 
^4+40*x^3)/((x^2+3*x+1)*exp(x)^3+(-3*x^3-9*x^2-3*x)*exp(x)^2+(3*x^4+9*x^3+ 
3*x^2)*exp(x)-x^5-3*x^4-x^3),x, algorithm="fricas")
 

Output:

(x^4 + x^2*log(9*x^2 + 27*x + 9)^2 - 10*x^3 + x^2*e^(2*x) + 25*x^2 - 2*(x^ 
3 - 5*x^2)*e^x + 2*(x^3 - x^2*e^x - 5*x^2)*log(9*x^2 + 27*x + 9))/(x^2 - 2 
*x*e^x + e^(2*x))
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 104 vs. \(2 (24) = 48\).

Time = 0.20 (sec) , antiderivative size = 104, normalized size of antiderivative = 3.25 \[ \int \frac {40 x^3+42 x^4-2 x^6+e^{3 x} \left (2 x+6 x^2+2 x^3\right )+e^{2 x} \left (20 x+38 x^2-32 x^3-16 x^4\right )+e^x \left (50 x+40 x^2-182 x^3-24 x^4+16 x^5\right )+\left (-8 x^3-10 x^4-2 x^5+e^{2 x} \left (-4 x-10 x^2+2 x^3+2 x^4\right )+e^x \left (-20 x-28 x^2+60 x^3+20 x^4-2 x^5\right )\right ) \log \left (9+27 x+9 x^2\right )+e^x \left (2 x+4 x^2-4 x^3-2 x^4\right ) \log ^2\left (9+27 x+9 x^2\right )}{-x^3-3 x^4-x^5+e^{3 x} \left (1+3 x+x^2\right )+e^{2 x} \left (-3 x-9 x^2-3 x^3\right )+e^x \left (3 x^2+9 x^3+3 x^4\right )} \, dx=x^{2} + \frac {2 x^{3} \log {\left (9 x^{2} + 27 x + 9 \right )} - 10 x^{3} + x^{2} \log {\left (9 x^{2} + 27 x + 9 \right )}^{2} - 10 x^{2} \log {\left (9 x^{2} + 27 x + 9 \right )} + 25 x^{2} + \left (- 2 x^{2} \log {\left (9 x^{2} + 27 x + 9 \right )} + 10 x^{2}\right ) e^{x}}{x^{2} - 2 x e^{x} + e^{2 x}} \] Input:

integrate(((-2*x**4-4*x**3+4*x**2+2*x)*exp(x)*ln(9*x**2+27*x+9)**2+((2*x** 
4+2*x**3-10*x**2-4*x)*exp(x)**2+(-2*x**5+20*x**4+60*x**3-28*x**2-20*x)*exp 
(x)-2*x**5-10*x**4-8*x**3)*ln(9*x**2+27*x+9)+(2*x**3+6*x**2+2*x)*exp(x)**3 
+(-16*x**4-32*x**3+38*x**2+20*x)*exp(x)**2+(16*x**5-24*x**4-182*x**3+40*x* 
*2+50*x)*exp(x)-2*x**6+42*x**4+40*x**3)/((x**2+3*x+1)*exp(x)**3+(-3*x**3-9 
*x**2-3*x)*exp(x)**2+(3*x**4+9*x**3+3*x**2)*exp(x)-x**5-3*x**4-x**3),x)
 

Output:

x**2 + (2*x**3*log(9*x**2 + 27*x + 9) - 10*x**3 + x**2*log(9*x**2 + 27*x + 
 9)**2 - 10*x**2*log(9*x**2 + 27*x + 9) + 25*x**2 + (-2*x**2*log(9*x**2 + 
27*x + 9) + 10*x**2)*exp(x))/(x**2 - 2*x*exp(x) + exp(2*x))
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 120 vs. \(2 (33) = 66\).

Time = 0.20 (sec) , antiderivative size = 120, normalized size of antiderivative = 3.75 \[ \int \frac {40 x^3+42 x^4-2 x^6+e^{3 x} \left (2 x+6 x^2+2 x^3\right )+e^{2 x} \left (20 x+38 x^2-32 x^3-16 x^4\right )+e^x \left (50 x+40 x^2-182 x^3-24 x^4+16 x^5\right )+\left (-8 x^3-10 x^4-2 x^5+e^{2 x} \left (-4 x-10 x^2+2 x^3+2 x^4\right )+e^x \left (-20 x-28 x^2+60 x^3+20 x^4-2 x^5\right )\right ) \log \left (9+27 x+9 x^2\right )+e^x \left (2 x+4 x^2-4 x^3-2 x^4\right ) \log ^2\left (9+27 x+9 x^2\right )}{-x^3-3 x^4-x^5+e^{3 x} \left (1+3 x+x^2\right )+e^{2 x} \left (-3 x-9 x^2-3 x^3\right )+e^x \left (3 x^2+9 x^3+3 x^4\right )} \, dx=\frac {x^{4} + 2 \, x^{3} {\left (2 \, \log \left (3\right ) - 5\right )} + x^{2} \log \left (x^{2} + 3 \, x + 1\right )^{2} + {\left (4 \, \log \left (3\right )^{2} - 20 \, \log \left (3\right ) + 25\right )} x^{2} + x^{2} e^{\left (2 \, x\right )} - 2 \, {\left (x^{3} + x^{2} {\left (2 \, \log \left (3\right ) - 5\right )}\right )} e^{x} + 2 \, {\left (x^{3} + x^{2} {\left (2 \, \log \left (3\right ) - 5\right )} - x^{2} e^{x}\right )} \log \left (x^{2} + 3 \, x + 1\right )}{x^{2} - 2 \, x e^{x} + e^{\left (2 \, x\right )}} \] Input:

integrate(((-2*x^4-4*x^3+4*x^2+2*x)*exp(x)*log(9*x^2+27*x+9)^2+((2*x^4+2*x 
^3-10*x^2-4*x)*exp(x)^2+(-2*x^5+20*x^4+60*x^3-28*x^2-20*x)*exp(x)-2*x^5-10 
*x^4-8*x^3)*log(9*x^2+27*x+9)+(2*x^3+6*x^2+2*x)*exp(x)^3+(-16*x^4-32*x^3+3 
8*x^2+20*x)*exp(x)^2+(16*x^5-24*x^4-182*x^3+40*x^2+50*x)*exp(x)-2*x^6+42*x 
^4+40*x^3)/((x^2+3*x+1)*exp(x)^3+(-3*x^3-9*x^2-3*x)*exp(x)^2+(3*x^4+9*x^3+ 
3*x^2)*exp(x)-x^5-3*x^4-x^3),x, algorithm="maxima")
 

Output:

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 119 vs. \(2 (33) = 66\).

Time = 0.23 (sec) , antiderivative size = 119, normalized size of antiderivative = 3.72 \[ \int \frac {40 x^3+42 x^4-2 x^6+e^{3 x} \left (2 x+6 x^2+2 x^3\right )+e^{2 x} \left (20 x+38 x^2-32 x^3-16 x^4\right )+e^x \left (50 x+40 x^2-182 x^3-24 x^4+16 x^5\right )+\left (-8 x^3-10 x^4-2 x^5+e^{2 x} \left (-4 x-10 x^2+2 x^3+2 x^4\right )+e^x \left (-20 x-28 x^2+60 x^3+20 x^4-2 x^5\right )\right ) \log \left (9+27 x+9 x^2\right )+e^x \left (2 x+4 x^2-4 x^3-2 x^4\right ) \log ^2\left (9+27 x+9 x^2\right )}{-x^3-3 x^4-x^5+e^{3 x} \left (1+3 x+x^2\right )+e^{2 x} \left (-3 x-9 x^2-3 x^3\right )+e^x \left (3 x^2+9 x^3+3 x^4\right )} \, dx=\frac {x^{4} - 2 \, x^{3} e^{x} + 2 \, x^{3} \log \left (9 \, x^{2} + 27 \, x + 9\right ) - 2 \, x^{2} e^{x} \log \left (9 \, x^{2} + 27 \, x + 9\right ) + x^{2} \log \left (9 \, x^{2} + 27 \, x + 9\right )^{2} - 10 \, x^{3} + x^{2} e^{\left (2 \, x\right )} + 10 \, x^{2} e^{x} - 10 \, x^{2} \log \left (9 \, x^{2} + 27 \, x + 9\right ) + 25 \, x^{2}}{x^{2} - 2 \, x e^{x} + e^{\left (2 \, x\right )}} \] Input:

integrate(((-2*x^4-4*x^3+4*x^2+2*x)*exp(x)*log(9*x^2+27*x+9)^2+((2*x^4+2*x 
^3-10*x^2-4*x)*exp(x)^2+(-2*x^5+20*x^4+60*x^3-28*x^2-20*x)*exp(x)-2*x^5-10 
*x^4-8*x^3)*log(9*x^2+27*x+9)+(2*x^3+6*x^2+2*x)*exp(x)^3+(-16*x^4-32*x^3+3 
8*x^2+20*x)*exp(x)^2+(16*x^5-24*x^4-182*x^3+40*x^2+50*x)*exp(x)-2*x^6+42*x 
^4+40*x^3)/((x^2+3*x+1)*exp(x)^3+(-3*x^3-9*x^2-3*x)*exp(x)^2+(3*x^4+9*x^3+ 
3*x^2)*exp(x)-x^5-3*x^4-x^3),x, algorithm="giac")
 

Output:

(x^4 - 2*x^3*e^x + 2*x^3*log(9*x^2 + 27*x + 9) - 2*x^2*e^x*log(9*x^2 + 27* 
x + 9) + x^2*log(9*x^2 + 27*x + 9)^2 - 10*x^3 + x^2*e^(2*x) + 10*x^2*e^x - 
 10*x^2*log(9*x^2 + 27*x + 9) + 25*x^2)/(x^2 - 2*x*e^x + e^(2*x))
 

Mupad [B] (verification not implemented)

Time = 5.76 (sec) , antiderivative size = 137, normalized size of antiderivative = 4.28 \[ \int \frac {40 x^3+42 x^4-2 x^6+e^{3 x} \left (2 x+6 x^2+2 x^3\right )+e^{2 x} \left (20 x+38 x^2-32 x^3-16 x^4\right )+e^x \left (50 x+40 x^2-182 x^3-24 x^4+16 x^5\right )+\left (-8 x^3-10 x^4-2 x^5+e^{2 x} \left (-4 x-10 x^2+2 x^3+2 x^4\right )+e^x \left (-20 x-28 x^2+60 x^3+20 x^4-2 x^5\right )\right ) \log \left (9+27 x+9 x^2\right )+e^x \left (2 x+4 x^2-4 x^3-2 x^4\right ) \log ^2\left (9+27 x+9 x^2\right )}{-x^3-3 x^4-x^5+e^{3 x} \left (1+3 x+x^2\right )+e^{2 x} \left (-3 x-9 x^2-3 x^3\right )+e^x \left (3 x^2+9 x^3+3 x^4\right )} \, dx=x^2+\frac {10\,\left (x^2-x^3\right )}{\left (x-{\mathrm {e}}^x\right )\,\left (x-1\right )}-\frac {25\,\left (x^2-x^3\right )}{\left (x-1\right )\,\left ({\mathrm {e}}^{2\,x}-2\,x\,{\mathrm {e}}^x+x^2\right )}-\frac {\ln \left (9\,x^2+27\,x+9\right )\,\left (2\,x^2\,{\mathrm {e}}^x+10\,x^2-2\,x^3\right )}{{\mathrm {e}}^{2\,x}-2\,x\,{\mathrm {e}}^x+x^2}+\frac {x^2\,{\ln \left (9\,x^2+27\,x+9\right )}^2}{{\mathrm {e}}^{2\,x}-2\,x\,{\mathrm {e}}^x+x^2} \] Input:

int(-(exp(3*x)*(2*x + 6*x^2 + 2*x^3) - log(27*x + 9*x^2 + 9)*(exp(x)*(20*x 
 + 28*x^2 - 60*x^3 - 20*x^4 + 2*x^5) + exp(2*x)*(4*x + 10*x^2 - 2*x^3 - 2* 
x^4) + 8*x^3 + 10*x^4 + 2*x^5) + exp(x)*(50*x + 40*x^2 - 182*x^3 - 24*x^4 
+ 16*x^5) + exp(2*x)*(20*x + 38*x^2 - 32*x^3 - 16*x^4) + 40*x^3 + 42*x^4 - 
 2*x^6 + exp(x)*log(27*x + 9*x^2 + 9)^2*(2*x + 4*x^2 - 4*x^3 - 2*x^4))/(ex 
p(2*x)*(3*x + 9*x^2 + 3*x^3) - exp(x)*(3*x^2 + 9*x^3 + 3*x^4) - exp(3*x)*( 
3*x + x^2 + 1) + x^3 + 3*x^4 + x^5),x)
 

Output:

x^2 + (10*(x^2 - x^3))/((x - exp(x))*(x - 1)) - (25*(x^2 - x^3))/((x - 1)* 
(exp(2*x) - 2*x*exp(x) + x^2)) - (log(27*x + 9*x^2 + 9)*(2*x^2*exp(x) + 10 
*x^2 - 2*x^3))/(exp(2*x) - 2*x*exp(x) + x^2) + (x^2*log(27*x + 9*x^2 + 9)^ 
2)/(exp(2*x) - 2*x*exp(x) + x^2)
 

Reduce [B] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 101, normalized size of antiderivative = 3.16 \[ \int \frac {40 x^3+42 x^4-2 x^6+e^{3 x} \left (2 x+6 x^2+2 x^3\right )+e^{2 x} \left (20 x+38 x^2-32 x^3-16 x^4\right )+e^x \left (50 x+40 x^2-182 x^3-24 x^4+16 x^5\right )+\left (-8 x^3-10 x^4-2 x^5+e^{2 x} \left (-4 x-10 x^2+2 x^3+2 x^4\right )+e^x \left (-20 x-28 x^2+60 x^3+20 x^4-2 x^5\right )\right ) \log \left (9+27 x+9 x^2\right )+e^x \left (2 x+4 x^2-4 x^3-2 x^4\right ) \log ^2\left (9+27 x+9 x^2\right )}{-x^3-3 x^4-x^5+e^{3 x} \left (1+3 x+x^2\right )+e^{2 x} \left (-3 x-9 x^2-3 x^3\right )+e^x \left (3 x^2+9 x^3+3 x^4\right )} \, dx=\frac {x^{2} \left (e^{2 x}-2 e^{x} \mathrm {log}\left (9 x^{2}+27 x +9\right )-2 e^{x} x +10 e^{x}+\mathrm {log}\left (9 x^{2}+27 x +9\right )^{2}+2 \,\mathrm {log}\left (9 x^{2}+27 x +9\right ) x -10 \,\mathrm {log}\left (9 x^{2}+27 x +9\right )+x^{2}-10 x +25\right )}{e^{2 x}-2 e^{x} x +x^{2}} \] Input:

int(((-2*x^4-4*x^3+4*x^2+2*x)*exp(x)*log(9*x^2+27*x+9)^2+((2*x^4+2*x^3-10* 
x^2-4*x)*exp(x)^2+(-2*x^5+20*x^4+60*x^3-28*x^2-20*x)*exp(x)-2*x^5-10*x^4-8 
*x^3)*log(9*x^2+27*x+9)+(2*x^3+6*x^2+2*x)*exp(x)^3+(-16*x^4-32*x^3+38*x^2+ 
20*x)*exp(x)^2+(16*x^5-24*x^4-182*x^3+40*x^2+50*x)*exp(x)-2*x^6+42*x^4+40* 
x^3)/((x^2+3*x+1)*exp(x)^3+(-3*x^3-9*x^2-3*x)*exp(x)^2+(3*x^4+9*x^3+3*x^2) 
*exp(x)-x^5-3*x^4-x^3),x)
 

Output:

(x**2*(e**(2*x) - 2*e**x*log(9*x**2 + 27*x + 9) - 2*e**x*x + 10*e**x + log 
(9*x**2 + 27*x + 9)**2 + 2*log(9*x**2 + 27*x + 9)*x - 10*log(9*x**2 + 27*x 
 + 9) + x**2 - 10*x + 25))/(e**(2*x) - 2*e**x*x + x**2)