3.682 $$\int (-\cosh (x)+\text{sech}(x))^3 \, dx$$

Optimal. Leaf size=34 $-\frac{5 \sinh ^3(x)}{6}+\frac{5 \sinh (x)}{2}+\frac{1}{2} \sinh ^3(x) \tanh ^2(x)-\frac{5}{2} \tan ^{-1}(\sinh (x))$

[Out]

(-5*ArcTan[Sinh[x]])/2 + (5*Sinh[x])/2 - (5*Sinh[x]^3)/6 + (Sinh[x]^3*Tanh[x]^2)/2

________________________________________________________________________________________

Rubi [A]  time = 0.0475908, antiderivative size = 34, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 9, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.556, Rules used = {4397, 2592, 288, 302, 203} $-\frac{5 \sinh ^3(x)}{6}+\frac{5 \sinh (x)}{2}+\frac{1}{2} \sinh ^3(x) \tanh ^2(x)-\frac{5}{2} \tan ^{-1}(\sinh (x))$

Antiderivative was successfully veriﬁed.

[In]

Int[(-Cosh[x] + Sech[x])^3,x]

[Out]

(-5*ArcTan[Sinh[x]])/2 + (5*Sinh[x])/2 - (5*Sinh[x]^3)/6 + (Sinh[x]^3*Tanh[x]^2)/2

Rule 4397

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rule 2592

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, (a*Sin[e + f*x])/ff
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 288

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

Rule 302

Int[(x_)^(m_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^n, x], x] /; FreeQ[{a,
b}, x] && IGtQ[m, 0] && IGtQ[n, 0] && GtQ[m, 2*n - 1]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

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

Mathematica [A]  time = 0.0281505, size = 37, normalized size = 1.09 $-\frac{1}{48} \text{sech}^2(x) \left (-50 \sinh (x)-25 \sinh (3 x)+\sinh (5 x)+60 \tan ^{-1}(\sinh (x))+60 \cosh (2 x) \tan ^{-1}(\sinh (x))\right )$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(-Cosh[x] + Sech[x])^3,x]

[Out]

-(Sech[x]^2*(60*ArcTan[Sinh[x]] + 60*ArcTan[Sinh[x]]*Cosh[2*x] - 50*Sinh[x] - 25*Sinh[3*x] + Sinh[5*x]))/48

________________________________________________________________________________________

Maple [A]  time = 0.018, size = 29, normalized size = 0.9 \begin{align*} - \left ({\frac{2}{3}}+{\frac{ \left ( \cosh \left ( x \right ) \right ) ^{2}}{3}} \right ) \sinh \left ( x \right ) +3\,\sinh \left ( x \right ) -5\,\arctan \left ({{\rm e}^{x}} \right ) +{\frac{{\rm sech} \left (x\right )\tanh \left ( x \right ) }{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int((-cosh(x)+sech(x))^3,x)

[Out]

-(2/3+1/3*cosh(x)^2)*sinh(x)+3*sinh(x)-5*arctan(exp(x))+1/2*sech(x)*tanh(x)

________________________________________________________________________________________

Maxima [B]  time = 1.75132, size = 76, normalized size = 2.24 \begin{align*} \frac{e^{\left (-x\right )} - e^{\left (-3 \, x\right )}}{2 \, e^{\left (-2 \, x\right )} + e^{\left (-4 \, x\right )} + 1} + 5 \, \arctan \left (e^{\left (-x\right )}\right ) - \frac{1}{24} \, e^{\left (3 \, x\right )} - \frac{9}{8} \, e^{\left (-x\right )} + \frac{1}{24} \, e^{\left (-3 \, x\right )} + \frac{9}{8} \, e^{x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cosh(x)+sech(x))^3,x, algorithm="maxima")

[Out]

(e^(-x) - e^(-3*x))/(2*e^(-2*x) + e^(-4*x) + 1) + 5*arctan(e^(-x)) - 1/24*e^(3*x) - 9/8*e^(-x) + 1/24*e^(-3*x)
+ 9/8*e^x

________________________________________________________________________________________

Fricas [B]  time = 2.07347, size = 1648, normalized size = 48.47 \begin{align*} \text{result too large to display} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cosh(x)+sech(x))^3,x, algorithm="fricas")

[Out]

