### 3.621 $$\int \frac{1}{(a \text{sech}(x)+b \tanh (x))^3} \, dx$$

Optimal. Leaf size=48 $-\frac{a^2+b^2}{2 b^3 (a+b \sinh (x))^2}+\frac{2 a}{b^3 (a+b \sinh (x))}+\frac{\log (a+b \sinh (x))}{b^3}$

[Out]

Log[a + b*Sinh[x]]/b^3 - (a^2 + b^2)/(2*b^3*(a + b*Sinh[x])^2) + (2*a)/(b^3*(a + b*Sinh[x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0798414, antiderivative size = 48, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 11, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.273, Rules used = {4391, 2668, 697} $-\frac{a^2+b^2}{2 b^3 (a+b \sinh (x))^2}+\frac{2 a}{b^3 (a+b \sinh (x))}+\frac{\log (a+b \sinh (x))}{b^3}$

Antiderivative was successfully veriﬁed.

[In]

Int[(a*Sech[x] + b*Tanh[x])^(-3),x]

[Out]

Log[a + b*Sinh[x]]/b^3 - (a^2 + b^2)/(2*b^3*(a + b*Sinh[x])^2) + (2*a)/(b^3*(a + b*Sinh[x]))

Rule 4391

Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x_)]^(n_.))^(p_), x_Symbol] :> Int[A
ctivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a*Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rule 2668

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^m*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 697

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

Rubi steps

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

Mathematica [A]  time = 0.133074, size = 42, normalized size = 0.88 $-\frac{\frac{-3 a^2-4 a b \sinh (x)+b^2}{2 (a+b \sinh (x))^2}-\log (a+b \sinh (x))}{b^3}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(a*Sech[x] + b*Tanh[x])^(-3),x]

[Out]

-((-Log[a + b*Sinh[x]] + (-3*a^2 + b^2 - 4*a*b*Sinh[x])/(2*(a + b*Sinh[x])^2))/b^3)

________________________________________________________________________________________

