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

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.21 \[ \int \frac {-4+e^{e^x-x+x^2} \left (2-e^{2+2 x}+e^x \left (e^2 (2-2 x)-2 x\right )+2 x-4 x^2\right )+2 \log (5)+e^x \left (e^2 (-3+x)+e^2 \log (5)\right )}{4+e^{2 e^x-2 x+2 x^2}-4 x+x^2+(-4+2 x) \log (5)+\log ^2(5)+e^{e^x-x+x^2} (-4+2 x+2 \log (5))} \, dx=\frac {e^x \left (e^{2+x}+2 x\right )}{e^{e^x+x^2}+e^x (-2+x+\log (5))} \] Input:

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

Output:

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

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^2-x+e^x} \left (-4 x^2+2 x-e^{2 x+2}+e^x \left (e^2 (2-2 x)-2 x\right )+2\right )+e^x \left (e^2 (x-3)+e^2 \log (5)\right )-4+2 \log (5)}{x^2+e^{2 x^2-2 x+2 e^x}+e^{x^2-x+e^x} (2 x-4+2 \log (5))-4 x+(2 x-4) \log (5)+4+\log ^2(5)} \, dx\)

\(\Big \downarrow \) 7292

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

\(\Big \downarrow \) 7293

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

\(\Big \downarrow \) 7299

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

Input:

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

Output:

$Aborted
 
Maple [A] (verified)

Time = 0.70 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.96

method result size
risch \(\frac {{\mathrm e}^{2+x}+2 x}{x -2+{\mathrm e}^{x^{2}+{\mathrm e}^{x}-x}+\ln \left (5\right )}\) \(27\)
parallelrisch \(\frac {{\mathrm e}^{2} {\mathrm e}^{x}+2 x}{x -2+{\mathrm e}^{x^{2}+{\mathrm e}^{x}-x}+\ln \left (5\right )}\) \(28\)
norman \(\frac {-2 \,{\mathrm e}^{x^{2}+{\mathrm e}^{x}-x}+{\mathrm e}^{2} {\mathrm e}^{x}-2 \ln \left (5\right )+4}{x -2+{\mathrm e}^{x^{2}+{\mathrm e}^{x}-x}+\ln \left (5\right )}\) \(42\)

Input:

int(((-exp(2)*exp(x)^2+((2-2*x)*exp(2)-2*x)*exp(x)-4*x^2+2*x+2)*exp(x^2+ex 
p(x)-x)+(exp(2)*ln(5)+(-3+x)*exp(2))*exp(x)+2*ln(5)-4)/(exp(x^2+exp(x)-x)^ 
2+(2*ln(5)+2*x-4)*exp(x^2+exp(x)-x)+ln(5)^2+(2*x-4)*ln(5)+x^2-4*x+4),x,met 
hod=_RETURNVERBOSE)
 

Output:

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

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.93 \[ \int \frac {-4+e^{e^x-x+x^2} \left (2-e^{2+2 x}+e^x \left (e^2 (2-2 x)-2 x\right )+2 x-4 x^2\right )+2 \log (5)+e^x \left (e^2 (-3+x)+e^2 \log (5)\right )}{4+e^{2 e^x-2 x+2 x^2}-4 x+x^2+(-4+2 x) \log (5)+\log ^2(5)+e^{e^x-x+x^2} (-4+2 x+2 \log (5))} \, dx=\frac {2 \, x + e^{\left (x + 2\right )}}{x + e^{\left (x^{2} - x + e^{x}\right )} + \log \left (5\right ) - 2} \] Input:

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

Output:

(2*x + e^(x + 2))/(x + e^(x^2 - x + e^x) + log(5) - 2)
 

