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

   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 = 52, antiderivative size = 30 \[ \int \frac {e^{3/x} (-3+x)-17 x+6 x^2+e^x \left (-12 x-12 x^2\right )+e^{2 x} \left (-2 x-4 x^2\right )}{x} \, dx=-\left (\left (-1-e^{3/x}+2 \left (\left (3+e^x\right )^2-x\right )-x\right ) x\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.60, number of steps used = 9, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {14, 2207, 2225, 2326} \[ \int \frac {e^{3/x} (-3+x)-17 x+6 x^2+e^x \left (-12 x-12 x^2\right )+e^{2 x} \left (-2 x-4 x^2\right )}{x} \, dx=3 x^2+e^{3/x} x-17 x+12 e^x+e^{2 x}-12 e^x (x+1)-e^{2 x} (2 x+1) \]

[In]

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

[Out]

12*E^x + E^(2*x) - 17*x + E^(3/x)*x + 3*x^2 - 12*E^x*(1 + x) - E^(2*x)*(1 + 2*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 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 2326

Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = v*(y/(Log[F]*D[u, x]))}, Simp[F^u*z, x] /; EqQ[D[z,
x], w*y]] /; FreeQ[F, x]

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

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.07 \[ \int \frac {e^{3/x} (-3+x)-17 x+6 x^2+e^x \left (-12 x-12 x^2\right )+e^{2 x} \left (-2 x-4 x^2\right )}{x} \, dx=-17 x+e^{3/x} x-12 e^x x-2 e^{2 x} x+3 x^2 \]

[In]

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

[Out]

-17*x + E^(3/x)*x - 12*E^x*x - 2*E^(2*x)*x + 3*x^2

Maple [A] (verified)

Time = 0.95 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00

method result size
default \(x \,{\mathrm e}^{\frac {3}{x}}-17 x +3 x^{2}-2 x \,{\mathrm e}^{2 x}-12 \,{\mathrm e}^{x} x\) \(30\)
norman \(x \,{\mathrm e}^{\frac {3}{x}}-17 x +3 x^{2}-2 x \,{\mathrm e}^{2 x}-12 \,{\mathrm e}^{x} x\) \(30\)
risch \(x \,{\mathrm e}^{\frac {3}{x}}-17 x +3 x^{2}-2 x \,{\mathrm e}^{2 x}-12 \,{\mathrm e}^{x} x\) \(30\)
parallelrisch \(x \,{\mathrm e}^{\frac {3}{x}}-17 x +3 x^{2}-2 x \,{\mathrm e}^{2 x}-12 \,{\mathrm e}^{x} x\) \(30\)
parts \(x \,{\mathrm e}^{\frac {3}{x}}-17 x +3 x^{2}-2 x \,{\mathrm e}^{2 x}-12 \,{\mathrm e}^{x} x\) \(30\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.97 \[ \int \frac {e^{3/x} (-3+x)-17 x+6 x^2+e^x \left (-12 x-12 x^2\right )+e^{2 x} \left (-2 x-4 x^2\right )}{x} \, dx=3 x^{2} + x e^{\frac {3}{x}} - 2 x e^{2 x} - 12 x e^{x} - 17 x \]

[In]

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

[Out]

3*x**2 + x*exp(3/x) - 2*x*exp(2*x) - 12*x*exp(x) - 17*x

Maxima [C] (verification not implemented)

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

Time = 0.22 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.80 \[ \int \frac {e^{3/x} (-3+x)-17 x+6 x^2+e^x \left (-12 x-12 x^2\right )+e^{2 x} \left (-2 x-4 x^2\right )}{x} \, dx=3 \, x^{2} - {\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} - 12 \, {\left (x - 1\right )} e^{x} - 17 \, x + 3 \, {\rm Ei}\left (\frac {3}{x}\right ) - e^{\left (2 \, x\right )} - 12 \, e^{x} - 3 \, \Gamma \left (-1, -\frac {3}{x}\right ) \]

[In]

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

[Out]

3*x^2 - (2*x - 1)*e^(2*x) - 12*(x - 1)*e^x - 17*x + 3*Ei(3/x) - e^(2*x) - 12*e^x - 3*gamma(-1, -3/x)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 8.94 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.87 \[ \int \frac {e^{3/x} (-3+x)-17 x+6 x^2+e^x \left (-12 x-12 x^2\right )+e^{2 x} \left (-2 x-4 x^2\right )}{x} \, dx=-x\,\left (2\,{\mathrm {e}}^{2\,x}-3\,x-{\mathrm {e}}^{3/x}+12\,{\mathrm {e}}^x+17\right ) \]

[In]

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

[Out]

-x*(2*exp(2*x) - 3*x - exp(3/x) + 12*exp(x) + 17)