3.499 \(\int (-e^{-x}+e^x)^4 \, dx\)

Optimal. Leaf size=36 \[ 6 x-\frac{e^{-4 x}}{4}+2 e^{-2 x}-2 e^{2 x}+\frac{e^{4 x}}{4} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0255405, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {2282, 266, 43} \[ 6 x-\frac{e^{-4 x}}{4}+2 e^{-2 x}-2 e^{2 x}+\frac{e^{4 x}}{4} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

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

Mathematica [A]  time = 0.0209597, size = 34, normalized size = 0.94 \[ \frac{1}{4} \left (24 x-e^{-4 x}+8 e^{-2 x}-8 e^{2 x}+e^{4 x}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(-E^(-4*x) + 8/E^(2*x) - 8*E^(2*x) + E^(4*x) + 24*x)/4

________________________________________________________________________________________

Maple [A]  time = 0.007, size = 31, normalized size = 0.9 \begin{align*}{\frac{ \left ({{\rm e}^{x}} \right ) ^{4}}{4}}-2\, \left ({{\rm e}^{x}} \right ) ^{2}+6\,\ln \left ({{\rm e}^{x}} \right ) -{\frac{1}{4\, \left ({{\rm e}^{x}} \right ) ^{4}}}+2\, \left ({{\rm e}^{x}} \right ) ^{-2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*exp(x)^4-2*exp(x)^2+6*ln(exp(x))-1/4/exp(x)^4+2/exp(x)^2

________________________________________________________________________________________

Maxima [A]  time = 0.929387, size = 38, normalized size = 1.06 \begin{align*} 6 \, x + \frac{1}{4} \, e^{\left (4 \, x\right )} - 2 \, e^{\left (2 \, x\right )} + 2 \, e^{\left (-2 \, x\right )} - \frac{1}{4} \, e^{\left (-4 \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.80387, size = 90, normalized size = 2.5 \begin{align*} \frac{1}{4} \,{\left (24 \, x e^{\left (4 \, x\right )} + e^{\left (8 \, x\right )} - 8 \, e^{\left (6 \, x\right )} + 8 \, e^{\left (2 \, x\right )} - 1\right )} e^{\left (-4 \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(24*x*e^(4*x) + e^(8*x) - 8*e^(6*x) + 8*e^(2*x) - 1)*e^(-4*x)

________________________________________________________________________________________

Sympy [A]  time = 0.137358, size = 31, normalized size = 0.86 \begin{align*} 6 x + \frac{e^{4 x}}{4} - 2 e^{2 x} + 2 e^{- 2 x} - \frac{e^{- 4 x}}{4} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.06391, size = 49, normalized size = 1.36 \begin{align*} -\frac{1}{4} \,{\left (18 \, e^{\left (4 \, x\right )} - 8 \, e^{\left (2 \, x\right )} + 1\right )} e^{\left (-4 \, x\right )} + 6 \, x + \frac{1}{4} \, e^{\left (4 \, x\right )} - 2 \, e^{\left (2 \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*(18*e^(4*x) - 8*e^(2*x) + 1)*e^(-4*x) + 6*x + 1/4*e^(4*x) - 2*e^(2*x)