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

   Optimal result
   Rubi [B] (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 = 47, antiderivative size = 19 \[ \int \frac {3-2 x^2+12 x^5+5 x^6+e^{2 x} \left (1-2 x-4 x^2+4 x^5+2 x^6\right )}{x^2} \, dx=\left (3+e^{2 x}+x\right ) \left (-2-\frac {1}{x}+x^4\right ) \]

[Out]

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

Rubi [B] (verified)

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

Time = 0.12 (sec) , antiderivative size = 43, normalized size of antiderivative = 2.26, number of steps used = 19, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.128, Rules used = {14, 2230, 2225, 2208, 2209, 2207} \[ \int \frac {3-2 x^2+12 x^5+5 x^6+e^{2 x} \left (1-2 x-4 x^2+4 x^5+2 x^6\right )}{x^2} \, dx=x^5+e^{2 x} x^4+3 x^4-2 x-2 e^{2 x}-\frac {e^{2 x}}{x}-\frac {3}{x} \]

[In]

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

[Out]

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

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 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 2208

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[(c + d*x)^(m
+ 1)*((b*F^(g*(e + f*x)))^n/(d*(m + 1))), x] - Dist[f*g*n*(Log[F]/(d*(m + 1))), 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] && LtQ[m, -1] && IntegerQ[2*m] &&  !TrueQ[$UseGamm
a]

Rule 2209

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - c*(f/d)))/d)*ExpInteg
ralEi[f*g*(c + d*x)*(Log[F]/d)], x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !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 2230

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), w*NormalizePo
werOfLinear[u, x]^m, x], x] /; FreeQ[{F, c}, x] && PolynomialQ[w, x] && LinearQ[v, x] && PowerOfLinearQ[u, x]
&& IntegerQ[m] &&  !TrueQ[$UseGamma]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.10 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.79

method result size
risch \(x^{5}+3 x^{4}-2 x -\frac {3}{x}+\frac {\left (x^{5}-2 x -1\right ) {\mathrm e}^{2 x}}{x}\) \(34\)
default \(-2 x -\frac {{\mathrm e}^{2 x}}{x}-\frac {3}{x}+3 x^{4}+x^{5}-2 \,{\mathrm e}^{2 x}+{\mathrm e}^{2 x} x^{4}\) \(41\)
norman \(\frac {x^{5} {\mathrm e}^{2 x}+x^{6}+3 x^{5}-2 x \,{\mathrm e}^{2 x}-2 x^{2}-{\mathrm e}^{2 x}-3}{x}\) \(41\)
parallelrisch \(\frac {x^{5} {\mathrm e}^{2 x}+x^{6}+3 x^{5}-2 x \,{\mathrm e}^{2 x}-2 x^{2}-{\mathrm e}^{2 x}-3}{x}\) \(41\)
parts \(-2 x -\frac {{\mathrm e}^{2 x}}{x}-\frac {3}{x}+3 x^{4}+x^{5}-2 \,{\mathrm e}^{2 x}+{\mathrm e}^{2 x} x^{4}\) \(41\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.68 \[ \int \frac {3-2 x^2+12 x^5+5 x^6+e^{2 x} \left (1-2 x-4 x^2+4 x^5+2 x^6\right )}{x^2} \, dx=\frac {x^{6} + 3 \, x^{5} - 2 \, x^{2} + {\left (x^{5} - 2 \, x - 1\right )} e^{\left (2 \, x\right )} - 3}{x} \]

[In]

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

[Out]

(x^6 + 3*x^5 - 2*x^2 + (x^5 - 2*x - 1)*e^(2*x) - 3)/x

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.53 \[ \int \frac {3-2 x^2+12 x^5+5 x^6+e^{2 x} \left (1-2 x-4 x^2+4 x^5+2 x^6\right )}{x^2} \, dx=x^{5} + 3 x^{4} - 2 x + \frac {\left (x^{5} - 2 x - 1\right ) e^{2 x}}{x} - \frac {3}{x} \]

[In]

integrate(((2*x**6+4*x**5-4*x**2-2*x+1)*exp(x)**2+5*x**6+12*x**5-2*x**2+3)/x**2,x)

[Out]

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

Maxima [C] (verification not implemented)

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

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

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

Time = 0.27 (sec) , antiderivative size = 40, normalized size of antiderivative = 2.11 \[ \int \frac {3-2 x^2+12 x^5+5 x^6+e^{2 x} \left (1-2 x-4 x^2+4 x^5+2 x^6\right )}{x^2} \, dx=\frac {x^{6} + x^{5} e^{\left (2 \, x\right )} + 3 \, x^{5} - 2 \, x^{2} - 2 \, x e^{\left (2 \, x\right )} - e^{\left (2 \, x\right )} - 3}{x} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 12.40 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.79 \[ \int \frac {3-2 x^2+12 x^5+5 x^6+e^{2 x} \left (1-2 x-4 x^2+4 x^5+2 x^6\right )}{x^2} \, dx=x^4\,\left ({\mathrm {e}}^{2\,x}+3\right )-2\,{\mathrm {e}}^{2\,x}-\frac {{\mathrm {e}}^{2\,x}+3}{x}-2\,x+x^5 \]

[In]

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

[Out]

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