3.722 \(\int e^x (-e^{-x}+e^x)^2 \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0277052, antiderivative size = 22, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.118, Rules used = {2282, 14} \[ -e^{-x}-2 e^x+\frac{e^{3 x}}{3} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[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]]

Rubi steps

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

Mathematica [A]  time = 0.007386, size = 22, normalized size = 1. \[ -e^{-x}-2 e^x+\frac{e^{3 x}}{3} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.023, size = 18, normalized size = 0.8 \begin{align*}{\frac{ \left ({{\rm e}^{x}} \right ) ^{3}}{3}}-2\,{{\rm e}^{x}}- \left ({{\rm e}^{x}} \right ) ^{-1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.967162, size = 28, normalized size = 1.27 \begin{align*} -\frac{1}{3} \,{\left (6 \, e^{\left (-2 \, x\right )} - 1\right )} e^{\left (3 \, x\right )} - e^{\left (-x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 0.842875, size = 51, normalized size = 2.32 \begin{align*} \frac{1}{3} \,{\left (e^{\left (4 \, x\right )} - 6 \, e^{\left (2 \, x\right )} - 3\right )} e^{\left (-x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/3*(e^(4*x) - 6*e^(2*x) - 3)*e^(-x)

________________________________________________________________________________________

Sympy [A]  time = 0.110703, size = 15, normalized size = 0.68 \begin{align*} \frac{e^{3 x}}{3} - 2 e^{x} - e^{- x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.30317, size = 23, normalized size = 1.05 \begin{align*} \frac{1}{3} \, e^{\left (3 \, x\right )} - e^{\left (-x\right )} - 2 \, e^{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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