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

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

Optimal result

Integrand size = 166, antiderivative size = 35 \[ \int \frac {e^{-2 x} \left (e^{2 x} \left (-2 x+x^2\right ) \log ^2(2-x)+e^{\frac {9+3 x}{\log (2-x)}} \left (-18-6 x+(-12+6 x) \log (2-x)+(8-4 x) \log ^2(2-x)\right )+e^{\frac {9+3 x}{2 \log (2-x)}} \left (e^x \left (9 x+3 x^2\right )+e^x \left (6 x-3 x^2\right ) \log (2-x)+e^x \left (4-6 x+2 x^2\right ) \log ^2(2-x)\right )\right )}{(-4+2 x) \log ^2(2-x)} \, dx=\left (-e^{-x+\frac {9 \left (2+\frac {2 x}{3}\right )}{4 \log (2-x)}}+\frac {x}{2}\right )^2 \] Output:

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

Mathematica [A] (verified)

Time = 0.13 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.03 \[ \int \frac {e^{-2 x} \left (e^{2 x} \left (-2 x+x^2\right ) \log ^2(2-x)+e^{\frac {9+3 x}{\log (2-x)}} \left (-18-6 x+(-12+6 x) \log (2-x)+(8-4 x) \log ^2(2-x)\right )+e^{\frac {9+3 x}{2 \log (2-x)}} \left (e^x \left (9 x+3 x^2\right )+e^x \left (6 x-3 x^2\right ) \log (2-x)+e^x \left (4-6 x+2 x^2\right ) \log ^2(2-x)\right )\right )}{(-4+2 x) \log ^2(2-x)} \, dx=\frac {1}{4} e^{-2 x} \left (-2 e^{\frac {3 (3+x)}{2 \log (2-x)}}+e^x x\right )^2 \] Input:

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

Output:

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

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^{-2 x} \left (e^{2 x} \left (x^2-2 x\right ) \log ^2(2-x)+e^{\frac {3 x+9}{2 \log (2-x)}} \left (e^x \left (3 x^2+9 x\right )+e^x \left (2 x^2-6 x+4\right ) \log ^2(2-x)+e^x \left (6 x-3 x^2\right ) \log (2-x)\right )+e^{\frac {3 x+9}{\log (2-x)}} \left (-6 x+(8-4 x) \log ^2(2-x)+(6 x-12) \log (2-x)-18\right )\right )}{(2 x-4) \log ^2(2-x)} \, dx\)

\(\Big \downarrow \) 7293

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

\(\Big \downarrow \) 2009

\(\displaystyle -3 \int \frac {e^{\frac {3 (x+3)}{\log (2-x)}-2 x}}{\log ^2(2-x)}dx+\frac {21}{2} \int \frac {e^{\frac {-2 \log (2-x) x+3 x+9}{2 \log (2-x)}}}{\log ^2(2-x)}dx-\frac {3}{2} \int \frac {e^{\frac {-2 \log (2-x) x+3 x+9}{2 \log (2-x)}} (2-x)}{\log ^2(2-x)}dx-15 \int \frac {e^{\frac {3 (x+3)}{\log (2-x)}-2 x}}{(x-2) \log ^2(2-x)}dx+15 \int \frac {e^{\frac {-2 \log (2-x) x+3 x+9}{2 \log (2-x)}}}{(x-2) \log ^2(2-x)}dx-2 \int e^{\frac {3 (x+3)}{\log (2-x)}-2 x}dx-\int e^{\frac {-2 \log (2-x) x+3 x+9}{2 \log (2-x)}}dx+\int e^{\frac {-2 \log (2-x) x+3 x+9}{2 \log (2-x)}} xdx+3 \int \frac {e^{\frac {3 (x+3)}{\log (2-x)}-2 x}}{\log (2-x)}dx-3 \int \frac {e^{\frac {-2 \log (2-x) x+3 x+9}{2 \log (2-x)}}}{\log (2-x)}dx+\frac {3}{2} \int \frac {e^{\frac {-2 \log (2-x) x+3 x+9}{2 \log (2-x)}} (2-x)}{\log (2-x)}dx+\frac {x^2}{4}\)

Input:

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

Output:

$Aborted
 
Maple [A] (verified)

Time = 1.46 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.54

method result size
parallelrisch \(\frac {\left (2 \,{\mathrm e}^{2 x} x^{2}-8 \,{\mathrm e}^{\frac {\frac {3 x}{2}+\frac {9}{2}}{\ln \left (2-x \right )}} {\mathrm e}^{x} x +8 \,{\mathrm e}^{\frac {3 x +9}{\ln \left (2-x \right )}}\right ) {\mathrm e}^{-2 x}}{8}\) \(54\)
risch \(\frac {x^{2}}{4}+{\mathrm e}^{-\frac {2 \ln \left (2-x \right ) x -3 x -9}{\ln \left (2-x \right )}}-x \,{\mathrm e}^{-\frac {2 \ln \left (2-x \right ) x -3 x -9}{2 \ln \left (2-x \right )}}\) \(60\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F(-1)]

