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

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 2.23 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.19, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.036, Rules used = {7292, 27, 7293, 2009}

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

\(\Big \downarrow \) 7292

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 7293

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 7292
Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =! 
= u]
 

rule 7293
Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v] 
]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(82\) vs. \(2(27)=54\).

Time = 0.54 (sec) , antiderivative size = 83, normalized size of antiderivative = 2.68

method result size
parallelrisch \(9+\frac {x \ln \left (x \right )}{4}+\ln \left (\left (\left (-4 x +8\right ) {\mathrm e}^{x}+4 x^{2}-4 x +8\right ) {\mathrm e}^{-x}\right ) x -3 \ln \left (-{\mathrm e}^{x} x +x^{2}+2 \,{\mathrm e}^{x}-x +2\right )+3 x +3 \ln \left (\left (\left (-4 x +8\right ) {\mathrm e}^{x}+4 x^{2}-4 x +8\right ) {\mathrm e}^{-x}\right )\) \(83\)
risch \(-\ln \left ({\mathrm e}^{x}\right ) x +x \ln \left (x^{2}+\left (-1-{\mathrm e}^{x}\right ) x +2 \,{\mathrm e}^{x}+2\right )+\frac {x \ln \left (x \right )}{4}-\frac {i \pi x \,\operatorname {csgn}\left (i \left (-x^{2}-\left (-1-{\mathrm e}^{x}\right ) x -2 \,{\mathrm e}^{x}-2\right )\right ) \operatorname {csgn}\left (i {\mathrm e}^{-x}\right ) \operatorname {csgn}\left (i {\mathrm e}^{-x} \left (-x^{2}-\left (-1-{\mathrm e}^{x}\right ) x -2 \,{\mathrm e}^{x}-2\right )\right )}{2}-\frac {i \pi x \,\operatorname {csgn}\left (i \left (-x^{2}-\left (-1-{\mathrm e}^{x}\right ) x -2 \,{\mathrm e}^{x}-2\right )\right ) \operatorname {csgn}\left (i {\mathrm e}^{-x} \left (-x^{2}-\left (-1-{\mathrm e}^{x}\right ) x -2 \,{\mathrm e}^{x}-2\right )\right )^{2}}{2}+\frac {i \pi x \,\operatorname {csgn}\left (i {\mathrm e}^{-x}\right ) \operatorname {csgn}\left (i {\mathrm e}^{-x} \left (-x^{2}-\left (-1-{\mathrm e}^{x}\right ) x -2 \,{\mathrm e}^{x}-2\right )\right )^{2}}{2}+\frac {i \pi x \operatorname {csgn}\left (i {\mathrm e}^{-x} \left (-x^{2}-\left (-1-{\mathrm e}^{x}\right ) x -2 \,{\mathrm e}^{x}-2\right )\right )^{3}}{2}+2 x \ln \left (2\right )\) \(240\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [A] (verification not implemented)

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

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

Output:

x*log(x)/4 + x*log((4*x**2 - 4*x + (8 - 4*x)*exp(x) + 8)*exp(-x))
 

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.14 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.26 \[ \int \frac {-2+13 x-13 x^2+4 x^3+e^x (-2+5 x)+\left (-2+e^x (-2+x)+x-x^2\right ) \log (x)+\left (-8+4 x-4 x^2+e^x (-8+4 x)\right ) \log \left (e^{-x} \left (8+e^x (8-4 x)-4 x+4 x^2\right )\right )}{-8+4 x-4 x^2+e^x (-8+4 x)} \, dx=-{\left (-i \, \pi - 2 \, \log \left (2\right )\right )} x - x^{2} + x \log \left (-x^{2} + {\left (x - 2\right )} e^{x} + x - 2\right ) + \frac {1}{4} \, x \log \left (x\right ) \] Input:

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

Output:

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

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 3.38 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.06 \[ \int \frac {-2+13 x-13 x^2+4 x^3+e^x (-2+5 x)+\left (-2+e^x (-2+x)+x-x^2\right ) \log (x)+\left (-8+4 x-4 x^2+e^x (-8+4 x)\right ) \log \left (e^{-x} \left (8+e^x (8-4 x)-4 x+4 x^2\right )\right )}{-8+4 x-4 x^2+e^x (-8+4 x)} \, dx=\frac {x\,\ln \left (x\right )}{4}+x\,\ln \left (-{\mathrm {e}}^{-x}\,\left (4\,x+{\mathrm {e}}^x\,\left (4\,x-8\right )-4\,x^2-8\right )\right ) \] Input:

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

Output:

(x*log(x))/4 + x*log(-exp(-x)*(4*x + exp(x)*(4*x - 8) - 4*x^2 - 8))
 

Reduce [F]

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

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

Output:

( - 2*int(e**x/(e**x*x - 2*e**x - x**2 + x - 2),x) + 4*int(x**3/(e**x*x - 
2*e**x - x**2 + x - 2),x) - 13*int(x**2/(e**x*x - 2*e**x - x**2 + x - 2),x 
) + 4*int(log(( - 4*e**x*x + 8*e**x + 4*x**2 - 4*x + 8)/e**x)/(e**x*x - 2* 
e**x - x**2 + x - 2),x) - 4*int(log(x)/(e**x*x**2 - 2*e**x*x - x**3 + x**2 
 - 2*x),x) + 4*int((e**x*log(( - 4*e**x*x + 8*e**x + 4*x**2 - 4*x + 8)/e** 
x)*x)/(e**x*x - 2*e**x - x**2 + x - 2),x) - 4*int((e**x*log(( - 4*e**x*x + 
 8*e**x + 4*x**2 - 4*x + 8)/e**x))/(e**x*x - 2*e**x - x**2 + x - 2),x) + i 
nt((e**x*log(x)*x)/(e**x*x - 2*e**x - x**2 + x - 2),x) - 4*int((e**x*log(x 
))/(e**x*x**2 - 2*e**x*x - x**3 + x**2 - 2*x),x) + 5*int((e**x*x)/(e**x*x 
- 2*e**x - x**2 + x - 2),x) - 8*int((log(( - 4*e**x*x + 8*e**x + 4*x**2 - 
4*x + 8)/e**x)*x)/(e**x*x - 2*e**x - x**2 + x - 2),x) - int((log(x)*x**2)/ 
(e**x*x - 2*e**x - x**2 + x - 2),x) - int((log(x)*x)/(e**x*x - 2*e**x - x* 
*2 + x - 2),x) + 13*int(x/(e**x*x - 2*e**x - x**2 + x - 2),x) - 2*int(1/(e 
**x*x - 2*e**x - x**2 + x - 2),x) - 2*log(( - 4*e**x*x + 8*e**x + 4*x**2 - 
 4*x + 8)/e**x)**2 - log(x)**2)/4