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

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

Optimal result

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

[Out]

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

Rubi [F]

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

[In]

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

[Out]

2*x + x*Log[-1 - E^4 + E^x + 2/(5*x) + x] + 4*Defer[Int][(-2 - 5*E^x*x + 5*(1 + E^4)*x - 5*x^2)^(-1), x] + 4*D
efer[Int][1/(x*(-2 - 5*E^x*x + 5*(1 + E^4)*x - 5*x^2)), x] - 2*Defer[Int][x/(-2 - 5*E^x*x + 5*(1 + E^4)*x - 5*
x^2), x] + 2*(9 + 5*E^4)*Defer[Int][x/(2 + 5*E^x*x - 5*(1 + E^4)*x + 5*x^2), x] + 5*E^4*Defer[Int][x^2/(2 + 5*
E^x*x - 5*(1 + E^4)*x + 5*x^2), x] - 5*(2 + E^4)*Defer[Int][x^2/(2 + 5*E^x*x - 5*(1 + E^4)*x + 5*x^2), x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {-4-2 x+10 x^2+5 x^3+e^x \left (10 x^2+5 x^3\right )+\left (2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3\right ) \log \left (\frac {2-5 x-5 e^4 x+5 e^x x+5 x^2}{5 x}\right )}{2 x+5 e^x x^2+\left (-5-5 e^4\right ) x^2+5 x^3} \, dx \\ & = \int \left (\frac {(2+x) \left (-2+5 \left (1+e^x\right ) x^2\right )}{x \left (2+5 \left (-1-e^4+e^x\right ) x+5 x^2\right )}+\log \left (-1-e^4+e^x+\frac {2}{5 x}+x\right )\right ) \, dx \\ & = \int \frac {(2+x) \left (-2+5 \left (1+e^x\right ) x^2\right )}{x \left (2+5 \left (-1-e^4+e^x\right ) x+5 x^2\right )} \, dx+\int \log \left (-1-e^4+e^x+\frac {2}{5 x}+x\right ) \, dx \\ & = x \log \left (-1-e^4+e^x+\frac {2}{5 x}+x\right )-\int \frac {-2+5 \left (1+e^x\right ) x^2}{2+5 \left (-1-e^4+e^x\right ) x+5 x^2} \, dx+\int \left (2+x+\frac {(2+x) \left (-2-2 x+5 \left (2+e^4\right ) x^2-5 x^3\right )}{x \left (2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2\right )}\right ) \, dx \\ & = 2 x+\frac {x^2}{2}+x \log \left (-1-e^4+e^x+\frac {2}{5 x}+x\right )+\int \frac {(2+x) \left (-2-2 x+5 \left (2+e^4\right ) x^2-5 x^3\right )}{x \left (2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2\right )} \, dx-\int \left (x+\frac {-2-2 x+5 \left (2+e^4\right ) x^2-5 x^3}{2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2}\right ) \, dx \\ & = 2 x+x \log \left (-1-e^4+e^x+\frac {2}{5 x}+x\right )-\int \frac {-2-2 x+5 \left (2+e^4\right ) x^2-5 x^3}{2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2} \, dx+\int \left (\frac {6}{-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2}+\frac {4}{x \left (-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2\right )}+\frac {5 x^3}{-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2}+\frac {2 \left (9+5 e^4\right ) x}{2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2}+\frac {5 e^4 x^2}{2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2}\right ) \, dx \\ & = 2 x+x \log \left (-1-e^4+e^x+\frac {2}{5 x}+x\right )+4 \int \frac {1}{x \left (-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2\right )} \, dx+5 \int \frac {x^3}{-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2} \, dx+6 \int \frac {1}{-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2} \, dx+\left (5 e^4\right ) \int \frac {x^2}{2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2} \, dx+\left (2 \left (9+5 e^4\right )\right ) \int \frac {x}{2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2} \, dx-\int \left (\frac {2}{-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2}+\frac {2 x}{-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2}+\frac {5 x^3}{-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2}+\frac {5 \left (2+e^4\right ) x^2}{2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2}\right ) \, dx \\ & = 2 x+x \log \left (-1-e^4+e^x+\frac {2}{5 x}+x\right )-2 \int \frac {1}{-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2} \, dx-2 \int \frac {x}{-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2} \, dx+4 \int \frac {1}{x \left (-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2\right )} \, dx+6 \int \frac {1}{-2-5 e^x x+5 \left (1+e^4\right ) x-5 x^2} \, dx+\left (5 e^4\right ) \int \frac {x^2}{2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2} \, dx-\left (5 \left (2+e^4\right )\right ) \int \frac {x^2}{2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2} \, dx+\left (2 \left (9+5 e^4\right )\right ) \int \frac {x}{2+5 e^x x-5 \left (1+e^4\right ) x+5 x^2} \, dx \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(51\) vs. \(2(23)=46\).

Time = 5.17 (sec) , antiderivative size = 51, normalized size of antiderivative = 2.22 \[ \int \frac {-4-2 x+10 x^2+5 x^3+e^x \left (10 x^2+5 x^3\right )+\left (2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3\right ) \log \left (\frac {2-5 x-5 e^4 x+5 e^x x+5 x^2}{5 x}\right )}{2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3} \, dx=-2 \log (x)+x \log \left (-1-e^4+e^x+\frac {2}{5 x}+x\right )+2 \log \left (2-5 x-5 e^4 x+5 e^x x+5 x^2\right ) \]

[In]

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

[Out]

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

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(57\) vs. \(2(19)=38\).

Time = 0.89 (sec) , antiderivative size = 58, normalized size of antiderivative = 2.52

method result size
norman \(2 \ln \left (\frac {5 \,{\mathrm e}^{x} x -5 x \,{\mathrm e}^{4}+5 x^{2}-5 x +2}{5 x}\right )+\ln \left (\frac {5 \,{\mathrm e}^{x} x -5 x \,{\mathrm e}^{4}+5 x^{2}-5 x +2}{5 x}\right ) x\) \(58\)
parallelrisch \(\ln \left (-\frac {5 x \,{\mathrm e}^{4}-5 \,{\mathrm e}^{x} x -5 x^{2}+5 x -2}{5 x}\right ) x +2 \ln \left (-\frac {5 x \,{\mathrm e}^{4}-5 \,{\mathrm e}^{x} x -5 x^{2}+5 x -2}{5 x}\right )\) \(58\)
risch \(x \ln \left (x \,{\mathrm e}^{4}-\frac {2}{5}-x^{2}+\left (1-{\mathrm e}^{x}\right ) x \right )-x \ln \left (x \right )-i \pi x {\operatorname {csgn}\left (\frac {i \left (x \,{\mathrm e}^{4}-\frac {2}{5}-x^{2}+\left (1-{\mathrm e}^{x}\right ) x \right )}{x}\right )}^{2}+\frac {i \pi x \,\operatorname {csgn}\left (i \left (x \,{\mathrm e}^{4}-\frac {2}{5}-x^{2}+\left (1-{\mathrm e}^{x}\right ) x \right )\right ) {\operatorname {csgn}\left (\frac {i \left (x \,{\mathrm e}^{4}-\frac {2}{5}-x^{2}+\left (1-{\mathrm e}^{x}\right ) x \right )}{x}\right )}^{2}}{2}-\frac {i \pi x \,\operatorname {csgn}\left (i \left (x \,{\mathrm e}^{4}-\frac {2}{5}-x^{2}+\left (1-{\mathrm e}^{x}\right ) x \right )\right ) \operatorname {csgn}\left (\frac {i \left (x \,{\mathrm e}^{4}-\frac {2}{5}-x^{2}+\left (1-{\mathrm e}^{x}\right ) x \right )}{x}\right ) \operatorname {csgn}\left (\frac {i}{x}\right )}{2}+\frac {i \pi x {\operatorname {csgn}\left (\frac {i \left (x \,{\mathrm e}^{4}-\frac {2}{5}-x^{2}+\left (1-{\mathrm e}^{x}\right ) x \right )}{x}\right )}^{3}}{2}+\frac {i \pi x {\operatorname {csgn}\left (\frac {i \left (x \,{\mathrm e}^{4}-\frac {2}{5}-x^{2}+\left (1-{\mathrm e}^{x}\right ) x \right )}{x}\right )}^{2} \operatorname {csgn}\left (\frac {i}{x}\right )}{2}+i \pi x +2 \ln \left ({\mathrm e}^{x}-\frac {5 x \,{\mathrm e}^{4}-5 x^{2}+5 x -2}{5 x}\right )\) \(283\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.30 \[ \int \frac {-4-2 x+10 x^2+5 x^3+e^x \left (10 x^2+5 x^3\right )+\left (2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3\right ) \log \left (\frac {2-5 x-5 e^4 x+5 e^x x+5 x^2}{5 x}\right )}{2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3} \, dx={\left (x + 2\right )} \log \left (\frac {5 \, x^{2} - 5 \, x e^{4} + 5 \, x e^{x} - 5 \, x + 2}{5 \, x}\right ) \]

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 49 vs. \(2 (19) = 38\).

Time = 0.25 (sec) , antiderivative size = 49, normalized size of antiderivative = 2.13 \[ \int \frac {-4-2 x+10 x^2+5 x^3+e^x \left (10 x^2+5 x^3\right )+\left (2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3\right ) \log \left (\frac {2-5 x-5 e^4 x+5 e^x x+5 x^2}{5 x}\right )}{2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3} \, dx=x \log {\left (\frac {x^{2} + x e^{x} - x e^{4} - x + \frac {2}{5}}{x} \right )} + 2 \log {\left (e^{x} + \frac {5 x^{2} - 5 x e^{4} - 5 x + 2}{5 x} \right )} \]

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 60 vs. \(2 (19) = 38\).

Time = 0.31 (sec) , antiderivative size = 60, normalized size of antiderivative = 2.61 \[ \int \frac {-4-2 x+10 x^2+5 x^3+e^x \left (10 x^2+5 x^3\right )+\left (2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3\right ) \log \left (\frac {2-5 x-5 e^4 x+5 e^x x+5 x^2}{5 x}\right )}{2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3} \, dx=-x \log \left (5\right ) + x \log \left (5 \, x^{2} - 5 \, x {\left (e^{4} + 1\right )} + 5 \, x e^{x} + 2\right ) - x \log \left (x\right ) + 2 \, \log \left (\frac {5 \, x^{2} - 5 \, x {\left (e^{4} + 1\right )} + 5 \, x e^{x} + 2}{5 \, x}\right ) \]

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (19) = 38\).

Time = 0.32 (sec) , antiderivative size = 56, normalized size of antiderivative = 2.43 \[ \int \frac {-4-2 x+10 x^2+5 x^3+e^x \left (10 x^2+5 x^3\right )+\left (2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3\right ) \log \left (\frac {2-5 x-5 e^4 x+5 e^x x+5 x^2}{5 x}\right )}{2 x-5 x^2-5 e^4 x^2+5 e^x x^2+5 x^3} \, dx=x \log \left (\frac {5 \, x^{2} - 5 \, x e^{4} + 5 \, x e^{x} - 5 \, x + 2}{5 \, x}\right ) + 2 \, \log \left (-5 \, x^{2} + 5 \, x e^{4} - 5 \, x e^{x} + 5 \, x - 2\right ) - 2 \, \log \left (x\right ) \]

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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