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

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

Optimal result

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

[Out]

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

Rubi [F]

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

[In]

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

[Out]

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

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 9.42 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.95

method result size
risch \(x -\frac {1}{{\mathrm e}^{-4 \ln \left (x \right )^{2}}+x -{\mathrm e}^{x}}\) \(20\)
parallelrisch \(\frac {{\mathrm e}^{-4 \ln \left (x \right )^{2}} x -1+x^{2}-{\mathrm e}^{x} x}{{\mathrm e}^{-4 \ln \left (x \right )^{2}}+x -{\mathrm e}^{x}}\) \(40\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

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

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

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

Time = 0.33 (sec) , antiderivative size = 607, normalized size of antiderivative = 28.90 \[ \int \frac {x+e^{2 x} x+e^{-8 \log ^2(x)} x+x^3+e^x \left (-x-2 x^2\right )+e^{-4 \log ^2(x)} \left (-2 e^x x+2 x^2-8 \log (x)\right )}{e^{2 x} x+e^{-8 \log ^2(x)} x-2 e^x x^2+x^3+e^{-4 \log ^2(x)} \left (-2 e^x x+2 x^2\right )} \, dx=\frac {8 \, x^{4} e^{\left (4 \, \log \left (x\right )^{2}\right )} \log \left (x\right ) + x^{4} e^{\left (4 \, \log \left (x\right )^{2}\right )} - x^{4} e^{\left (4 \, \log \left (x\right )^{2} + x\right )} - 24 \, x^{3} e^{\left (4 \, \log \left (x\right )^{2} + x\right )} \log \left (x\right ) + 2 \, x^{3} e^{\left (4 \, \log \left (x\right )^{2} + 2 \, x\right )} - 2 \, x^{3} e^{\left (4 \, \log \left (x\right )^{2} + x\right )} - 2 \, x^{3} e^{x} + 16 \, x^{3} \log \left (x\right ) - 8 \, x^{2} e^{\left (4 \, \log \left (x\right )^{2}\right )} \log \left (x\right ) + 8 \, x^{2} e^{\left (-4 \, \log \left (x\right )^{2}\right )} \log \left (x\right ) + 24 \, x^{2} e^{\left (4 \, \log \left (x\right )^{2} + 2 \, x\right )} \log \left (x\right ) - 32 \, x^{2} e^{x} \log \left (x\right ) + 2 \, x^{3} - x^{2} e^{\left (4 \, \log \left (x\right )^{2}\right )} + x^{2} e^{\left (-4 \, \log \left (x\right )^{2}\right )} - x^{2} e^{\left (4 \, \log \left (x\right )^{2} + 3 \, x\right )} + x^{2} e^{\left (4 \, \log \left (x\right )^{2} + 2 \, x\right )} + x^{2} e^{\left (4 \, \log \left (x\right )^{2} + x\right )} - x^{2} e^{\left (-4 \, \log \left (x\right )^{2} + x\right )} + 2 \, x^{2} e^{\left (2 \, x\right )} - 2 \, x^{2} e^{x} - 8 \, x e^{\left (4 \, \log \left (x\right )^{2} + 3 \, x\right )} \log \left (x\right ) + 16 \, x e^{\left (4 \, \log \left (x\right )^{2} + x\right )} \log \left (x\right ) - 8 \, x e^{\left (-4 \, \log \left (x\right )^{2} + x\right )} \log \left (x\right ) + 16 \, x e^{\left (2 \, x\right )} \log \left (x\right ) - x e^{\left (4 \, \log \left (x\right )^{2} + 2 \, x\right )} + x e^{\left (4 \, \log \left (x\right )^{2} + x\right )} + x e^{x} - 8 \, x \log \left (x\right ) - 8 \, e^{\left (4 \, \log \left (x\right )^{2} + 2 \, x\right )} \log \left (x\right ) + 8 \, e^{x} \log \left (x\right ) - x}{8 \, x^{3} e^{\left (4 \, \log \left (x\right )^{2}\right )} \log \left (x\right ) + x^{3} e^{\left (4 \, \log \left (x\right )^{2}\right )} - x^{3} e^{\left (4 \, \log \left (x\right )^{2} + x\right )} - 24 \, x^{2} e^{\left (4 \, \log \left (x\right )^{2} + x\right )} \log \left (x\right ) + 2 \, x^{2} e^{\left (4 \, \log \left (x\right )^{2} + 2 \, x\right )} - 2 \, x^{2} e^{\left (4 \, \log \left (x\right )^{2} + x\right )} - 2 \, x^{2} e^{x} + 16 \, x^{2} \log \left (x\right ) + 8 \, x e^{\left (-4 \, \log \left (x\right )^{2}\right )} \log \left (x\right ) + 24 \, x e^{\left (4 \, \log \left (x\right )^{2} + 2 \, x\right )} \log \left (x\right ) - 32 \, x e^{x} \log \left (x\right ) + 2 \, x^{2} + x e^{\left (-4 \, \log \left (x\right )^{2}\right )} - x e^{\left (4 \, \log \left (x\right )^{2} + 3 \, x\right )} + x e^{\left (4 \, \log \left (x\right )^{2} + 2 \, x\right )} - x e^{\left (-4 \, \log \left (x\right )^{2} + x\right )} + 2 \, x e^{\left (2 \, x\right )} - 2 \, x e^{x} - 8 \, e^{\left (4 \, \log \left (x\right )^{2} + 3 \, x\right )} \log \left (x\right ) - 8 \, e^{\left (-4 \, \log \left (x\right )^{2} + x\right )} \log \left (x\right ) + 16 \, e^{\left (2 \, x\right )} \log \left (x\right )} \]

[In]

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

[Out]

(8*x^4*e^(4*log(x)^2)*log(x) + x^4*e^(4*log(x)^2) - x^4*e^(4*log(x)^2 + x) - 24*x^3*e^(4*log(x)^2 + x)*log(x)
+ 2*x^3*e^(4*log(x)^2 + 2*x) - 2*x^3*e^(4*log(x)^2 + x) - 2*x^3*e^x + 16*x^3*log(x) - 8*x^2*e^(4*log(x)^2)*log
(x) + 8*x^2*e^(-4*log(x)^2)*log(x) + 24*x^2*e^(4*log(x)^2 + 2*x)*log(x) - 32*x^2*e^x*log(x) + 2*x^3 - x^2*e^(4
*log(x)^2) + x^2*e^(-4*log(x)^2) - x^2*e^(4*log(x)^2 + 3*x) + x^2*e^(4*log(x)^2 + 2*x) + x^2*e^(4*log(x)^2 + x
) - x^2*e^(-4*log(x)^2 + x) + 2*x^2*e^(2*x) - 2*x^2*e^x - 8*x*e^(4*log(x)^2 + 3*x)*log(x) + 16*x*e^(4*log(x)^2
 + x)*log(x) - 8*x*e^(-4*log(x)^2 + x)*log(x) + 16*x*e^(2*x)*log(x) - x*e^(4*log(x)^2 + 2*x) + x*e^(4*log(x)^2
 + x) + x*e^x - 8*x*log(x) - 8*e^(4*log(x)^2 + 2*x)*log(x) + 8*e^x*log(x) - x)/(8*x^3*e^(4*log(x)^2)*log(x) +
x^3*e^(4*log(x)^2) - x^3*e^(4*log(x)^2 + x) - 24*x^2*e^(4*log(x)^2 + x)*log(x) + 2*x^2*e^(4*log(x)^2 + 2*x) -
2*x^2*e^(4*log(x)^2 + x) - 2*x^2*e^x + 16*x^2*log(x) + 8*x*e^(-4*log(x)^2)*log(x) + 24*x*e^(4*log(x)^2 + 2*x)*
log(x) - 32*x*e^x*log(x) + 2*x^2 + x*e^(-4*log(x)^2) - x*e^(4*log(x)^2 + 3*x) + x*e^(4*log(x)^2 + 2*x) - x*e^(
-4*log(x)^2 + x) + 2*x*e^(2*x) - 2*x*e^x - 8*e^(4*log(x)^2 + 3*x)*log(x) - 8*e^(-4*log(x)^2 + x)*log(x) + 16*e
^(2*x)*log(x))

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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