Maple [B]  time = 0.088, size = 241, normalized size = 5. \begin{align*} -{\frac{1}{{b}^{3}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+2\,{\frac{a \left ( \tanh \left ( x/2 \right ) \right ) ^{3}}{{b}^{2} \left ( a \left ( \tanh \left ( x/2 \right ) \right ) ^{2}-2\,\tanh \left ( x/2 \right ) b-a \right ) ^{2}}}-2\,{\frac{ \left ( \tanh \left ( x/2 \right ) \right ) ^{3}}{ \left ( a \left ( \tanh \left ( x/2 \right ) \right ) ^{2}-2\,\tanh \left ( x/2 \right ) b-a \right ) ^{2}a}}-6\,{\frac{ \left ( \tanh \left ( x/2 \right ) \right ) ^{2}}{b \left ( a \left ( \tanh \left ( x/2 \right ) \right ) ^{2}-2\,\tanh \left ( x/2 \right ) b-a \right ) ^{2}}}+2\,{\frac{ \left ( \tanh \left ( x/2 \right ) \right ) ^{2}b}{ \left ( a \left ( \tanh \left ( x/2 \right ) \right ) ^{2}-2\,\tanh \left ( x/2 \right ) b-a \right ) ^{2}{a}^{2}}}-2\,{\frac{a\tanh \left ( x/2 \right ) }{{b}^{2} \left ( a \left ( \tanh \left ( x/2 \right ) \right ) ^{2}-2\,\tanh \left ( x/2 \right ) b-a \right ) ^{2}}}+2\,{\frac{\tanh \left ( x/2 \right ) }{ \left ( a \left ( \tanh \left ( x/2 \right ) \right ) ^{2}-2\,\tanh \left ( x/2 \right ) b-a \right ) ^{2}a}}+{\frac{1}{{b}^{3}}\ln \left ( a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}-2\,\tanh \left ( x/2 \right ) b-a \right ) }-{\frac{1}{{b}^{3}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) } \end{align*}

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

[In]

int(1/(a*sech(x)+b*tanh(x))^3,x)

[Out]

-1/b^3*ln(tanh(1/2*x)+1)+2/b^2/(a*tanh(1/2*x)^2-2*tanh(1/2*x)*b-a)^2*a*tanh(1/2*x)^3-2/(a*tanh(1/2*x)^2-2*tanh
(1/2*x)*b-a)^2/a*tanh(1/2*x)^3-6/b/(a*tanh(1/2*x)^2-2*tanh(1/2*x)*b-a)^2*tanh(1/2*x)^2+2*b/(a*tanh(1/2*x)^2-2*
tanh(1/2*x)*b-a)^2/a^2*tanh(1/2*x)^2-2/b^2/(a*tanh(1/2*x)^2-2*tanh(1/2*x)*b-a)^2*a*tanh(1/2*x)+2/(a*tanh(1/2*x
)^2-2*tanh(1/2*x)*b-a)^2/a*tanh(1/2*x)+1/b^3*ln(a*tanh(1/2*x)^2-2*tanh(1/2*x)*b-a)-1/b^3*ln(tanh(1/2*x)-1)

________________________________________________________________________________________

Maxima [B]  time = 1.08794, size = 158, normalized size = 3.29 \begin{align*} \frac{2 \,{\left (2 \, a b e^{\left (-x\right )} - 2 \, a b e^{\left (-3 \, x\right )} +{\left (3 \, a^{2} - b^{2}\right )} e^{\left (-2 \, x\right )}\right )}}{4 \, a b^{4} e^{\left (-x\right )} - 4 \, a b^{4} e^{\left (-3 \, x\right )} + b^{5} e^{\left (-4 \, x\right )} + b^{5} + 2 \,{\left (2 \, a^{2} b^{3} - b^{5}\right )} e^{\left (-2 \, x\right )}} + \frac{x}{b^{3}} + \frac{\log \left (-2 \, a e^{\left (-x\right )} + b e^{\left (-2 \, x\right )} - b\right )}{b^{3}} \end{align*}

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

[In]

integrate(1/(a*sech(x)+b*tanh(x))^3,x, algorithm="maxima")

[Out]

2*(2*a*b*e^(-x) - 2*a*b*e^(-3*x) + (3*a^2 - b^2)*e^(-2*x))/(4*a*b^4*e^(-x) - 4*a*b^4*e^(-3*x) + b^5*e^(-4*x) +
b^5 + 2*(2*a^2*b^3 - b^5)*e^(-2*x)) + x/b^3 + log(-2*a*e^(-x) + b*e^(-2*x) - b)/b^3

________________________________________________________________________________________

Fricas [B]  time = 2.56839, size = 1362, normalized size = 28.38 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

integrate(1/(a*sech(x)+b*tanh(x))^3,x, algorithm="fricas")

[Out]

-(b^2*x*cosh(x)^4 + b^2*x*sinh(x)^4 + 4*(a*b*x - a*b)*cosh(x)^3 + 4*(b^2*x*cosh(x) + a*b*x - a*b)*sinh(x)^3 +
b^2*x - 2*(3*a^2 - b^2 - (2*a^2 - b^2)*x)*cosh(x)^2 + 2*(3*b^2*x*cosh(x)^2 - 3*a^2 + b^2 + (2*a^2 - b^2)*x + 6
*(a*b*x - a*b)*cosh(x))*sinh(x)^2 - 4*(a*b*x - a*b)*cosh(x) - (b^2*cosh(x)^4 + b^2*sinh(x)^4 + 4*a*b*cosh(x)^3
+ 4*(b^2*cosh(x) + a*b)*sinh(x)^3 - 4*a*b*cosh(x) + 2*(2*a^2 - b^2)*cosh(x)^2 + 2*(3*b^2*cosh(x)^2 + 6*a*b*co
sh(x) + 2*a^2 - b^2)*sinh(x)^2 + b^2 + 4*(b^2*cosh(x)^3 + 3*a*b*cosh(x)^2 - a*b + (2*a^2 - b^2)*cosh(x))*sinh(
x))*log(2*(b*sinh(x) + a)/(cosh(x) - sinh(x))) + 4*(b^2*x*cosh(x)^3 - a*b*x + 3*(a*b*x - a*b)*cosh(x)^2 + a*b
- (3*a^2 - b^2 - (2*a^2 - b^2)*x)*cosh(x))*sinh(x))/(b^5*cosh(x)^4 + b^5*sinh(x)^4 + 4*a*b^4*cosh(x)^3 - 4*a*b
^4*cosh(x) + b^5 + 4*(b^5*cosh(x) + a*b^4)*sinh(x)^3 + 2*(2*a^2*b^3 - b^5)*cosh(x)^2 + 2*(3*b^5*cosh(x)^2 + 6*
a*b^4*cosh(x) + 2*a^2*b^3 - b^5)*sinh(x)^2 + 4*(b^5*cosh(x)^3 + 3*a*b^4*cosh(x)^2 - a*b^4 + (2*a^2*b^3 - b^5)*
cosh(x))*sinh(x))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

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

[In]

integrate(1/(a*sech(x)+b*tanh(x))**3,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.15932, size = 101, normalized size = 2.1 \begin{align*} \frac{\log \left ({\left | -b{\left (e^{\left (-x\right )} - e^{x}\right )} + 2 \, a \right |}\right )}{b^{3}} - \frac{3 \, b{\left (e^{\left (-x\right )} - e^{x}\right )}^{2} - 4 \, a{\left (e^{\left (-x\right )} - e^{x}\right )} + 4 \, b}{2 \,{\left (b{\left (e^{\left (-x\right )} - e^{x}\right )} - 2 \, a\right )}^{2} b^{2}} \end{align*}

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

[In]

integrate(1/(a*sech(x)+b*tanh(x))^3,x, algorithm="giac")

[Out]

log(abs(-b*(e^(-x) - e^x) + 2*a))/b^3 - 1/2*(3*b*(e^(-x) - e^x)^2 - 4*a*(e^(-x) - e^x) + 4*b)/((b*(e^(-x) - e^
x) - 2*a)^2*b^2)