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

3.5.97.1 Optimal result
3.5.97.2 Mathematica [A] (verified)
3.5.97.3 Rubi [A] (warning: unable to verify)
3.5.97.4 Maple [A] (verified)
3.5.97.5 Fricas [A] (verification not implemented)
3.5.97.6 Sympy [A] (verification not implemented)
3.5.97.7 Maxima [A] (verification not implemented)
3.5.97.8 Giac [A] (verification not implemented)
3.5.97.9 Mupad [B] (verification not implemented)
3.5.97.10 Reduce [B] (verification not implemented)

3.5.97.1 Optimal result

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

output
-1/2/exp(2*x)+1/2*exp(2*x)-2*x
 
3.5.97.2 Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00 \[ \int \left (-e^{-x}+e^x\right )^2 \, dx=-\frac {1}{2} e^{-2 x}+\frac {e^{2 x}}{2}-2 x \]

input
Integrate[(-E^(-x) + E^x)^2,x]
 
output
-1/2*1/E^(2*x) + E^(2*x)/2 - 2*x
 
3.5.97.3 Rubi [A] (warning: unable to verify)

Time = 0.17 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.14, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {2720, 243, 49, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \left (e^x-e^{-x}\right )^2 \, dx\)

\(\Big \downarrow \) 2720

\(\displaystyle \int e^{-3 x} \left (1-e^{2 x}\right )^2de^x\)

\(\Big \downarrow \) 243

\(\displaystyle \frac {1}{2} \int e^{-2 x} \left (1-e^{2 x}\right )^2de^{2 x}\)

\(\Big \downarrow \) 49

\(\displaystyle \frac {1}{2} \int \left (1+e^{-2 x}-2 e^{-x}\right )de^{2 x}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{2} \left (-e^{-x}+e^{2 x}-2 \log \left (e^{2 x}\right )\right )\)

input
Int[(-E^(-x) + E^x)^2,x]
 
output
(-E^(-x) + E^(2*x) - 2*Log[E^(2*x)])/2
 

3.5.97.3.1 Defintions of rubi rules used

rule 49
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}, x] 
&& IGtQ[m, 0] && IGtQ[m + n + 2, 0]
 

rule 243
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[1/2   Subst[In 
t[x^((m - 1)/2)*(a + b*x)^p, x], x, x^2], x] /; FreeQ[{a, b, m, p}, x] && I 
ntegerQ[(m - 1)/2]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2720
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Simp[v/D[v, x] 
   Subst[Int[FunctionOfExponentialFunction[u, x]/x, x], x, v], x]] /; Funct 
ionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; FreeQ 
[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x)) 
*(F_)[v_] /; FreeQ[{a, b, c}, x] && InverseFunctionQ[F[x]]]
 
3.5.97.4 Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.77

method result size
risch \(-2 x +\frac {{\mathrm e}^{2 x}}{2}-\frac {{\mathrm e}^{-2 x}}{2}\) \(17\)
parts \(-2 x +\frac {{\mathrm e}^{2 x}}{2}-\frac {{\mathrm e}^{-2 x}}{2}\) \(17\)
derivativedivides \(\frac {{\mathrm e}^{2 x}}{2}-\frac {{\mathrm e}^{-2 x}}{2}-2 \ln \left ({\mathrm e}^{x}\right )\) \(19\)
default \(\frac {{\mathrm e}^{2 x}}{2}-\frac {{\mathrm e}^{-2 x}}{2}-2 \ln \left ({\mathrm e}^{x}\right )\) \(19\)
parallelrisch \(\frac {\left (-1+{\mathrm e}^{4 x}-4 \,{\mathrm e}^{2 x} x \right ) {\mathrm e}^{-2 x}}{2}\) \(20\)
norman \(\left (-\frac {1}{2}+\frac {{\mathrm e}^{4 x}}{2}-2 \,{\mathrm e}^{2 x} x \right ) {\mathrm e}^{-2 x}\) \(21\)

input
int((-1/exp(x)+exp(x))^2,x,method=_RETURNVERBOSE)
 
output
-2*x+1/2*exp(2*x)-1/2*exp(-2*x)
 
3.5.97.5 Fricas [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.95 \[ \int \left (-e^{-x}+e^x\right )^2 \, dx=-\frac {1}{2} \, {\left (4 \, x e^{\left (2 \, x\right )} - e^{\left (4 \, x\right )} + 1\right )} e^{\left (-2 \, x\right )} \]

input
integrate((-1/exp(x)+exp(x))^2,x, algorithm="fricas")
 
output
-1/2*(4*x*e^(2*x) - e^(4*x) + 1)*e^(-2*x)
 
3.5.97.6 Sympy [A] (verification not implemented)

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

input
integrate((-1/exp(x)+exp(x))**2,x)
 
output
-2*x + exp(2*x)/2 - exp(-2*x)/2
 
3.5.97.7 Maxima [A] (verification not implemented)

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

input
integrate((-1/exp(x)+exp(x))^2,x, algorithm="maxima")
 
output
-2*x + 1/2*e^(2*x) - 1/2*e^(-2*x)
 
3.5.97.8 Giac [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.09 \[ \int \left (-e^{-x}+e^x\right )^2 \, dx=\frac {1}{2} \, {\left (2 \, e^{\left (2 \, x\right )} - 1\right )} e^{\left (-2 \, x\right )} - 2 \, x + \frac {1}{2} \, e^{\left (2 \, x\right )} \]

input
integrate((-1/exp(x)+exp(x))^2,x, algorithm="giac")
 
output
1/2*(2*e^(2*x) - 1)*e^(-2*x) - 2*x + 1/2*e^(2*x)
 
3.5.97.9 Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.36 \[ \int \left (-e^{-x}+e^x\right )^2 \, dx=\mathrm {sinh}\left (2\,x\right )-2\,x \]

input
int((exp(-x) - exp(x))^2,x)
 
output
sinh(2*x) - 2*x
 
3.5.97.10 Reduce [B] (verification not implemented)

Time = 0.00 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.09 \[ \int \left (-e^{-x}+e^x\right )^2 \, dx=\frac {e^{4 x}-4 e^{2 x} x -1}{2 e^{2 x}} \]

input
int((e**(4*x) - 2*e**(2*x) + 1)/e**(2*x),x)
 
output
(e**(4*x) - 4*e**(2*x)*x - 1)/(2*e**(2*x))