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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0493072, antiderivative size = 31, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.077, Rules used = {2282, 14} \[ -x+\frac{e^{-2 x}}{2}+\frac{e^{2 x}}{2}+\frac{e^{4 x}}{4} \]

Antiderivative was successfully verified.

[In]

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

[Out]

1/(2*E^(2*x)) + E^(2*x)/2 + E^(4*x)/4 - 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 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 ) \left (e^{-x}+e^x\right )^2 \, dx &=\operatorname{Subst}\left (\int \frac{-1-\frac{1}{x^2}+x^2+x^4}{x} \, dx,x,e^x\right )\\ &=\operatorname{Subst}\left (\int \left (-\frac{1}{x^3}-\frac{1}{x}+x+x^3\right ) \, dx,x,e^x\right )\\ &=\frac{e^{-2 x}}{2}+\frac{e^{2 x}}{2}+\frac{e^{4 x}}{4}-x\\ \end{align*}

Mathematica [A]  time = 0.0082503, size = 31, normalized size = 1. \[ -x+\frac{e^{-2 x}}{2}+\frac{e^{2 x}}{2}+\frac{e^{4 x}}{4} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.02, size = 23, normalized size = 0.7 \begin{align*} -x+{\frac{ \left ({{\rm e}^{x}} \right ) ^{2}}{2}}+{\frac{ \left ({{\rm e}^{x}} \right ) ^{4}}{4}}+{\frac{1}{2\, \left ({{\rm e}^{x}} \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.117177, size = 22, normalized size = 0.71 \begin{align*} - x + \frac{e^{4 x}}{4} + \frac{e^{2 x}}{2} + \frac{e^{- 2 x}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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