3.5.100 \(\int (-e^{-x}+e^x)^n \, dx\) [500]

Optimal. Leaf size=48 \[ -\frac {\left (-e^{-x}+e^x\right )^n \left (1-e^{2 x}\right ) \, _2F_1\left (1,\frac {2+n}{2};1-\frac {n}{2};e^{2 x}\right )}{n} \]

[Out]

-(-1/exp(x)+exp(x))^n*(1-exp(2*x))*hypergeom([1, 1+1/2*n],[1-1/2*n],exp(2*x))/n

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 52, normalized size of antiderivative = 1.08, number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {2320, 2057, 372, 371} \begin {gather*} -\frac {\left (e^x-e^{-x}\right )^n \left (1-e^{2 x}\right )^{-n} \text {Hypergeometric2F1}\left (-n,-\frac {n}{2},1-\frac {n}{2},e^{2 x}\right )}{n} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-(((-E^(-x) + E^x)^n*Hypergeometric2F1[-n, -1/2*n, 1 - n/2, E^(2*x)])/((1 - E^(2*x))^n*n))

Rule 371

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*((c*x)^(m + 1)/(c*(m + 1)))*Hyperg
eometric2F1[-p, (m + 1)/n, (m + 1)/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 372

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[a^IntPart[p]*((a + b*x^n)^FracPart[p]/
(1 + b*(x^n/a))^FracPart[p]), Int[(c*x)^m*(1 + b*(x^n/a))^p, x], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[
p, 0] &&  !(ILtQ[p, 0] || GtQ[a, 0])

Rule 2057

Int[((c_.)*(x_))^(m_.)*((a_.)*(x_)^(j_.) + (b_.)*(x_)^(n_.))^(p_), x_Symbol] :> Dist[c^IntPart[m]*(c*x)^FracPa
rt[m]*((a*x^j + b*x^n)^FracPart[p]/(x^(FracPart[m] + j*FracPart[p])*(a + b*x^(n - j))^FracPart[p])), Int[x^(m
+ j*p)*(a + b*x^(n - j))^p, x], x] /; FreeQ[{a, b, c, j, m, n, p}, x] &&  !IntegerQ[p] && NeQ[n, j] && PosQ[n
- j]

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*} \int \left (-e^{-x}+e^x\right )^n \, dx &=\text {Subst}\left (\int \frac {\left (-\frac {1}{x}+x\right )^n}{x} \, dx,x,e^x\right )\\ &=\left (\left (e^x\right )^n \left (-e^{-x}+e^x\right )^n \left (-1+e^{2 x}\right )^{-n}\right ) \text {Subst}\left (\int x^{-1-n} \left (-1+x^2\right )^n \, dx,x,e^x\right )\\ &=\left (\left (e^x\right )^n \left (-e^{-x}+e^x\right )^n \left (1-e^{2 x}\right )^{-n}\right ) \text {Subst}\left (\int x^{-1-n} \left (1-x^2\right )^n \, dx,x,e^x\right )\\ &=-\frac {\left (-e^{-x}+e^x\right )^n \left (1-e^{2 x}\right )^{-n} \, _2F_1\left (-n,-\frac {n}{2};1-\frac {n}{2};e^{2 x}\right )}{n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 45, normalized size = 0.94 \begin {gather*} \frac {\left (-e^{-x}+e^x\right )^n \left (-1+e^{2 x}\right ) \, _2F_1\left (1,1+\frac {n}{2};1-\frac {n}{2};e^{2 x}\right )}{n} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

((-E^(-x) + E^x)^n*(-1 + E^(2*x))*Hypergeometric2F1[1, 1 + n/2, 1 - n/2, E^(2*x)])/n

________________________________________________________________________________________

Maple [F]
time = 0.01, size = 0, normalized size = 0.00 \[\int \left (-{\mathrm e}^{-x}+{\mathrm e}^{x}\right )^{n}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate((-e^(-x) + e^x)^n, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integral((-e^(-x) + e^x)^n, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (e^{x} - e^{- x}\right )^{n}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral((exp(x) - exp(-x))**n, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate((-e^(-x) + e^x)^n, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int {\left ({\mathrm {e}}^x-{\mathrm {e}}^{-x}\right )}^n \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________