Timed out. \[ \int \frac {e^{-2 x} \left (e^{2 x} \left (-2 x+x^2\right ) \log ^2(2-x)+e^{\frac {9+3 x}{\log (2-x)}} \left (-18-6 x+(-12+6 x) \log (2-x)+(8-4 x) \log ^2(2-x)\right )+e^{\frac {9+3 x}{2 \log (2-x)}} \left (e^x \left (9 x+3 x^2\right )+e^x \left (6 x-3 x^2\right ) \log (2-x)+e^x \left (4-6 x+2 x^2\right ) \log ^2(2-x)\right )\right )}{(-4+2 x) \log ^2(2-x)} \, dx=\text {Timed out} \] Input:

integrate((((-4*x+8)*ln(2-x)**2+(6*x-12)*ln(2-x)-6*x-18)*exp(1/2*(3*x+9)/l 
n(2-x))**2+((2*x**2-6*x+4)*exp(x)*ln(2-x)**2+(-3*x**2+6*x)*exp(x)*ln(2-x)+ 
(3*x**2+9*x)*exp(x))*exp(1/2*(3*x+9)/ln(2-x))+(x**2-2*x)*exp(x)**2*ln(2-x) 
**2)/(2*x-4)/exp(x)**2/ln(2-x)**2,x)
 

Output:

Timed out
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {e^{-2 x} \left (e^{2 x} \left (-2 x+x^2\right ) \log ^2(2-x)+e^{\frac {9+3 x}{\log (2-x)}} \left (-18-6 x+(-12+6 x) \log (2-x)+(8-4 x) \log ^2(2-x)\right )+e^{\frac {9+3 x}{2 \log (2-x)}} \left (e^x \left (9 x+3 x^2\right )+e^x \left (6 x-3 x^2\right ) \log (2-x)+e^x \left (4-6 x+2 x^2\right ) \log ^2(2-x)\right )\right )}{(-4+2 x) \log ^2(2-x)} \, dx=\text {Exception raised: RuntimeError} \] Input:

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

Output:

Exception raised: RuntimeError >> ECL says: In function CAR, the value of 
the first argument is  0which is not of the expected type LIST
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 122 vs. \(2 (26) = 52\).

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

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

Output:

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

Mupad [F(-1)]

Timed out. \[ \int \frac {e^{-2 x} \left (e^{2 x} \left (-2 x+x^2\right ) \log ^2(2-x)+e^{\frac {9+3 x}{\log (2-x)}} \left (-18-6 x+(-12+6 x) \log (2-x)+(8-4 x) \log ^2(2-x)\right )+e^{\frac {9+3 x}{2 \log (2-x)}} \left (e^x \left (9 x+3 x^2\right )+e^x \left (6 x-3 x^2\right ) \log (2-x)+e^x \left (4-6 x+2 x^2\right ) \log ^2(2-x)\right )\right )}{(-4+2 x) \log ^2(2-x)} \, dx=-\int \frac {{\mathrm {e}}^{-2\,x}\,\left ({\mathrm {e}}^{\frac {2\,\left (\frac {3\,x}{2}+\frac {9}{2}\right )}{\ln \left (2-x\right )}}\,\left (\left (4\,x-8\right )\,{\ln \left (2-x\right )}^2+\left (12-6\,x\right )\,\ln \left (2-x\right )+6\,x+18\right )-{\mathrm {e}}^{\frac {\frac {3\,x}{2}+\frac {9}{2}}{\ln \left (2-x\right )}}\,\left ({\mathrm {e}}^x\,\left (2\,x^2-6\,x+4\right )\,{\ln \left (2-x\right )}^2+{\mathrm {e}}^x\,\left (6\,x-3\,x^2\right )\,\ln \left (2-x\right )+{\mathrm {e}}^x\,\left (3\,x^2+9\,x\right )\right )+{\mathrm {e}}^{2\,x}\,{\ln \left (2-x\right )}^2\,\left (2\,x-x^2\right )\right )}{{\ln \left (2-x\right )}^2\,\left (2\,x-4\right )} \,d x \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.89 \[ \int \frac {e^{-2 x} \left (e^{2 x} \left (-2 x+x^2\right ) \log ^2(2-x)+e^{\frac {9+3 x}{\log (2-x)}} \left (-18-6 x+(-12+6 x) \log (2-x)+(8-4 x) \log ^2(2-x)\right )+e^{\frac {9+3 x}{2 \log (2-x)}} \left (e^x \left (9 x+3 x^2\right )+e^x \left (6 x-3 x^2\right ) \log (2-x)+e^x \left (4-6 x+2 x^2\right ) \log ^2(2-x)\right )\right )}{(-4+2 x) \log ^2(2-x)} \, dx=\frac {4 e^{\frac {3 x +9}{\mathrm {log}\left (-x +2\right )}}-4 e^{\frac {2 \,\mathrm {log}\left (-x +2\right ) x +3 x +9}{2 \,\mathrm {log}\left (-x +2\right )}} x +e^{2 x} x^{2}}{4 e^{2 x}} \] Input:

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

Output:

(4*e**((3*x + 9)/log( - x + 2)) - 4*e**((2*log( - x + 2)*x + 3*x + 9)/(2*l 
og( - x + 2)))*x + e**(2*x)*x**2)/(4*e**(2*x))