\(\int \frac {2-2 x-2 e^{2-x} x+e^{4 x+x^2} (7 x-e^{2-x} x+4 x^2)+(-x-e^{2-x} x) \log (x)}{2 x+e^{4 x+x^2} x+x \log (x)} \, dx\) [9854]

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

Optimal result

Integrand size = 83, antiderivative size = 29 \[ \int \frac {2-2 x-2 e^{2-x} x+e^{4 x+x^2} \left (7 x-e^{2-x} x+4 x^2\right )+\left (-x-e^{2-x} x\right ) \log (x)}{2 x+e^{4 x+x^2} x+x \log (x)} \, dx=e^{2-x}-x+\log \left (\frac {1}{9} \left (2+e^{x (4+x)}+\log (x)\right )^2\right ) \]

[Out]

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

Rubi [F]

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

[In]

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

[Out]

E^(2 - x) + 7*x + 2*x^2 - 16*Defer[Int][(2 + E^(x*(4 + x)) + Log[x])^(-1), x] + 2*Defer[Int][1/(x*(2 + E^(x*(4
 + x)) + Log[x])), x] - 8*Defer[Int][x/(2 + E^(x*(4 + x)) + Log[x]), x] - 8*Defer[Int][Log[x]/(2 + E^(x*(4 + x
)) + Log[x]), x] - 4*Defer[Int][(x*Log[x])/(2 + E^(x*(4 + x)) + Log[x]), x]

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

Mathematica [A] (verified)

Time = 5.83 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.86 \[ \int \frac {2-2 x-2 e^{2-x} x+e^{4 x+x^2} \left (7 x-e^{2-x} x+4 x^2\right )+\left (-x-e^{2-x} x\right ) \log (x)}{2 x+e^{4 x+x^2} x+x \log (x)} \, dx=e^{2-x}-x+2 \log \left (2+e^{x (4+x)}+\log (x)\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.20 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.83

method result size
risch \(-x +2 \ln \left (2+{\mathrm e}^{\left (4+x \right ) x}+\ln \left (x \right )\right )+{\mathrm e}^{2-x}\) \(24\)
default \(-x +2 \ln \left (\ln \left (x \right )+{\mathrm e}^{x^{2}+4 x}+2\right )+{\mathrm e}^{2-x}\) \(26\)
parallelrisch \(-x +2 \ln \left (\ln \left (x \right )+{\mathrm e}^{x^{2}+4 x}+2\right )+{\mathrm e}^{2-x}\) \(26\)
parts \(-x +2 \ln \left (\ln \left (x \right )+{\mathrm e}^{x^{2}+4 x}+2\right )+{\mathrm e}^{2-x}\) \(26\)

[In]

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

[Out]

-x+2*ln(2+exp((4+x)*x)+ln(x))+exp(2-x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.86 \[ \int \frac {2-2 x-2 e^{2-x} x+e^{4 x+x^2} \left (7 x-e^{2-x} x+4 x^2\right )+\left (-x-e^{2-x} x\right ) \log (x)}{2 x+e^{4 x+x^2} x+x \log (x)} \, dx=-x + e^{\left (-x + 2\right )} + 2 \, \log \left (e^{\left (x^{2} + 4 \, x\right )} + \log \left (x\right ) + 2\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.76 \[ \int \frac {2-2 x-2 e^{2-x} x+e^{4 x+x^2} \left (7 x-e^{2-x} x+4 x^2\right )+\left (-x-e^{2-x} x\right ) \log (x)}{2 x+e^{4 x+x^2} x+x \log (x)} \, dx=- x + e^{2 - x} + 2 \log {\left (e^{x^{2} + 4 x} + \log {\left (x \right )} + 2 \right )} \]

[In]

integrate(((-x*exp(2-x)-x)*ln(x)+(-x*exp(2-x)+4*x**2+7*x)*exp(x**2+4*x)-2*x*exp(2-x)-2*x+2)/(x*ln(x)+x*exp(x**
2+4*x)+2*x),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.17 \[ \int \frac {2-2 x-2 e^{2-x} x+e^{4 x+x^2} \left (7 x-e^{2-x} x+4 x^2\right )+\left (-x-e^{2-x} x\right ) \log (x)}{2 x+e^{4 x+x^2} x+x \log (x)} \, dx={\left (7 \, x e^{x} + e^{2}\right )} e^{\left (-x\right )} + 2 \, \log \left ({\left (e^{\left (x^{2} + 4 \, x\right )} + \log \left (x\right ) + 2\right )} e^{\left (-4 \, x\right )}\right ) \]

[In]

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

[Out]

(7*x*e^x + e^2)*e^(-x) + 2*log((e^(x^2 + 4*x) + log(x) + 2)*e^(-4*x))

Giac [B] (verification not implemented)

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

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 14.49 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.90 \[ \int \frac {2-2 x-2 e^{2-x} x+e^{4 x+x^2} \left (7 x-e^{2-x} x+4 x^2\right )+\left (-x-e^{2-x} x\right ) \log (x)}{2 x+e^{4 x+x^2} x+x \log (x)} \, dx=2\,\ln \left (\ln \left (x\right )+{\mathrm {e}}^{4\,x}\,{\mathrm {e}}^{x^2}+2\right )-x+{\mathrm {e}}^{2-x} \]

[In]

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

[Out]

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