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

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.42, number of steps used = 17, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.205, Rules used = {14, 2207, 2225, 6874, 2395, 2342, 2341, 2339, 30} \[ \int \frac {e^{4+x} \left (-x^2-x^3\right )+\left (-8+8 x-4 e^4 x\right ) \log ^3(x)+2 \log ^4(x)}{x^2} \, dx=e^{x+4}-e^{x+4} (x+1)-\frac {2 \log ^4(x)}{x}+\left (2-e^4\right ) \log ^4(x) \]

[In]

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

[Out]

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

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 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2207

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^m*
((b*F^(g*(e + f*x)))^n/(f*g*n*Log[F])), x] - Dist[d*(m/(f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*(b*F^(g*(e + f*x
)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && GtQ[m, 0] && IntegerQ[2*m] &&  !TrueQ[$UseGamma]

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 2339

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/(x_), x_Symbol] :> Dist[1/(b*n), Subst[Int[x^p, x], x, a + b*L
og[c*x^n]], x] /; FreeQ[{a, b, c, n, p}, 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]

Rule 2395

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.76 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.04

method result size
risch \(-\frac {\left (x \,{\mathrm e}^{4}-2 x +2\right ) \ln \left (x \right )^{4}}{x}-x \,{\mathrm e}^{4+x}\) \(27\)
default \(-\left (4+x \right ) {\mathrm e}^{4+x}+4 \,{\mathrm e}^{4+x}-\frac {2 \ln \left (x \right )^{4}}{x}-{\mathrm e}^{4} \ln \left (x \right )^{4}+2 \ln \left (x \right )^{4}\) \(40\)
parts \(-\left (4+x \right ) {\mathrm e}^{4+x}+4 \,{\mathrm e}^{4+x}-\frac {2 \ln \left (x \right )^{4}}{x}-{\mathrm e}^{4} \ln \left (x \right )^{4}+2 \ln \left (x \right )^{4}\) \(40\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 82 vs. \(2 (23) = 46\).

Time = 0.19 (sec) , antiderivative size = 82, normalized size of antiderivative = 3.15 \[ \int \frac {e^{4+x} \left (-x^2-x^3\right )+\left (-8+8 x-4 e^4 x\right ) \log ^3(x)+2 \log ^4(x)}{x^2} \, dx=-e^{4} \log \left (x\right )^{4} + 2 \, \log \left (x\right )^{4} - {\left (x e^{4} - e^{4}\right )} e^{x} - \frac {2 \, {\left (\log \left (x\right )^{4} + 4 \, \log \left (x\right )^{3} + 12 \, \log \left (x\right )^{2} + 24 \, \log \left (x\right ) + 24\right )}}{x} + \frac {8 \, {\left (\log \left (x\right )^{3} + 3 \, \log \left (x\right )^{2} + 6 \, \log \left (x\right ) + 6\right )}}{x} - e^{\left (x + 4\right )} \]

[In]

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

[Out]

-e^4*log(x)^4 + 2*log(x)^4 - (x*e^4 - e^4)*e^x - 2*(log(x)^4 + 4*log(x)^3 + 12*log(x)^2 + 24*log(x) + 24)/x +
8*(log(x)^3 + 3*log(x)^2 + 6*log(x) + 6)/x - e^(x + 4)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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