\(\int (12-2 e^{2 x}-2 x+2 e^x x) \, dx\) [6349]

   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 = 18, antiderivative size = 23 \[ \int \left (12-2 e^{2 x}-2 x+2 e^x x\right ) \, dx=-4+10 x-\left (-1-e^x+x\right )^2-2 \log (2)+\log (3) \]

[Out]

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

Rubi [A] (verified)

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

[In]

Int[12 - 2*E^(2*x) - 2*x + 2*E^x*x,x]

[Out]

-2*E^x - E^(2*x) + 12*x + 2*E^x*x - x^2

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}& = 12 x-x^2-2 \int e^{2 x} \, dx+2 \int e^x x \, dx \\ & = -e^{2 x}+12 x+2 e^x x-x^2-2 \int e^x \, dx \\ & = -2 e^x-e^{2 x}+12 x+2 e^x x-x^2 \\ \end{align*}

Mathematica [A] (verified)

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

[In]

Integrate[12 - 2*E^(2*x) - 2*x + 2*E^x*x,x]

[Out]

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

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00

method result size
risch \(-{\mathrm e}^{2 x}+2 \left (-1+x \right ) {\mathrm e}^{x}-x^{2}+12 x\) \(23\)
default \(2 \,{\mathrm e}^{x} x -x^{2}-2 \,{\mathrm e}^{x}-{\mathrm e}^{2 x}+12 x\) \(25\)
norman \(2 \,{\mathrm e}^{x} x -x^{2}-2 \,{\mathrm e}^{x}-{\mathrm e}^{2 x}+12 x\) \(25\)
parallelrisch \(2 \,{\mathrm e}^{x} x -x^{2}-2 \,{\mathrm e}^{x}-{\mathrm e}^{2 x}+12 x\) \(25\)
parts \(2 \,{\mathrm e}^{x} x -x^{2}-2 \,{\mathrm e}^{x}-{\mathrm e}^{2 x}+12 x\) \(25\)

[In]

int(-2*exp(x)^2+2*exp(x)*x-2*x+12,x,method=_RETURNVERBOSE)

[Out]

-exp(2*x)+2*(-1+x)*exp(x)-x^2+12*x

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.96 \[ \int \left (12-2 e^{2 x}-2 x+2 e^x x\right ) \, dx=-x^{2} + 2 \, {\left (x - 1\right )} e^{x} + 12 \, x - e^{\left (2 \, x\right )} \]

[In]

integrate(-2*exp(x)^2+2*exp(x)*x-2*x+12,x, algorithm="fricas")

[Out]

-x^2 + 2*(x - 1)*e^x + 12*x - e^(2*x)

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.83 \[ \int \left (12-2 e^{2 x}-2 x+2 e^x x\right ) \, dx=- x^{2} + 12 x + \left (2 x - 2\right ) e^{x} - e^{2 x} \]

[In]

integrate(-2*exp(x)**2+2*exp(x)*x-2*x+12,x)

[Out]

-x**2 + 12*x + (2*x - 2)*exp(x) - exp(2*x)

Maxima [A] (verification not implemented)

none

Time = 0.17 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.96 \[ \int \left (12-2 e^{2 x}-2 x+2 e^x x\right ) \, dx=-x^{2} + 2 \, {\left (x - 1\right )} e^{x} + 12 \, x - e^{\left (2 \, x\right )} \]

[In]

integrate(-2*exp(x)^2+2*exp(x)*x-2*x+12,x, algorithm="maxima")

[Out]

-x^2 + 2*(x - 1)*e^x + 12*x - e^(2*x)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.96 \[ \int \left (12-2 e^{2 x}-2 x+2 e^x x\right ) \, dx=-x^{2} + 2 \, {\left (x - 1\right )} e^{x} + 12 \, x - e^{\left (2 \, x\right )} \]

[In]

integrate(-2*exp(x)^2+2*exp(x)*x-2*x+12,x, algorithm="giac")

[Out]

-x^2 + 2*(x - 1)*e^x + 12*x - e^(2*x)

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.04 \[ \int \left (12-2 e^{2 x}-2 x+2 e^x x\right ) \, dx=12\,x-{\mathrm {e}}^{2\,x}-2\,{\mathrm {e}}^x+2\,x\,{\mathrm {e}}^x-x^2 \]

[In]

int(2*x*exp(x) - 2*exp(2*x) - 2*x + 12,x)

[Out]

12*x - exp(2*x) - 2*exp(x) + 2*x*exp(x) - x^2