-1/24*(cosh(x)^10 + 10*cosh(x)*sinh(x)^9 + sinh(x)^10 + 5*(9*cosh(x)^2 - 5)*sinh(x)^8 - 25*cosh(x)^8 + 40*(3*c
osh(x)^3 - 5*cosh(x))*sinh(x)^7 + 10*(21*cosh(x)^4 - 70*cosh(x)^2 - 5)*sinh(x)^6 - 50*cosh(x)^6 + 4*(63*cosh(x
)^5 - 350*cosh(x)^3 - 75*cosh(x))*sinh(x)^5 + 10*(21*cosh(x)^6 - 175*cosh(x)^4 - 75*cosh(x)^2 + 5)*sinh(x)^4 +
50*cosh(x)^4 + 40*(3*cosh(x)^7 - 35*cosh(x)^5 - 25*cosh(x)^3 + 5*cosh(x))*sinh(x)^3 + 5*(9*cosh(x)^8 - 140*co
sh(x)^6 - 150*cosh(x)^4 + 60*cosh(x)^2 + 5)*sinh(x)^2 + 120*(cosh(x)^7 + 7*cosh(x)*sinh(x)^6 + sinh(x)^7 + (21
*cosh(x)^2 + 2)*sinh(x)^5 + 2*cosh(x)^5 + 5*(7*cosh(x)^3 + 2*cosh(x))*sinh(x)^4 + (35*cosh(x)^4 + 20*cosh(x)^2
+ 1)*sinh(x)^3 + cosh(x)^3 + (21*cosh(x)^5 + 20*cosh(x)^3 + 3*cosh(x))*sinh(x)^2 + (7*cosh(x)^6 + 10*cosh(x)^
4 + 3*cosh(x)^2)*sinh(x))*arctan(cosh(x) + sinh(x)) + 25*cosh(x)^2 + 10*(cosh(x)^9 - 20*cosh(x)^7 - 30*cosh(x)
^5 + 20*cosh(x)^3 + 5*cosh(x))*sinh(x) - 1)/(cosh(x)^7 + 7*cosh(x)*sinh(x)^6 + sinh(x)^7 + (21*cosh(x)^2 + 2)*
sinh(x)^5 + 2*cosh(x)^5 + 5*(7*cosh(x)^3 + 2*cosh(x))*sinh(x)^4 + (35*cosh(x)^4 + 20*cosh(x)^2 + 1)*sinh(x)^3
+ cosh(x)^3 + (21*cosh(x)^5 + 20*cosh(x)^3 + 3*cosh(x))*sinh(x)^2 + (7*cosh(x)^6 + 10*cosh(x)^4 + 3*cosh(x)^2)
*sinh(x))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} - \int 3 \cosh{\left (x \right )} \operatorname{sech}^{2}{\left (x \right )}\, dx - \int - 3 \cosh ^{2}{\left (x \right )} \operatorname{sech}{\left (x \right )}\, dx - \int \cosh ^{3}{\left (x \right )}\, dx - \int - \operatorname{sech}^{3}{\left (x \right )}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cosh(x)+sech(x))**3,x)

[Out]

-Integral(3*cosh(x)*sech(x)**2, x) - Integral(-3*cosh(x)**2*sech(x), x) - Integral(cosh(x)**3, x) - Integral(-
sech(x)**3, x)

________________________________________________________________________________________

Giac [B]  time = 1.15187, size = 89, normalized size = 2.62 \begin{align*} -\frac{5}{4} \, \pi + \frac{1}{24} \,{\left (e^{\left (-x\right )} - e^{x}\right )}^{3} - \frac{e^{\left (-x\right )} - e^{x}}{{\left (e^{\left (-x\right )} - e^{x}\right )}^{2} + 4} - \frac{5}{2} \, \arctan \left (\frac{1}{2} \,{\left (e^{\left (2 \, x\right )} - 1\right )} e^{\left (-x\right )}\right ) - e^{\left (-x\right )} + e^{x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cosh(x)+sech(x))^3,x, algorithm="giac")

[Out]

-5/4*pi + 1/24*(e^(-x) - e^x)^3 - (e^(-x) - e^x)/((e^(-x) - e^x)^2 + 4) - 5/2*arctan(1/2*(e^(2*x) - 1)*e^(-x))
- e^(-x) + e^x