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

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

Optimal result

Integrand size = 200, antiderivative size = 33 \[ \int \frac {e^{-x} \left (e^x \left (2 x^2-8 x^3+4 x^4+8 x^5+2 x^6+e^6 \left (2-4 x^2+2 x^4\right )+e^3 \left (-4 x+8 x^2+8 x^3-8 x^4-4 x^5\right )\right )+\left (x^2-x^3+3 x^4+x^5+e^6 \left (1-x+x^2+x^3\right )+e^3 \left (-2 x-4 x^3-2 x^4\right )\right ) \log (4)\right )}{x^2-4 x^3+2 x^4+4 x^5+x^6+e^6 \left (1-2 x^2+x^4\right )+e^3 \left (-2 x+4 x^2+4 x^3-4 x^4-2 x^5\right )} \, dx=2 x+\frac {e^{-x} \log (4)}{\frac {1}{x}-x+\frac {2 x}{e^3-x}} \] Output:

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

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.30 \[ \int \frac {e^{-x} \left (e^x \left (2 x^2-8 x^3+4 x^4+8 x^5+2 x^6+e^6 \left (2-4 x^2+2 x^4\right )+e^3 \left (-4 x+8 x^2+8 x^3-8 x^4-4 x^5\right )\right )+\left (x^2-x^3+3 x^4+x^5+e^6 \left (1-x+x^2+x^3\right )+e^3 \left (-2 x-4 x^3-2 x^4\right )\right ) \log (4)\right )}{x^2-4 x^3+2 x^4+4 x^5+x^6+e^6 \left (1-2 x^2+x^4\right )+e^3 \left (-2 x+4 x^2+4 x^3-4 x^4-2 x^5\right )} \, dx=x \left (2-\frac {e^{-x} \left (e^3-x\right ) \log (4)}{e^3 \left (-1+x^2\right )-x \left (-1+2 x+x^2\right )}\right ) \] Input:

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

Output:

