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

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

Optimal result

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

[Out]

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

Rubi [F]

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

[In]

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

[Out]

-E^(-5 + x) + 2/(2 - x) - 2*ExpIntegralEi[x] + 2*E^x*Log[x] + x^2*Log[x]^2 + Defer[Int][E^x*Log[x]^2, x] + Def
er[Int][E^x*x*Log[x]^2, x]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.85 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.15

method result size
default \(x \,{\mathrm e}^{x} \ln \left (x \right )^{2}-\frac {2}{-2+x}+x^{2} \ln \left (x \right )^{2}-{\mathrm e}^{-5+x}\) \(31\)
parts \(x \,{\mathrm e}^{x} \ln \left (x \right )^{2}-\frac {2}{-2+x}+x^{2} \ln \left (x \right )^{2}-{\mathrm e}^{-5+x}\) \(31\)
risch \(\left ({\mathrm e}^{x} x +x^{2}\right ) \ln \left (x \right )^{2}-\frac {x \,{\mathrm e}^{-5+x}-2 \,{\mathrm e}^{-5+x}+2}{-2+x}\) \(36\)
parallelrisch \(\frac {2 x^{3} \ln \left (x \right )^{2}+2 x^{2} {\mathrm e}^{x} \ln \left (x \right )^{2}-4 x^{2} \ln \left (x \right )^{2}-4 x \,{\mathrm e}^{x} \ln \left (x \right )^{2}-2 x \,{\mathrm e}^{-5+x}-4+4 \,{\mathrm e}^{-5+x}}{2 x -4}\) \(61\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

x^2*log(x)^2 + x*e^x*log(x)^2 + 4*e^(-3)*exp_integral_e(2, -x + 2)/(x - 2) - 2/(x - 2) - integrate((x^2 - 4*x)
*e^x/(x^2*e^5 - 4*x*e^5 + 4*e^5), x)

Giac [B] (verification not implemented)

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

Time = 0.27 (sec) , antiderivative size = 70, normalized size of antiderivative = 2.59 \[ \int \frac {2+e^{-5+x} \left (-4+4 x-x^2\right )+\left (8 x-8 x^2+2 x^3+e^x \left (8-8 x+2 x^2\right )\right ) \log (x)+\left (8 x-8 x^2+2 x^3+e^x \left (4-3 x^2+x^3\right )\right ) \log ^2(x)}{4-4 x+x^2} \, dx=\frac {x^{3} e^{5} \log \left (x\right )^{2} - 2 \, x^{2} e^{5} \log \left (x\right )^{2} + x^{2} e^{\left (x + 5\right )} \log \left (x\right )^{2} - 2 \, x e^{\left (x + 5\right )} \log \left (x\right )^{2} - x e^{x} - 2 \, e^{5} + 2 \, e^{x}}{x e^{5} - 2 \, e^{5}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 9.06 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00 \[ \int \frac {2+e^{-5+x} \left (-4+4 x-x^2\right )+\left (8 x-8 x^2+2 x^3+e^x \left (8-8 x+2 x^2\right )\right ) \log (x)+\left (8 x-8 x^2+2 x^3+e^x \left (4-3 x^2+x^3\right )\right ) \log ^2(x)}{4-4 x+x^2} \, dx={\ln \left (x\right )}^2\,\left (x\,{\mathrm {e}}^x+x^2\right )-\frac {2}{x-2}-{\mathrm {e}}^{x-5} \]

[In]

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

[Out]

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