\(\int (-e^{-x}+e^x)^3 \, dx\) [498]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 31 \[ \int \left (-e^{-x}+e^x\right )^3 \, dx=\frac {e^{-3 x}}{3}-3 e^{-x}-3 e^x+\frac {e^{3 x}}{3} \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2320, 276} \[ \int \left (-e^{-x}+e^x\right )^3 \, dx=\frac {e^{-3 x}}{3}-3 e^{-x}-3 e^x+\frac {e^{3 x}}{3} \]

[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 276

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]

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*} \text {integral}& = \text {Subst}\left (\int \frac {\left (-1+x^2\right )^3}{x^4} \, dx,x,e^x\right ) \\ & = \text {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] (verified)

Time = 0.03 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.97 \[ \int \left (-e^{-x}+e^x\right )^3 \, dx=\frac {1}{3} e^{-3 x} \left (1-9 e^{2 x}-9 e^{4 x}+e^{6 x}\right ) \]

[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] (verified)

Time = 0.05 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.77

method result size
derivativedivides \(\frac {{\mathrm e}^{3 x}}{3}-3 \,{\mathrm e}^{x}-3 \,{\mathrm e}^{-x}+\frac {{\mathrm e}^{-3 x}}{3}\) \(24\)
default \(\frac {{\mathrm e}^{3 x}}{3}-3 \,{\mathrm e}^{x}-3 \,{\mathrm e}^{-x}+\frac {{\mathrm e}^{-3 x}}{3}\) \(24\)
risch \(\frac {{\mathrm e}^{3 x}}{3}-3 \,{\mathrm e}^{x}-3 \,{\mathrm e}^{-x}+\frac {{\mathrm e}^{-3 x}}{3}\) \(24\)
parts \(\frac {{\mathrm e}^{3 x}}{3}-3 \,{\mathrm e}^{x}-3 \,{\mathrm e}^{-x}+\frac {{\mathrm e}^{-3 x}}{3}\) \(24\)
meijerg \(\frac {16}{3}+\frac {{\mathrm e}^{-3 x}}{3}-3 \,{\mathrm e}^{-x}-3 \,{\mathrm e}^{x}+\frac {{\mathrm e}^{3 x}}{3}\) \(25\)
norman \(\left (\frac {1}{3}-3 \,{\mathrm e}^{2 x}-3 \,{\mathrm e}^{4 x}+\frac {{\mathrm e}^{6 x}}{3}\right ) {\mathrm e}^{-3 x}\) \(26\)
parallelrisch \(-\frac {\left (-{\mathrm e}^{6 x}-1+9 \,{\mathrm e}^{4 x}+9 \,{\mathrm e}^{2 x}\right ) {\mathrm e}^{-3 x}}{3}\) \(27\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.77 \[ \int \left (-e^{-x}+e^x\right )^3 \, dx=\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 )} \]

[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] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.77 \[ \int \left (-e^{-x}+e^x\right )^3 \, dx=\frac {e^{3 x}}{3} - 3 e^{x} - 3 e^{- x} + \frac {e^{- 3 x}}{3} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.74 \[ \int \left (-e^{-x}+e^x\right )^3 \, dx=\frac {1}{3} \, e^{\left (3 \, x\right )} - 3 \, e^{\left (-x\right )} + \frac {1}{3} \, e^{\left (-3 \, x\right )} - 3 \, e^{x} \]

[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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.81 \[ \int \left (-e^{-x}+e^x\right )^3 \, dx=-\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} \]

[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

Mupad [B] (verification not implemented)

Time = 0.35 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.74 \[ \int \left (-e^{-x}+e^x\right )^3 \, dx=\frac {{\mathrm {e}}^{-3\,x}}{3}-3\,{\mathrm {e}}^{-x}+\frac {{\mathrm {e}}^{3\,x}}{3}-3\,{\mathrm {e}}^x \]

[In]

int(-(exp(-x) - exp(x))^3,x)

[Out]

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