3.498 \(\int (-e^{-x}+e^x)^3 \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.019334, antiderivative size = 31, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {2282, 270} \[ \frac{e^{-3 x}}{3}-3 e^{-x}-3 e^x+\frac{e^{3 x}}{3} \]

Antiderivative was successfully verified.

[In]

Int[(-E^(-x) + E^x)^3,x]

[Out]

1/(3*E^(3*x)) - 3/E^x - 3*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 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rubi steps

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

Mathematica [A]  time = 0.0131351, size = 30, normalized size = 0.97 \[ \frac{1}{3} e^{-3 x} \left (-9 e^{2 x}-9 e^{4 x}+e^{6 x}+1\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(-E^(-x) + E^x)^3,x]

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-1/exp(x)+exp(x))^3,x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.922947, size = 31, normalized size = 1. \begin{align*} \frac{1}{3} \, e^{\left (3 \, x\right )} - 3 \, e^{\left (-x\right )} + \frac{1}{3} \, e^{\left (-3 \, x\right )} - 3 \, e^{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.73138, size = 70, normalized size = 2.26 \begin{align*} \frac{1}{3} \,{\left (e^{\left (6 \, x\right )} - 9 \, e^{\left (4 \, x\right )} - 9 \, e^{\left (2 \, x\right )} + 1\right )} e^{\left (-3 \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.126128, size = 24, normalized size = 0.77 \begin{align*} \frac{e^{3 x}}{3} - 3 e^{x} - 3 e^{- x} + \frac{e^{- 3 x}}{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.06519, size = 34, normalized size = 1.1 \begin{align*} -\frac{1}{3} \,{\left (9 \, e^{\left (2 \, x\right )} - 1\right )} e^{\left (-3 \, x\right )} + \frac{1}{3} \, e^{\left (3 \, x\right )} - 3 \, e^{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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