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

   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 [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 49, antiderivative size = 36 \[ \int \frac {-3 x^2+e^2 \left (-x^2+3 x^4\right )+e^x \left (-30+30 x+e^2 \left (-2 x^3-x^4\right )\right )}{x^2} \, dx=-e^2 \left (x+\left (e^x-x\right ) x^2\right )+3 \left (-x+\frac {10 e^x+x}{x}\right ) \]

[Out]

3*(10*exp(x)+x)/x-3*x-((exp(x)-x)*x^2+x)*exp(2)

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.94, number of steps used = 12, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {14, 2230, 2208, 2209, 2207, 2225} \[ \int \frac {-3 x^2+e^2 \left (-x^2+3 x^4\right )+e^x \left (-30+30 x+e^2 \left (-2 x^3-x^4\right )\right )}{x^2} \, dx=e^2 x^3-e^{x+2} x^2-\left (3+e^2\right ) x+\frac {30 e^x}{x} \]

[In]

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

[Out]

(30*E^x)/x - (3 + E^2)*x - E^(2 + x)*x^2 + E^2*x^3

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 (-3 \left (1+\frac {e^2}{3}\right )+3 e^2 x^2-\frac {e^x \left (30-30 x+2 e^2 x^3+e^2 x^4\right )}{x^2}\right ) \, dx \\ & = -\left (\left (3+e^2\right ) x\right )+e^2 x^3-\int \frac {e^x \left (30-30 x+2 e^2 x^3+e^2 x^4\right )}{x^2} \, dx \\ & = -\left (\left (3+e^2\right ) x\right )+e^2 x^3-\int \left (\frac {30 e^x}{x^2}-\frac {30 e^x}{x}+2 e^{2+x} x+e^{2+x} x^2\right ) \, dx \\ & = -\left (\left (3+e^2\right ) x\right )+e^2 x^3-2 \int e^{2+x} x \, dx-30 \int \frac {e^x}{x^2} \, dx+30 \int \frac {e^x}{x} \, dx-\int e^{2+x} x^2 \, dx \\ & = \frac {30 e^x}{x}-2 e^{2+x} x-\left (3+e^2\right ) x-e^{2+x} x^2+e^2 x^3+30 \operatorname {ExpIntegralEi}(x)+2 \int e^{2+x} \, dx+2 \int e^{2+x} x \, dx-30 \int \frac {e^x}{x} \, dx \\ & = 2 e^{2+x}+\frac {30 e^x}{x}-\left (3+e^2\right ) x-e^{2+x} x^2+e^2 x^3-2 \int e^{2+x} \, dx \\ & = \frac {30 e^x}{x}-\left (3+e^2\right ) x-e^{2+x} x^2+e^2 x^3 \\ \end{align*}

Mathematica [A] (verified)

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

[In]

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

[Out]

(30*E^x)/x - 3*x - E^2*x - E^(2 + x)*x^2 + E^2*x^3

Maple [A] (verified)

Time = 0.13 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.86

method result size
risch \(x^{3} {\mathrm e}^{2}-{\mathrm e}^{2} x -3 x -\frac {\left (x^{3} {\mathrm e}^{2}-30\right ) {\mathrm e}^{x}}{x}\) \(31\)
norman \(\frac {x^{4} {\mathrm e}^{2}+\left (-{\mathrm e}^{2}-3\right ) x^{2}-x^{3} {\mathrm e}^{2} {\mathrm e}^{x}+30 \,{\mathrm e}^{x}}{x}\) \(35\)
parallelrisch \(\frac {x^{4} {\mathrm e}^{2}-x^{3} {\mathrm e}^{2} {\mathrm e}^{x}-x^{2} {\mathrm e}^{2}-3 x^{2}+30 \,{\mathrm e}^{x}}{x}\) \(37\)
default \(-3 x +x^{3} {\mathrm e}^{2}+\frac {30 \,{\mathrm e}^{x}}{x}-2 \,{\mathrm e}^{2} \left ({\mathrm e}^{x} x -{\mathrm e}^{x}\right )-{\mathrm e}^{2} \left ({\mathrm e}^{x} x^{2}-2 \,{\mathrm e}^{x} x +2 \,{\mathrm e}^{x}\right )-{\mathrm e}^{2} x\) \(56\)
parts \(-3 x +x^{3} {\mathrm e}^{2}+\frac {30 \,{\mathrm e}^{x}}{x}-2 \,{\mathrm e}^{2} \left ({\mathrm e}^{x} x -{\mathrm e}^{x}\right )-{\mathrm e}^{2} \left ({\mathrm e}^{x} x^{2}-2 \,{\mathrm e}^{x} x +2 \,{\mathrm e}^{x}\right )-{\mathrm e}^{2} x\) \(56\)

[In]

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

[Out]

x^3*exp(2)-exp(2)*x-3*x-(x^3*exp(2)-30)/x*exp(x)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

-(3*x^2 - (x^4 - x^2)*e^2 + (x^3*e^2 - 30)*e^x)/x

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

x**3*exp(2) + x*(-exp(2) - 3) + (-x**3*exp(2) + 30)*exp(x)/x

Maxima [C] (verification not implemented)

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

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

(x^4*e^2 - x^3*e^(x + 2) - x^2*e^2 - 3*x^2 + 30*e^x)/x

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

(30*exp(x))/x - x^2*exp(x + 2) - x*(exp(2) + 3) + x^3*exp(2)