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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (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 = 40, antiderivative size = 22 \[ \int \frac {-x^3+2 e^{e^{2 x}+2 x} x^3-4 \log \left (x^2\right )+2 \log ^2\left (x^2\right )}{x^3} \, dx=e^{e^{2 x}}-x-\frac {\log ^2\left (x^2\right )}{x^2} \]

[Out]

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

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {14, 2320, 2225, 2341, 2342} \[ \int \frac {-x^3+2 e^{e^{2 x}+2 x} x^3-4 \log \left (x^2\right )+2 \log ^2\left (x^2\right )}{x^3} \, dx=-\frac {\log ^2\left (x^2\right )}{x^2}+e^{e^{2 x}}-x \]

[In]

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

[Out]

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

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.13 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.36

method result size
parallelrisch \(\frac {-2 x^{3}+2 x^{2} {\mathrm e}^{{\mathrm e}^{2 x}}-2 \ln \left (x^{2}\right )^{2}}{2 x^{2}}\) \(30\)
default \(-x +\frac {2 \ln \left (x^{2}\right )}{x^{2}}+\frac {2}{x^{2}}+\frac {-2-\ln \left (x^{2}\right )^{2}-2 \ln \left (x^{2}\right )}{x^{2}}+{\mathrm e}^{{\mathrm e}^{2 x}}\) \(44\)
parts \(-x +\frac {2 \ln \left (x^{2}\right )}{x^{2}}+\frac {2}{x^{2}}+\frac {-2-\ln \left (x^{2}\right )^{2}-2 \ln \left (x^{2}\right )}{x^{2}}+{\mathrm e}^{{\mathrm e}^{2 x}}\) \(44\)
risch \(-\frac {4 \ln \left (x \right )^{2}}{x^{2}}+\frac {2 i \pi \,\operatorname {csgn}\left (i x^{2}\right ) \left (\operatorname {csgn}\left (i x \right )^{2}-2 \,\operatorname {csgn}\left (i x^{2}\right ) \operatorname {csgn}\left (i x \right )+\operatorname {csgn}\left (i x^{2}\right )^{2}\right ) \ln \left (x \right )}{x^{2}}+\frac {\pi ^{2} \operatorname {csgn}\left (i x \right )^{4} \operatorname {csgn}\left (i x^{2}\right )^{2}-4 \pi ^{2} \operatorname {csgn}\left (i x \right )^{3} \operatorname {csgn}\left (i x^{2}\right )^{3}+6 \pi ^{2} \operatorname {csgn}\left (i x \right )^{2} \operatorname {csgn}\left (i x^{2}\right )^{4}-4 \pi ^{2} \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i x^{2}\right )^{5}+\pi ^{2} \operatorname {csgn}\left (i x^{2}\right )^{6}-4 x^{3}}{4 x^{2}}+{\mathrm e}^{{\mathrm e}^{2 x}}\) \(168\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (20) = 40\).

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (20) = 40\).

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 8.75 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91 \[ \int \frac {-x^3+2 e^{e^{2 x}+2 x} x^3-4 \log \left (x^2\right )+2 \log ^2\left (x^2\right )}{x^3} \, dx={\mathrm {e}}^{{\mathrm {e}}^{2\,x}}-x-\frac {{\ln \left (x^2\right )}^2}{x^2} \]

[In]

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

[Out]

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