\(\int \frac {1}{3} (-6-6 x+e^x (1+x)) \, dx\) [4676]

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.44, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {12, 2207, 2225} \[ \int \frac {1}{3} \left (-6-6 x+e^x (1+x)\right ) \, dx=-x^2-2 x-\frac {e^x}{3}+\frac {1}{3} e^x (x+1) \]

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

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]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.02 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.83

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int \frac {1}{3} \left (-6-6 x+e^x (1+x)\right ) \, dx=-x^{2} + \frac {1}{3} \, x e^{x} - 2 \, x \]

[In]

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

[Out]

-x^2 + 1/3*x*e^x - 2*x

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int \frac {1}{3} \left (-6-6 x+e^x (1+x)\right ) \, dx=-x^{2} + \frac {1}{3} \, x e^{x} - 2 \, x \]

[In]

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

[Out]

-x^2 + 1/3*x*e^x - 2*x

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int \frac {1}{3} \left (-6-6 x+e^x (1+x)\right ) \, dx=-x^{2} + \frac {1}{3} \, x e^{x} - 2 \, x \]

[In]

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

[Out]

-x^2 + 1/3*x*e^x - 2*x

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.67 \[ \int \frac {1}{3} \left (-6-6 x+e^x (1+x)\right ) \, dx=-\frac {x\,\left (3\,x-{\mathrm {e}}^x+6\right )}{3} \]

[In]

int((exp(x)*(x + 1))/3 - 2*x - 2,x)

[Out]

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