3.1.14 \(\int (e^x+x)^2 \, dx\) [14]

Optimal. Leaf size=28 \[ -2 e^x+\frac {e^{2 x}}{2}+2 e^x x+\frac {x^3}{3} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {6874, 2225, 2207} \begin {gather*} \frac {x^3}{3}+2 e^x x-2 e^x+\frac {e^{2 x}}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 26, normalized size = 0.93 \begin {gather*} \frac {e^{2 x}}{2}+\frac {x^3}{3}+e^x (-2+2 x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Mathics [A]
time = 1.92, size = 21, normalized size = 0.75 \begin {gather*} \frac {x^3}{3}+\frac {E^{2 x}}{2}+2 \left (-1+x\right ) E^x \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[(x + E^x)^2,x]')

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 22, normalized size = 0.79

method result size
risch \(\frac {x^{3}}{3}+\left (2 x -2\right ) {\mathrm e}^{x}+\frac {{\mathrm e}^{2 x}}{2}\) \(21\)
default \(-2 \,{\mathrm e}^{x}+\frac {{\mathrm e}^{2 x}}{2}+2 \,{\mathrm e}^{x} x +\frac {x^{3}}{3}\) \(22\)
norman \(-2 \,{\mathrm e}^{x}+\frac {{\mathrm e}^{2 x}}{2}+2 \,{\mathrm e}^{x} x +\frac {x^{3}}{3}\) \(22\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.31, size = 19, normalized size = 0.68 \begin {gather*} \frac {1}{3} \, x^{3} + 2 \, {\left (x - 1\right )} e^{x} + \frac {1}{2} \, e^{\left (2 \, x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.30, size = 19, normalized size = 0.68 \begin {gather*} \frac {1}{3} \, x^{3} + 2 \, {\left (x - 1\right )} e^{x} + \frac {1}{2} \, e^{\left (2 \, x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.05, size = 20, normalized size = 0.71 \begin {gather*} \frac {x^{3}}{3} + \frac {\left (4 x - 4\right ) e^{x}}{2} + \frac {e^{2 x}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 23, normalized size = 0.82 \begin {gather*} \frac {1}{3} x^{3}+\left (2 x-2\right ) \mathrm {e}^{x}+\frac {\mathrm {e}^{2 x}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x+exp(x))^2,x)

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.05, size = 21, normalized size = 0.75 \begin {gather*} \frac {{\mathrm {e}}^{2\,x}}{2}-2\,{\mathrm {e}}^x+2\,x\,{\mathrm {e}}^x+\frac {x^3}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________