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

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

Optimal result

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

[Out]

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

Rubi [F]

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

[In]

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

[Out]

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

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

Mathematica [A] (verified)

Time = 0.45 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.48 \[ \int \frac {-4 x^2+2 e^{1+x} x^2-2 x^4+\left (4 x^2+6 x^4+e^{1+x} \left (-2 x^2-2 x^3\right )\right ) \log (x)+\left (4-2 x^2+2 x^3+e^{1+x} \left (-2+2 x-x^2\right )\right ) \log ^2(x)}{6 x^2 \log ^2(x)} \, dx=\frac {1}{6} \left (e^x \left (-e+\frac {2 e}{x}\right )-\frac {4}{x}-2 x+x^2+\frac {2 x \left (2-e^{1+x}+x^2\right )}{\log (x)}\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.11 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.45

method result size
risch \(\frac {x^{3}-2 x^{2}-x \,{\mathrm e}^{1+x}+2 \,{\mathrm e}^{1+x}-4}{6 x}+\frac {x \left (x^{2}-{\mathrm e}^{1+x}+2\right )}{3 \ln \left (x \right )}\) \(48\)
parallelrisch \(-\frac {-x^{3} \ln \left (x \right )-2 x^{4}+x \,{\mathrm e}^{1+x} \ln \left (x \right )+2 x^{2} \ln \left (x \right )+2 x^{2} {\mathrm e}^{1+x}-2 \ln \left (x \right ) {\mathrm e}^{1+x}-4 x^{2}+4 \ln \left (x \right )}{6 \ln \left (x \right ) x}\) \(64\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 51 vs. \(2 (24) = 48\).

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

1/6*x^2 + 1/3*Ei(x)*e - 1/3*e*gamma(-1, -x) - 1/3*x - 1/3*x*e^(x + 1)/log(x) - 2/3/x - 1/6*e^(x + 1) - 2/3*gam
ma(-1, -log(x)) - gamma(-1, -3*log(x)) + 1/6*integrate(2*(3*x^2 + 2)/log(x), x)

Giac [B] (verification not implemented)

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

Time = 0.28 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.91 \[ \int \frac {-4 x^2+2 e^{1+x} x^2-2 x^4+\left (4 x^2+6 x^4+e^{1+x} \left (-2 x^2-2 x^3\right )\right ) \log (x)+\left (4-2 x^2+2 x^3+e^{1+x} \left (-2+2 x-x^2\right )\right ) \log ^2(x)}{6 x^2 \log ^2(x)} \, dx=\frac {2 \, x^{4} + x^{3} \log \left (x\right ) - 2 \, x^{2} e^{\left (x + 1\right )} - 2 \, x^{2} \log \left (x\right ) - x e^{\left (x + 1\right )} \log \left (x\right ) + 4 \, x^{2} + 2 \, e^{\left (x + 1\right )} \log \left (x\right ) - 4 \, \log \left (x\right )}{6 \, x \log \left (x\right )} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 14.45 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.70 \[ \int \frac {-4 x^2+2 e^{1+x} x^2-2 x^4+\left (4 x^2+6 x^4+e^{1+x} \left (-2 x^2-2 x^3\right )\right ) \log (x)+\left (4-2 x^2+2 x^3+e^{1+x} \left (-2+2 x-x^2\right )\right ) \log ^2(x)}{6 x^2 \log ^2(x)} \, dx=\frac {2\,x}{3\,\ln \left (x\right )}-\frac {{\mathrm {e}}^{x+1}}{6}-\frac {x}{3}+\frac {{\mathrm {e}}^{x+1}}{3\,x}+\frac {x^3}{3\,\ln \left (x\right )}-\frac {2}{3\,x}+\frac {x^2}{6}-\frac {x\,{\mathrm {e}}^{x+1}}{3\,\ln \left (x\right )} \]

[In]

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

[Out]

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