Sympy [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.93 \[ \int \frac {-4+e^{e^x-x+x^2} \left (2-e^{2+2 x}+e^x \left (e^2 (2-2 x)-2 x\right )+2 x-4 x^2\right )+2 \log (5)+e^x \left (e^2 (-3+x)+e^2 \log (5)\right )}{4+e^{2 e^x-2 x+2 x^2}-4 x+x^2+(-4+2 x) \log (5)+\log ^2(5)+e^{e^x-x+x^2} (-4+2 x+2 \log (5))} \, dx=\frac {2 x + e^{2} e^{x}}{x + e^{x^{2} - x + e^{x}} - 2 + \log {\left (5 \right )}} \] Input:

integrate(((-exp(2)*exp(x)**2+((2-2*x)*exp(2)-2*x)*exp(x)-4*x**2+2*x+2)*ex 
p(x**2+exp(x)-x)+(exp(2)*ln(5)+(-3+x)*exp(2))*exp(x)+2*ln(5)-4)/(exp(x**2+ 
exp(x)-x)**2+(2*ln(5)+2*x-4)*exp(x**2+exp(x)-x)+ln(5)**2+(2*x-4)*ln(5)+x** 
2-4*x+4),x)
 

Output:

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

Maxima [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.11 \[ \int \frac {-4+e^{e^x-x+x^2} \left (2-e^{2+2 x}+e^x \left (e^2 (2-2 x)-2 x\right )+2 x-4 x^2\right )+2 \log (5)+e^x \left (e^2 (-3+x)+e^2 \log (5)\right )}{4+e^{2 e^x-2 x+2 x^2}-4 x+x^2+(-4+2 x) \log (5)+\log ^2(5)+e^{e^x-x+x^2} (-4+2 x+2 \log (5))} \, dx=\frac {2 \, x e^{x} + e^{\left (2 \, x + 2\right )}}{{\left (x + \log \left (5\right ) - 2\right )} e^{x} + e^{\left (x^{2} + e^{x}\right )}} \] Input:

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

Output:

(2*x*e^x + e^(2*x + 2))/((x + log(5) - 2)*e^x + e^(x^2 + e^x))
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 989 vs. \(2 (25) = 50\).

Time = 0.21 (sec) , antiderivative size = 989, normalized size of antiderivative = 35.32 \[ \int \frac {-4+e^{e^x-x+x^2} \left (2-e^{2+2 x}+e^x \left (e^2 (2-2 x)-2 x\right )+2 x-4 x^2\right )+2 \log (5)+e^x \left (e^2 (-3+x)+e^2 \log (5)\right )}{4+e^{2 e^x-2 x+2 x^2}-4 x+x^2+(-4+2 x) \log (5)+\log ^2(5)+e^{e^x-x+x^2} (-4+2 x+2 \log (5))} \, dx=\text {Too large to display} \] Input:

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

Output:

(4*x^4*e^x + 8*x^3*e^x*log(5) + 4*x^2*e^x*log(5)^2 + 4*x^3*e^(x^2 + e^x) + 
 2*x^3*e^(2*x) + 2*x^3*e^(2*x + 2) - 18*x^3*e^x + 4*x^2*e^(x^2 + e^x)*log( 
5) + 4*x^2*e^(2*x)*log(5) + 4*x^2*e^(2*x + 2)*log(5) - 20*x^2*e^x*log(5) + 
 2*x*e^(2*x)*log(5)^2 + 2*x*e^(2*x + 2)*log(5)^2 - 2*x*e^x*log(5)^2 + 2*x^ 
2*e^(x^2 + x + e^x + 2) + 2*x^2*e^(x^2 + x + e^x) - 10*x^2*e^(x^2 + e^x) - 
 8*x^2*e^(2*x) + x^2*e^(3*x + 2) - 9*x^2*e^(2*x + 2) + 22*x^2*e^x + 2*x*e^ 
(x^2 + x + e^x + 2)*log(5) + 2*x*e^(x^2 + x + e^x)*log(5) - 2*x*e^(x^2 + e 
^x)*log(5) - 8*x*e^(2*x)*log(5) + 2*x*e^(3*x + 2)*log(5) - 10*x*e^(2*x + 2 
)*log(5) + 6*x*e^x*log(5) + e^(3*x + 2)*log(5)^2 - e^(2*x + 2)*log(5)^2 + 
x*e^(x^2 + 2*x + e^x + 2) - 5*x*e^(x^2 + x + e^x + 2) - 4*x*e^(x^2 + x + e 
^x) + 2*x*e^(x^2 + e^x) + 8*x*e^(2*x) - 4*x*e^(3*x + 2) + 11*x*e^(2*x + 2) 
 - 4*x*e^x + e^(x^2 + 2*x + e^x + 2)*log(5) - e^(x^2 + x + e^x + 2)*log(5) 
 - 4*e^(3*x + 2)*log(5) + 3*e^(2*x + 2)*log(5) - 2*e^(x^2 + 2*x + e^x + 2) 
 + e^(x^2 + x + e^x + 2) + 4*e^(3*x + 2) - 2*e^(2*x + 2))/(2*x^4*e^x + 6*x 
^3*e^x*log(5) + 6*x^2*e^x*log(5)^2 + 2*x*e^x*log(5)^3 + 4*x^3*e^(x^2 + e^x 
) + x^3*e^(2*x) - 13*x^3*e^x + 8*x^2*e^(x^2 + e^x)*log(5) + 3*x^2*e^(2*x)* 
log(5) - 27*x^2*e^x*log(5) + 4*x*e^(x^2 + e^x)*log(5)^2 + 3*x*e^(2*x)*log( 
5)^2 - 15*x*e^x*log(5)^2 + e^(2*x)*log(5)^3 - e^x*log(5)^3 + 2*x^2*e^(2*x^ 
2 - x + 2*e^x) + 2*x^2*e^(x^2 + x + e^x) - 18*x^2*e^(x^2 + e^x) - 6*x^2*e^ 
(2*x) + 29*x^2*e^x + 2*x*e^(2*x^2 - x + 2*e^x)*log(5) + 4*x*e^(x^2 + x ...
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \frac {-4+e^{e^x-x+x^2} \left (2-e^{2+2 x}+e^x \left (e^2 (2-2 x)-2 x\right )+2 x-4 x^2\right )+2 \log (5)+e^x \left (e^2 (-3+x)+e^2 \log (5)\right )}{4+e^{2 e^x-2 x+2 x^2}-4 x+x^2+(-4+2 x) \log (5)+\log ^2(5)+e^{e^x-x+x^2} (-4+2 x+2 \log (5))} \, dx=\int \frac {\left (-{\mathrm e}^{2} \left ({\mathrm e}^{x}\right )^{2}+\left (\left (2-2 x \right ) {\mathrm e}^{2}-2 x \right ) {\mathrm e}^{x}-4 x^{2}+2 x +2\right ) {\mathrm e}^{x^{2}+{\mathrm e}^{x}-x}+\left ({\mathrm e}^{2} \mathrm {log}\left (5\right )+\left (x -3\right ) {\mathrm e}^{2}\right ) {\mathrm e}^{x}+2 \,\mathrm {log}\left (5\right )-4}{\left ({\mathrm e}^{x^{2}+{\mathrm e}^{x}-x}\right )^{2}+\left (2 \,\mathrm {log}\left (5\right )+2 x -4\right ) {\mathrm e}^{x^{2}+{\mathrm e}^{x}-x}+\mathrm {log}\left (5\right )^{2}+\left (2 x -4\right ) \mathrm {log}\left (5\right )+x^{2}-4 x +4}d x \] Input:

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

Output:

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