3.60 \(\int (1+e^x)^2 x \, dx\)

Optimal. Leaf size=38 \[ \frac {x^2}{2}+2 e^x x+\frac {1}{2} e^{2 x} x-2 e^x-\frac {e^{2 x}}{4} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2183, 2176, 2194} \[ \frac {x^2}{2}+2 e^x x+\frac {1}{2} e^{2 x} x-2 e^x-\frac {e^{2 x}}{4} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2176

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] &&  !$UseGamma === True

Rule 2183

Int[((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.))^(p_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> In
t[ExpandIntegrand[(c + d*x)^m, (a + b*(F^(g*(e + f*x)))^n)^p, x], x] /; FreeQ[{F, a, b, c, d, e, f, g, m, n},
x] && IGtQ[p, 0]

Rule 2194

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 29, normalized size = 0.76 \[ \frac {1}{4} \left (2 x^2+8 e^x (x-1)+e^{2 x} (2 x-1)\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(8*E^x*(-1 + x) + 2*x^2 + E^(2*x)*(-1 + 2*x))/4

________________________________________________________________________________________

fricas [A]  time = 0.40, size = 24, normalized size = 0.63 \[ \frac {1}{2} \, x^{2} + \frac {1}{4} \, {\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} + 2 \, {\left (x - 1\right )} e^{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2 + 1/4*(2*x - 1)*e^(2*x) + 2*(x - 1)*e^x

________________________________________________________________________________________

giac [A]  time = 0.95, size = 24, normalized size = 0.63 \[ \frac {1}{2} \, x^{2} + \frac {1}{4} \, {\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} + 2 \, {\left (x - 1\right )} e^{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2 + 1/4*(2*x - 1)*e^(2*x) + 2*(x - 1)*e^x

________________________________________________________________________________________

maple [A]  time = 0.00, size = 29, normalized size = 0.76 \[ \frac {x^{2}}{2}+2 x \,{\mathrm e}^{x}+\frac {x \,{\mathrm e}^{2 x}}{2}-2 \,{\mathrm e}^{x}-\frac {{\mathrm e}^{2 x}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((exp(x)+1)^2*x,x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.62, size = 24, normalized size = 0.63 \[ \frac {1}{2} \, x^{2} + \frac {1}{4} \, {\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} + 2 \, {\left (x - 1\right )} e^{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2 + 1/4*(2*x - 1)*e^(2*x) + 2*(x - 1)*e^x

________________________________________________________________________________________

mupad [B]  time = 0.16, size = 28, normalized size = 0.74 \[ \frac {x\,{\mathrm {e}}^{2\,x}}{2}-2\,{\mathrm {e}}^x-\frac {{\mathrm {e}}^{2\,x}}{4}+2\,x\,{\mathrm {e}}^x+\frac {x^2}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(exp(x) + 1)^2,x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.09, size = 26, normalized size = 0.68 \[ \frac {x^{2}}{2} + \frac {\left (2 x - 1\right ) e^{2 x}}{4} + \frac {\left (8 x - 8\right ) e^{x}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+exp(x))**2*x,x)

[Out]

x**2/2 + (2*x - 1)*exp(2*x)/4 + (8*x - 8)*exp(x)/4

________________________________________________________________________________________