x*(2 - ((E^3 - x)*Log[4])/(E^x*(E^3*(-1 + x^2) - x*(-1 + 2*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 {e^{-x} \left (\left (x^5+3 x^4-x^3+x^2+e^3 \left (-2 x^4-4 x^3-2 x\right )+e^6 \left (x^3+x^2-x+1\right )\right ) \log (4)+e^x \left (2 x^6+8 x^5+4 x^4-8 x^3+2 x^2+e^6 \left (2 x^4-4 x^2+2\right )+e^3 \left (-4 x^5-8 x^4+8 x^3+8 x^2-4 x\right )\right )\right )}{x^6+4 x^5+2 x^4-4 x^3+x^2+e^6 \left (x^4-2 x^2+1\right )+e^3 \left (-2 x^5-4 x^4+4 x^3+4 x^2-2 x\right )} \, dx\)

\(\Big \downarrow \) 2463

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

\(\Big \downarrow \) 6

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

\(\Big \downarrow \) 7293

\(\displaystyle \int \left (\frac {e^{-x} \left (x^5+3 \left (1-\frac {2 e^3}{3}\right ) x^4-\left (1-e^3 \left (e^3-4\right )\right ) x^3+\left (1+e^6\right ) x^2-2 e^3 \left (1+\frac {e^3}{2}\right ) x+e^6\right ) \log (4)}{\left (x^3+\left (2-e^3\right ) x^2-x+e^3\right )^2}+2\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \left (2+e^3\right ) \log (4) \int \frac {e^{-x}}{-x^3-\left (2-e^3\right ) x^2+x-e^3}dx+2 \left (1+e^3\right ) \log (4) \int \frac {e^{3-x}}{\left (x^3+\left (2-e^3\right ) x^2-x+e^3\right )^2}dx-2 \left (1+2 e^3\right ) \log (4) \int \frac {e^{-x} x}{\left (x^3+\left (2-e^3\right ) x^2-x+e^3\right )^2}dx+2 \left (3-e^3\right ) \log (4) \int \frac {e^{-x} x^2}{\left (x^3+\left (2-e^3\right ) x^2-x+e^3\right )^2}dx+\left (1-e^3\right ) \log (4) \int \frac {e^{-x} x}{x^3+\left (2-e^3\right ) x^2-x+e^3}dx+\log (4) \int \frac {e^{-x} x^2}{x^3+\left (2-e^3\right ) x^2-x+e^3}dx+2 x\)

Input:

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

Output:

$Aborted
 
Maple [B] (verified)

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

Time = 1.02 (sec) , antiderivative size = 89, normalized size of antiderivative = 2.70

method result size
norman \(\frac {\left (\left (-2 \,{\mathrm e}^{6}+4 \,{\mathrm e}^{3}\right ) {\mathrm e}^{x}-4 \,{\mathrm e}^{x} x +\left (2 \,{\mathrm e}^{6}-8 \,{\mathrm e}^{3}+10\right ) x^{2} {\mathrm e}^{x}+2 x^{2} \ln \left (2\right )-2 \,{\mathrm e}^{x} x^{4}-2 \ln \left (2\right ) {\mathrm e}^{3} x \right ) {\mathrm e}^{-x}}{x^{2} {\mathrm e}^{3}-x^{3}-2 x^{2}-{\mathrm e}^{3}+x}\) \(89\)
parallelrisch \(-\frac {\left (-2 x^{2} \ln \left (2\right )+2 \,{\mathrm e}^{x} x^{4}-10 \,{\mathrm e}^{x} x^{2}+4 \,{\mathrm e}^{x} x -4 \,{\mathrm e}^{x} {\mathrm e}^{3}+2 \,{\mathrm e}^{6} {\mathrm e}^{x}-2 x^{2} {\mathrm e}^{6} {\mathrm e}^{x}+8 \,{\mathrm e}^{x} {\mathrm e}^{3} x^{2}+2 \ln \left (2\right ) {\mathrm e}^{3} x \right ) {\mathrm e}^{-x}}{x^{2} {\mathrm e}^{3}-x^{3}-2 x^{2}-{\mathrm e}^{3}+x}\) \(99\)
parts \(\text {Expression too large to display}\) \(2074\)
default \(\text {Expression too large to display}\) \(4644\)

Input:

int((((2*x^4-4*x^2+2)*exp(3)^2+(-4*x^5-8*x^4+8*x^3+8*x^2-4*x)*exp(3)+2*x^6 
+8*x^5+4*x^4-8*x^3+2*x^2)*exp(x)+2*((x^3+x^2-x+1)*exp(3)^2+(-2*x^4-4*x^3-2 
*x)*exp(3)+x^5+3*x^4-x^3+x^2)*ln(2))/((x^4-2*x^2+1)*exp(3)^2+(-2*x^5-4*x^4 
+4*x^3+4*x^2-2*x)*exp(3)+x^6+4*x^5+2*x^4-4*x^3+x^2)/exp(x),x,method=_RETUR 
NVERBOSE)
 

Output:

((-2*exp(3)^2+4*exp(3))*exp(x)-4*exp(x)*x+(2*exp(3)^2-8*exp(3)+10)*x^2*exp 
(x)+2*x^2*ln(2)-2*exp(x)*x^4-2*ln(2)*exp(3)*x)/(x^2*exp(3)-x^3-2*x^2-exp(3 
)+x)/exp(x)
                                                                                    
                                                                                    
 

Fricas [B] (verification not implemented)

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

Time = 0.10 (sec) , antiderivative size = 71, normalized size of antiderivative = 2.15 \[ \int \frac {e^{-x} \left (e^x \left (2 x^2-8 x^3+4 x^4+8 x^5+2 x^6+e^6 \left (2-4 x^2+2 x^4\right )+e^3 \left (-4 x+8 x^2+8 x^3-8 x^4-4 x^5\right )\right )+\left (x^2-x^3+3 x^4+x^5+e^6 \left (1-x+x^2+x^3\right )+e^3 \left (-2 x-4 x^3-2 x^4\right )\right ) \log (4)\right )}{x^2-4 x^3+2 x^4+4 x^5+x^6+e^6 \left (1-2 x^2+x^4\right )+e^3 \left (-2 x+4 x^2+4 x^3-4 x^4-2 x^5\right )} \, dx=\frac {2 \, {\left ({\left (x^{4} + 2 \, x^{3} - x^{2} - {\left (x^{3} - x\right )} e^{3}\right )} e^{x} - {\left (x^{2} - x e^{3}\right )} \log \left (2\right )\right )} e^{\left (-x\right )}}{x^{3} + 2 \, x^{2} - {\left (x^{2} - 1\right )} e^{3} - x} \] Input:

integrate((((2*x^4-4*x^2+2)*exp(3)^2+(-4*x^5-8*x^4+8*x^3+8*x^2-4*x)*exp(3) 
+2*x^6+8*x^5+4*x^4-8*x^3+2*x^2)*exp(x)+2*((x^3+x^2-x+1)*exp(3)^2+(-2*x^4-4 
*x^3-2*x)*exp(3)+x^5+3*x^4-x^3+x^2)*log(2))/((x^4-2*x^2+1)*exp(3)^2+(-2*x^ 
5-4*x^4+4*x^3+4*x^2-2*x)*exp(3)+x^6+4*x^5+2*x^4-4*x^3+x^2)/exp(x),x, algor 
ithm="fricas")
 

Output:

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

Sympy [A] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.33 \[ \int \frac {e^{-x} \left (e^x \left (2 x^2-8 x^3+4 x^4+8 x^5+2 x^6+e^6 \left (2-4 x^2+2 x^4\right )+e^3 \left (-4 x+8 x^2+8 x^3-8 x^4-4 x^5\right )\right )+\left (x^2-x^3+3 x^4+x^5+e^6 \left (1-x+x^2+x^3\right )+e^3 \left (-2 x-4 x^3-2 x^4\right )\right ) \log (4)\right )}{x^2-4 x^3+2 x^4+4 x^5+x^6+e^6 \left (1-2 x^2+x^4\right )+e^3 \left (-2 x+4 x^2+4 x^3-4 x^4-2 x^5\right )} \, dx=2 x + \frac {\left (- 2 x^{2} \log {\left (2 \right )} + 2 x e^{3} \log {\left (2 \right )}\right ) e^{- x}}{x^{3} - x^{2} e^{3} + 2 x^{2} - x + e^{3}} \] Input:

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.94 \[ \int \frac {e^{-x} \left (e^x \left (2 x^2-8 x^3+4 x^4+8 x^5+2 x^6+e^6 \left (2-4 x^2+2 x^4\right )+e^3 \left (-4 x+8 x^2+8 x^3-8 x^4-4 x^5\right )\right )+\left (x^2-x^3+3 x^4+x^5+e^6 \left (1-x+x^2+x^3\right )+e^3 \left (-2 x-4 x^3-2 x^4\right )\right ) \log (4)\right )}{x^2-4 x^3+2 x^4+4 x^5+x^6+e^6 \left (1-2 x^2+x^4\right )+e^3 \left (-2 x+4 x^2+4 x^3-4 x^4-2 x^5\right )} \, dx=\frac {2 \, {\left (x^{4} - x^{3} {\left (e^{3} - 2\right )} - x^{2} + x e^{3} - {\left (x^{2} \log \left (2\right ) - x e^{3} \log \left (2\right )\right )} e^{\left (-x\right )}\right )}}{x^{3} - x^{2} {\left (e^{3} - 2\right )} - x + e^{3}} \] Input:

integrate((((2*x^4-4*x^2+2)*exp(3)^2+(-4*x^5-8*x^4+8*x^3+8*x^2-4*x)*exp(3) 
+2*x^6+8*x^5+4*x^4-8*x^3+2*x^2)*exp(x)+2*((x^3+x^2-x+1)*exp(3)^2+(-2*x^4-4 
*x^3-2*x)*exp(3)+x^5+3*x^4-x^3+x^2)*log(2))/((x^4-2*x^2+1)*exp(3)^2+(-2*x^ 
5-4*x^4+4*x^3+4*x^2-2*x)*exp(3)+x^6+4*x^5+2*x^4-4*x^3+x^2)/exp(x),x, algor 
ithm="maxima")
 

Output:

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

Giac [B] (verification not implemented)

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

Time = 0.24 (sec) , antiderivative size = 72, normalized size of antiderivative = 2.18 \[ \int \frac {e^{-x} \left (e^x \left (2 x^2-8 x^3+4 x^4+8 x^5+2 x^6+e^6 \left (2-4 x^2+2 x^4\right )+e^3 \left (-4 x+8 x^2+8 x^3-8 x^4-4 x^5\right )\right )+\left (x^2-x^3+3 x^4+x^5+e^6 \left (1-x+x^2+x^3\right )+e^3 \left (-2 x-4 x^3-2 x^4\right )\right ) \log (4)\right )}{x^2-4 x^3+2 x^4+4 x^5+x^6+e^6 \left (1-2 x^2+x^4\right )+e^3 \left (-2 x+4 x^2+4 x^3-4 x^4-2 x^5\right )} \, dx=\frac {2 \, {\left (x^{4} - x^{3} e^{3} - 2 \, x^{2} e^{\left (-x\right )} \log \left (2\right ) + 2 \, x^{3} + 2 \, x e^{\left (-x + 3\right )} \log \left (2\right ) - x^{2} + x e^{3}\right )}}{x^{3} - x^{2} e^{3} + 2 \, x^{2} - x + e^{3}} \] Input:

integrate((((2*x^4-4*x^2+2)*exp(3)^2+(-4*x^5-8*x^4+8*x^3+8*x^2-4*x)*exp(3) 
+2*x^6+8*x^5+4*x^4-8*x^3+2*x^2)*exp(x)+2*((x^3+x^2-x+1)*exp(3)^2+(-2*x^4-4 
*x^3-2*x)*exp(3)+x^5+3*x^4-x^3+x^2)*log(2))/((x^4-2*x^2+1)*exp(3)^2+(-2*x^ 
5-4*x^4+4*x^3+4*x^2-2*x)*exp(3)+x^6+4*x^5+2*x^4-4*x^3+x^2)/exp(x),x, algor 
ithm="giac")
 

Output:

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

Mupad [B] (verification not implemented)

Time = 3.55 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.36 \[ \int \frac {e^{-x} \left (e^x \left (2 x^2-8 x^3+4 x^4+8 x^5+2 x^6+e^6 \left (2-4 x^2+2 x^4\right )+e^3 \left (-4 x+8 x^2+8 x^3-8 x^4-4 x^5\right )\right )+\left (x^2-x^3+3 x^4+x^5+e^6 \left (1-x+x^2+x^3\right )+e^3 \left (-2 x-4 x^3-2 x^4\right )\right ) \log (4)\right )}{x^2-4 x^3+2 x^4+4 x^5+x^6+e^6 \left (1-2 x^2+x^4\right )+e^3 \left (-2 x+4 x^2+4 x^3-4 x^4-2 x^5\right )} \, dx=2\,x+\frac {{\mathrm {e}}^{-x}\,\left (2\,x^2\,\ln \left (2\right )-2\,x\,{\mathrm {e}}^3\,\ln \left (2\right )\right )}{-x^3+\left ({\mathrm {e}}^3-2\right )\,x^2+x-{\mathrm {e}}^3} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 85, normalized size of antiderivative = 2.58 \[ \int \frac {e^{-x} \left (e^x \left (2 x^2-8 x^3+4 x^4+8 x^5+2 x^6+e^6 \left (2-4 x^2+2 x^4\right )+e^3 \left (-4 x+8 x^2+8 x^3-8 x^4-4 x^5\right )\right )+\left (x^2-x^3+3 x^4+x^5+e^6 \left (1-x+x^2+x^3\right )+e^3 \left (-2 x-4 x^3-2 x^4\right )\right ) \log (4)\right )}{x^2-4 x^3+2 x^4+4 x^5+x^6+e^6 \left (1-2 x^2+x^4\right )+e^3 \left (-2 x+4 x^2+4 x^3-4 x^4-2 x^5\right )} \, dx=\frac {2 x \left (e^{x} e^{3} x^{2}-e^{x} e^{3}-e^{x} x^{3}-2 e^{x} x^{2}+e^{x} x -\mathrm {log}\left (2\right ) e^{3}+\mathrm {log}\left (2\right ) x \right )}{e^{x} \left (e^{3} x^{2}-e^{3}-x^{3}-2 x^{2}+x \right )} \] Input:

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

Output:

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