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

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

Optimal result

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

[Out]

1/exp(2)^2*exp(x)^2+x+(-1-x)^2-6*exp(x)/x

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.12, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {12, 14, 2225, 2228} \[ \int \frac {e^{4+x} (6-6 x)+2 e^{2 x} x^2+e^4 \left (3 x^2+2 x^3\right )}{e^4 x^2} \, dx=\frac {1}{4} (2 x+3)^2+e^{2 x-4}-\frac {6 e^x}{x} \]

[In]

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

[Out]

E^(-4 + 2*x) - (6*E^x)/x + (3 + 2*x)^2/4

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, 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 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 2228

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> With[{b = Coefficient[v, x, 1], d = Coefficient[u, x, 0],
e = Coefficient[u, x, 1], f = Coefficient[w, x, 0], g = Coefficient[w, x, 1]}, Simp[g*u^(m + 1)*(F^(c*v)/(b*c*
e*Log[F])), x] /; EqQ[e*g*(m + 1) - b*c*(e*f - d*g)*Log[F], 0]] /; FreeQ[{F, c, m}, x] && LinearQ[{u, v, w}, x
]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

E^(-4 + 2*x) - (6*E^x)/x + 3*x + x^2

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.88

method result size
risch \(x^{2}+3 x +{\mathrm e}^{2 x -4}-\frac {6 \,{\mathrm e}^{x}}{x}\) \(21\)
parts \(x^{2}+3 x +{\mathrm e}^{-4} {\mathrm e}^{2 x}-\frac {6 \,{\mathrm e}^{x}}{x}\) \(24\)
norman \(\frac {\left (x^{3} {\mathrm e}^{2}+x \,{\mathrm e}^{-2} {\mathrm e}^{2 x}+3 x^{2} {\mathrm e}^{2}-6 \,{\mathrm e}^{2} {\mathrm e}^{x}\right ) {\mathrm e}^{-2}}{x}\) \(39\)
parallelrisch \(\frac {{\mathrm e}^{-4} \left (3 x^{2} {\mathrm e}^{4}+x^{3} {\mathrm e}^{4}-6 \,{\mathrm e}^{4} {\mathrm e}^{x}+x \,{\mathrm e}^{2 x}\right )}{x}\) \(41\)
default \({\mathrm e}^{-4} \left (3 x \,{\mathrm e}^{4}+{\mathrm e}^{2 x}+x^{2} {\mathrm e}^{4}+6 \,{\mathrm e}^{4} \left (-\frac {{\mathrm e}^{x}}{x}-\operatorname {Ei}_{1}\left (-x \right )\right )+6 \,{\mathrm e}^{4} \operatorname {Ei}_{1}\left (-x \right )\right )\) \(58\)

[In]

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

[Out]

x^2+3*x+exp(2*x-4)-6*exp(x)/x

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.38 \[ \int \frac {e^{4+x} (6-6 x)+2 e^{2 x} x^2+e^4 \left (3 x^2+2 x^3\right )}{e^4 x^2} \, dx=\frac {{\left ({\left (x^{3} + 3 \, x^{2}\right )} e^{12} + x e^{\left (2 \, x + 8\right )} - 6 \, e^{\left (x + 12\right )}\right )} e^{\left (-12\right )}}{x} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

x**2 + 3*x + (x*exp(2*x) - 6*exp(4)*exp(x))*exp(-4)/x

Maxima [C] (verification not implemented)

Result contains higher order function than in optimal. Order 4 vs. order 3.

Time = 0.21 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.42 \[ \int \frac {e^{4+x} (6-6 x)+2 e^{2 x} x^2+e^4 \left (3 x^2+2 x^3\right )}{e^4 x^2} \, dx={\left (x^{2} e^{4} + 3 \, x e^{4} - 6 \, {\rm Ei}\left (x\right ) e^{4} + 6 \, e^{4} \Gamma \left (-1, -x\right ) + e^{\left (2 \, x\right )}\right )} e^{\left (-4\right )} \]

[In]

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

[Out]

(x^2*e^4 + 3*x*e^4 - 6*Ei(x)*e^4 + 6*e^4*gamma(-1, -x) + e^(2*x))*e^(-4)

Giac [B] (verification not implemented)

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

Time = 0.27 (sec) , antiderivative size = 65, normalized size of antiderivative = 2.71 \[ \int \frac {e^{4+x} (6-6 x)+2 e^{2 x} x^2+e^4 \left (3 x^2+2 x^3\right )}{e^4 x^2} \, dx=\frac {{\left ({\left (x + 4\right )}^{3} e^{12} - 9 \, {\left (x + 4\right )}^{2} e^{12} + 20 \, {\left (x + 4\right )} e^{12} + {\left (x + 4\right )} e^{\left (2 \, x + 8\right )} - 4 \, e^{\left (2 \, x + 8\right )} - 6 \, e^{\left (x + 12\right )}\right )} e^{\left (-4\right )}}{{\left (x + 4\right )} e^{8} - 4 \, e^{8}} \]

[In]

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

[Out]

((x + 4)^3*e^12 - 9*(x + 4)^2*e^12 + 20*(x + 4)*e^12 + (x + 4)*e^(2*x + 8) - 4*e^(2*x + 8) - 6*e^(x + 12))*e^(
-4)/((x + 4)*e^8 - 4*e^8)

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

3*x + exp(2*x - 4) - (6*exp(x))/x + x^2