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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 22, normalized size of antiderivative = 1.00, 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 = {2320, 14} \begin {gather*} -e^{-x}-2 e^x+\frac {e^{3 x}}{3} \end {gather*}

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 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]]

Rule 2320

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]]]

Rubi steps

\begin {align*} \int e^x \left (-e^{-x}+e^x\right )^2 \, dx &=\text {Subst}\left (\int \frac {\frac {1}{x}-2 x+x^3}{x} \, dx,x,e^x\right )\\ &=\text {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.02, size = 23, normalized size = 1.05 \begin {gather*} \frac {1}{3} e^{-x} \left (-3-6 e^{2 x}+e^{4 x}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 18, normalized size = 0.82

method result size
derivativedivides \(\frac {{\mathrm e}^{3 x}}{3}-2 \,{\mathrm e}^{x}-{\mathrm e}^{-x}\) \(18\)
default \(\frac {{\mathrm e}^{3 x}}{3}-2 \,{\mathrm e}^{x}-{\mathrm e}^{-x}\) \(18\)
risch \(\frac {{\mathrm e}^{3 x}}{3}-2 \,{\mathrm e}^{x}-{\mathrm e}^{-x}\) \(18\)
meijerg \(\frac {8}{3}-{\mathrm e}^{-x}-2 \,{\mathrm e}^{x}+\frac {{\mathrm e}^{3 x}}{3}\) \(19\)
norman \(\left (-2 \,{\mathrm e}^{3 x}+\frac {{\mathrm e}^{5 x}}{3}-{\mathrm e}^{x}\right ) {\mathrm e}^{-2 x}\) \(23\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 21, normalized size = 0.95 \begin {gather*} -\frac {1}{3} \, {\left (6 \, e^{\left (-2 \, x\right )} - 1\right )} e^{\left (3 \, x\right )} - e^{\left (-x\right )} \end {gather*}

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.36, size = 18, normalized size = 0.82 \begin {gather*} \frac {1}{3} \, {\left (e^{\left (4 \, x\right )} - 6 \, e^{\left (2 \, x\right )} - 3\right )} e^{\left (-x\right )} \end {gather*}

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.04, size = 15, normalized size = 0.68 \begin {gather*} \frac {e^{3 x}}{3} - 2 e^{x} - e^{- x} \end {gather*}

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 = 3.76, size = 17, normalized size = 0.77 \begin {gather*} \frac {1}{3} \, e^{\left (3 \, x\right )} - e^{\left (-x\right )} - 2 \, e^{x} \end {gather*}

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

________________________________________________________________________________________

Mupad [B]
time = 0.06, size = 17, normalized size = 0.77 \begin {gather*} \frac {{\mathrm {e}}^{3\,x}}{3}-{\mathrm {e}}^{-x}-2\,{\mathrm {e}}^x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(x)*(exp(-x) - exp(x))^2,x)

[Out]

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

________________________________________________________________________________________