3.2.14 \(\int \frac {\tanh ^6(x)}{a+b \text {sech}(x)} \, dx\) [114]

3.2.14.1 Optimal result
3.2.14.2 Mathematica [A] (verified)
3.2.14.3 Rubi [A] (verified)
3.2.14.4 Maple [A] (verified)
3.2.14.5 Fricas [B] (verification not implemented)
3.2.14.6 Sympy [F]
3.2.14.7 Maxima [F(-2)]
3.2.14.8 Giac [A] (verification not implemented)
3.2.14.9 Mupad [B] (verification not implemented)

3.2.14.1 Optimal result

Integrand size = 13, antiderivative size = 187 \[ \int \frac {\tanh ^6(x)}{a+b \text {sech}(x)} \, dx=\frac {x}{a}-\frac {3 \arctan (\sinh (x))}{8 b}-\frac {\left (a^2-3 b^2\right ) \arctan (\sinh (x))}{2 b^3}-\frac {\left (a^4-3 a^2 b^2+3 b^4\right ) \arctan (\sinh (x))}{b^5}+\frac {2 (a-b)^{5/2} (a+b)^{5/2} \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b^5}+\frac {a \tanh (x)}{b^2}+\frac {a \left (a^2-3 b^2\right ) \tanh (x)}{b^4}-\frac {3 \text {sech}(x) \tanh (x)}{8 b}-\frac {\left (a^2-3 b^2\right ) \text {sech}(x) \tanh (x)}{2 b^3}-\frac {\text {sech}^3(x) \tanh (x)}{4 b}-\frac {a \tanh ^3(x)}{3 b^2} \]

output
x/a-3/8*arctan(sinh(x))/b-1/2*(a^2-3*b^2)*arctan(sinh(x))/b^3-(a^4-3*a^2*b 
^2+3*b^4)*arctan(sinh(x))/b^5+2*(a-b)^(5/2)*(a+b)^(5/2)*arctan((a-b)^(1/2) 
*tanh(1/2*x)/(a+b)^(1/2))/a/b^5+a*tanh(x)/b^2+a*(a^2-3*b^2)*tanh(x)/b^4-3/ 
8*sech(x)*tanh(x)/b-1/2*(a^2-3*b^2)*sech(x)*tanh(x)/b^3-1/4*sech(x)^3*tanh 
(x)/b-1/3*a*tanh(x)^3/b^2
 
3.2.14.2 Mathematica [A] (verified)

Time = 0.77 (sec) , antiderivative size = 185, normalized size of antiderivative = 0.99 \[ \int \frac {\tanh ^6(x)}{a+b \text {sech}(x)} \, dx=\frac {-12 \left (8 a^4-20 a^2 b^2+15 b^4\right ) \arctan \left (\tanh \left (\frac {x}{2}\right )\right )+\frac {48 \left (b^5 \sqrt {a^2-b^2} x-2 \left (a^2-b^2\right )^3 \arctan \left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )\right )}{a \sqrt {a^2-b^2}}+b \left (-12 a^2 b+15 b^3+4 a \left (9 a^2-17 b^2\right ) \cosh (x)+3 b \left (-4 a^2+9 b^2\right ) \cosh (2 x)+12 a^3 \cosh (3 x)-28 a b^2 \cosh (3 x)\right ) \text {sech}^3(x) \tanh (x)}{48 b^5} \]

input
Integrate[Tanh[x]^6/(a + b*Sech[x]),x]
 
output
(-12*(8*a^4 - 20*a^2*b^2 + 15*b^4)*ArcTan[Tanh[x/2]] + (48*(b^5*Sqrt[a^2 - 
 b^2]*x - 2*(a^2 - b^2)^3*ArcTan[((-a + b)*Tanh[x/2])/Sqrt[a^2 - b^2]]))/( 
a*Sqrt[a^2 - b^2]) + b*(-12*a^2*b + 15*b^3 + 4*a*(9*a^2 - 17*b^2)*Cosh[x] 
+ 3*b*(-4*a^2 + 9*b^2)*Cosh[2*x] + 12*a^3*Cosh[3*x] - 28*a*b^2*Cosh[3*x])* 
Sech[x]^3*Tanh[x])/(48*b^5)
 
3.2.14.3 Rubi [A] (verified)

Time = 0.59 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.615, Rules used = {3042, 25, 4386, 25, 3042, 25, 3376, 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 \frac {\tanh ^6(x)}{a+b \text {sech}(x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int -\frac {\cot \left (\frac {\pi }{2}+i x\right )^6}{a+b \csc \left (\frac {\pi }{2}+i x\right )}dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \frac {\cot \left (i x+\frac {\pi }{2}\right )^6}{a+b \csc \left (i x+\frac {\pi }{2}\right )}dx\)

\(\Big \downarrow \) 4386

\(\displaystyle -\int -\frac {\sinh (x) \tanh ^5(x)}{b+a \cosh (x)}dx\)

\(\Big \downarrow \) 25

\(\displaystyle \int \frac {\sinh (x) \tanh ^5(x)}{a \cosh (x)+b}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int -\frac {\cos \left (\frac {\pi }{2}+i x\right )^6}{\sin \left (\frac {\pi }{2}+i x\right )^5 \left (b+a \sin \left (\frac {\pi }{2}+i x\right )\right )}dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \frac {\cos \left (i x+\frac {\pi }{2}\right )^6}{\sin \left (i x+\frac {\pi }{2}\right )^5 \left (b+a \sin \left (i x+\frac {\pi }{2}\right )\right )}dx\)

\(\Big \downarrow \) 3376

\(\displaystyle -\int \left (\frac {\text {sech}^5(x)}{b}-\frac {a \text {sech}^4(x)}{b^2}+\frac {\left (a^2-3 b^2\right ) \text {sech}^3(x)}{b^3}+\frac {\left (3 a b^2-a^3\right ) \text {sech}^2(x)}{b^4}+\frac {\left (a^4-3 b^2 a^2+3 b^4\right ) \text {sech}(x)}{b^5}-\frac {1}{a}-\frac {\left (a^2-b^2\right )^3}{a b^5 (b+a \cosh (x))}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {\left (a^2-3 b^2\right ) \arctan (\sinh (x))}{2 b^3}+\frac {a \left (a^2-3 b^2\right ) \tanh (x)}{b^4}-\frac {\left (a^2-3 b^2\right ) \tanh (x) \text {sech}(x)}{2 b^3}-\frac {\left (a^4-3 a^2 b^2+3 b^4\right ) \arctan (\sinh (x))}{b^5}+\frac {2 (a-b)^{5/2} (a+b)^{5/2} \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b^5}-\frac {a \tanh ^3(x)}{3 b^2}+\frac {a \tanh (x)}{b^2}+\frac {x}{a}-\frac {3 \arctan (\sinh (x))}{8 b}-\frac {\tanh (x) \text {sech}^3(x)}{4 b}-\frac {3 \tanh (x) \text {sech}(x)}{8 b}\)

input
Int[Tanh[x]^6/(a + b*Sech[x]),x]
 
output
x/a - (3*ArcTan[Sinh[x]])/(8*b) - ((a^2 - 3*b^2)*ArcTan[Sinh[x]])/(2*b^3) 
- ((a^4 - 3*a^2*b^2 + 3*b^4)*ArcTan[Sinh[x]])/b^5 + (2*(a - b)^(5/2)*(a + 
b)^(5/2)*ArcTan[(Sqrt[a - b]*Tanh[x/2])/Sqrt[a + b]])/(a*b^5) + (a*Tanh[x] 
)/b^2 + (a*(a^2 - 3*b^2)*Tanh[x])/b^4 - (3*Sech[x]*Tanh[x])/(8*b) - ((a^2 
- 3*b^2)*Sech[x]*Tanh[x])/(2*b^3) - (Sech[x]^3*Tanh[x])/(4*b) - (a*Tanh[x] 
^3)/(3*b^2)
 

3.2.14.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3376
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) 
 + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Int[ExpandTrig[(d*sin[ 
e + f*x])^n*(a + b*sin[e + f*x])^m*(1 - sin[e + f*x]^2)^(p/2), x], x] /; Fr 
eeQ[{a, b, d, e, f}, x] && NeQ[a^2 - b^2, 0] && IntegersQ[m, 2*n, p/2] && ( 
LtQ[m, -1] || (EqQ[m, -1] && GtQ[p, 0]))
 

rule 4386
Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n 
_), x_Symbol] :> Int[Cos[c + d*x]^m*((b + a*Sin[c + d*x])^n/Sin[c + d*x]^(m 
 + n)), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && IntegerQ[n] && 
 IntegerQ[m] && (IntegerQ[m/2] || LeQ[m, 1])
 
3.2.14.4 Maple [A] (verified)

Time = 1.64 (sec) , antiderivative size = 266, normalized size of antiderivative = 1.42

method result size
default \(\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{a}+\frac {2 \left (a -b \right )^{3} \left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a \,b^{5} \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{a}-\frac {2 \left (\frac {\left (-a^{3} b -\frac {1}{2} a^{2} b^{2}+2 a \,b^{3}+\frac {7}{8} b^{4}\right ) \tanh \left (\frac {x}{2}\right )^{7}+\left (-3 a^{3} b -\frac {1}{2} a^{2} b^{2}+\frac {15}{8} b^{4}+\frac {22}{3} a \,b^{3}\right ) \tanh \left (\frac {x}{2}\right )^{5}+\left (\frac {1}{2} a^{2} b^{2}-\frac {15}{8} b^{4}-3 a^{3} b +\frac {22}{3} a \,b^{3}\right ) \tanh \left (\frac {x}{2}\right )^{3}+\left (-a^{3} b +2 a \,b^{3}+\frac {1}{2} a^{2} b^{2}-\frac {7}{8} b^{4}\right ) \tanh \left (\frac {x}{2}\right )}{\left (1+\tanh \left (\frac {x}{2}\right )^{2}\right )^{4}}+\frac {\left (8 a^{4}-20 a^{2} b^{2}+15 b^{4}\right ) \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{8}\right )}{b^{5}}\) \(266\)
risch \(\frac {x}{a}-\frac {12 a^{2} b \,{\mathrm e}^{7 x}-27 b^{3} {\mathrm e}^{7 x}+24 a^{3} {\mathrm e}^{6 x}-72 a \,b^{2} {\mathrm e}^{6 x}+12 a^{2} b \,{\mathrm e}^{5 x}-3 b^{3} {\mathrm e}^{5 x}+72 a^{3} {\mathrm e}^{4 x}-168 a \,b^{2} {\mathrm e}^{4 x}-12 a^{2} b \,{\mathrm e}^{3 x}+3 b^{3} {\mathrm e}^{3 x}+72 a^{3} {\mathrm e}^{2 x}-152 a \,b^{2} {\mathrm e}^{2 x}-12 a^{2} b \,{\mathrm e}^{x}+27 b^{3} {\mathrm e}^{x}+24 a^{3}-56 a \,b^{2}}{12 b^{4} \left (1+{\mathrm e}^{2 x}\right )^{4}}+\frac {i \ln \left ({\mathrm e}^{x}-i\right ) a^{4}}{b^{5}}-\frac {5 i \ln \left ({\mathrm e}^{x}-i\right ) a^{2}}{2 b^{3}}+\frac {15 i \ln \left ({\mathrm e}^{x}-i\right )}{8 b}-\frac {i \ln \left ({\mathrm e}^{x}+i\right ) a^{4}}{b^{5}}+\frac {5 i \ln \left ({\mathrm e}^{x}+i\right ) a^{2}}{2 b^{3}}-\frac {15 i \ln \left ({\mathrm e}^{x}+i\right )}{8 b}+\frac {\sqrt {-a^{2}+b^{2}}\, a^{3} \ln \left ({\mathrm e}^{x}+\frac {b +\sqrt {-a^{2}+b^{2}}}{a}\right )}{b^{5}}-\frac {2 \sqrt {-a^{2}+b^{2}}\, a \ln \left ({\mathrm e}^{x}+\frac {b +\sqrt {-a^{2}+b^{2}}}{a}\right )}{b^{3}}+\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{x}+\frac {b +\sqrt {-a^{2}+b^{2}}}{a}\right )}{b a}-\frac {\sqrt {-a^{2}+b^{2}}\, a^{3} \ln \left ({\mathrm e}^{x}-\frac {\sqrt {-a^{2}+b^{2}}-b}{a}\right )}{b^{5}}+\frac {2 \sqrt {-a^{2}+b^{2}}\, a \ln \left ({\mathrm e}^{x}-\frac {\sqrt {-a^{2}+b^{2}}-b}{a}\right )}{b^{3}}-\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{x}-\frac {\sqrt {-a^{2}+b^{2}}-b}{a}\right )}{b a}\) \(488\)

input
int(tanh(x)^6/(a+b*sech(x)),x,method=_RETURNVERBOSE)
 
output
1/a*ln(tanh(1/2*x)+1)+2/a*(a-b)^3*(a^3+3*a^2*b+3*a*b^2+b^3)/b^5/((a+b)*(a- 
b))^(1/2)*arctan((a-b)*tanh(1/2*x)/((a+b)*(a-b))^(1/2))-1/a*ln(tanh(1/2*x) 
-1)-2/b^5*(((-a^3*b-1/2*a^2*b^2+2*a*b^3+7/8*b^4)*tanh(1/2*x)^7+(-3*a^3*b-1 
/2*a^2*b^2+15/8*b^4+22/3*a*b^3)*tanh(1/2*x)^5+(1/2*a^2*b^2-15/8*b^4-3*a^3* 
b+22/3*a*b^3)*tanh(1/2*x)^3+(-a^3*b+2*a*b^3+1/2*a^2*b^2-7/8*b^4)*tanh(1/2* 
x))/(1+tanh(1/2*x)^2)^4+1/8*(8*a^4-20*a^2*b^2+15*b^4)*arctan(tanh(1/2*x)))
 
3.2.14.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2417 vs. \(2 (165) = 330\).

Time = 0.49 (sec) , antiderivative size = 4914, normalized size of antiderivative = 26.28 \[ \int \frac {\tanh ^6(x)}{a+b \text {sech}(x)} \, dx=\text {Too large to display} \]

input
integrate(tanh(x)^6/(a+b*sech(x)),x, algorithm="fricas")
 
output
[1/12*(12*b^5*x*cosh(x)^8 + 12*b^5*x*sinh(x)^8 - 3*(4*a^3*b^2 - 9*a*b^4)*c 
osh(x)^7 + 3*(32*b^5*x*cosh(x) - 4*a^3*b^2 + 9*a*b^4)*sinh(x)^7 + 24*(2*b^ 
5*x - a^4*b + 3*a^2*b^3)*cosh(x)^6 + 3*(112*b^5*x*cosh(x)^2 + 16*b^5*x - 8 
*a^4*b + 24*a^2*b^3 - 7*(4*a^3*b^2 - 9*a*b^4)*cosh(x))*sinh(x)^6 + 12*b^5* 
x - 3*(4*a^3*b^2 - a*b^4)*cosh(x)^5 + 3*(224*b^5*x*cosh(x)^3 - 4*a^3*b^2 + 
 a*b^4 - 21*(4*a^3*b^2 - 9*a*b^4)*cosh(x)^2 + 48*(2*b^5*x - a^4*b + 3*a^2* 
b^3)*cosh(x))*sinh(x)^5 - 24*a^4*b + 56*a^2*b^3 + 24*(3*b^5*x - 3*a^4*b + 
7*a^2*b^3)*cosh(x)^4 + 3*(280*b^5*x*cosh(x)^4 + 24*b^5*x - 24*a^4*b + 56*a 
^2*b^3 - 35*(4*a^3*b^2 - 9*a*b^4)*cosh(x)^3 + 120*(2*b^5*x - a^4*b + 3*a^2 
*b^3)*cosh(x)^2 - 5*(4*a^3*b^2 - a*b^4)*cosh(x))*sinh(x)^4 + 3*(4*a^3*b^2 
- a*b^4)*cosh(x)^3 + 3*(224*b^5*x*cosh(x)^5 + 4*a^3*b^2 - a*b^4 - 35*(4*a^ 
3*b^2 - 9*a*b^4)*cosh(x)^4 + 160*(2*b^5*x - a^4*b + 3*a^2*b^3)*cosh(x)^3 - 
 10*(4*a^3*b^2 - a*b^4)*cosh(x)^2 + 32*(3*b^5*x - 3*a^4*b + 7*a^2*b^3)*cos 
h(x))*sinh(x)^3 + 8*(6*b^5*x - 9*a^4*b + 19*a^2*b^3)*cosh(x)^2 + (336*b^5* 
x*cosh(x)^6 + 48*b^5*x - 63*(4*a^3*b^2 - 9*a*b^4)*cosh(x)^5 - 72*a^4*b + 1 
52*a^2*b^3 + 360*(2*b^5*x - a^4*b + 3*a^2*b^3)*cosh(x)^4 - 30*(4*a^3*b^2 - 
 a*b^4)*cosh(x)^3 + 144*(3*b^5*x - 3*a^4*b + 7*a^2*b^3)*cosh(x)^2 + 9*(4*a 
^3*b^2 - a*b^4)*cosh(x))*sinh(x)^2 + 12*((a^4 - 2*a^2*b^2 + b^4)*cosh(x)^8 
 + 8*(a^4 - 2*a^2*b^2 + b^4)*cosh(x)*sinh(x)^7 + (a^4 - 2*a^2*b^2 + b^4)*s 
inh(x)^8 + 4*(a^4 - 2*a^2*b^2 + b^4)*cosh(x)^6 + 4*(a^4 - 2*a^2*b^2 + b...
 
3.2.14.6 Sympy [F]

\[ \int \frac {\tanh ^6(x)}{a+b \text {sech}(x)} \, dx=\int \frac {\tanh ^{6}{\left (x \right )}}{a + b \operatorname {sech}{\left (x \right )}}\, dx \]

input
integrate(tanh(x)**6/(a+b*sech(x)),x)
 
output
Integral(tanh(x)**6/(a + b*sech(x)), x)
 
3.2.14.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {\tanh ^6(x)}{a+b \text {sech}(x)} \, dx=\text {Exception raised: ValueError} \]

input
integrate(tanh(x)^6/(a+b*sech(x)),x, algorithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f 
or more de
 
3.2.14.8 Giac [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 250, normalized size of antiderivative = 1.34 \[ \int \frac {\tanh ^6(x)}{a+b \text {sech}(x)} \, dx=\frac {x}{a} - \frac {{\left (8 \, a^{4} - 20 \, a^{2} b^{2} + 15 \, b^{4}\right )} \arctan \left (e^{x}\right )}{4 \, b^{5}} + \frac {2 \, {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{\sqrt {a^{2} - b^{2}} a b^{5}} - \frac {12 \, a^{2} b e^{\left (7 \, x\right )} - 27 \, b^{3} e^{\left (7 \, x\right )} + 24 \, a^{3} e^{\left (6 \, x\right )} - 72 \, a b^{2} e^{\left (6 \, x\right )} + 12 \, a^{2} b e^{\left (5 \, x\right )} - 3 \, b^{3} e^{\left (5 \, x\right )} + 72 \, a^{3} e^{\left (4 \, x\right )} - 168 \, a b^{2} e^{\left (4 \, x\right )} - 12 \, a^{2} b e^{\left (3 \, x\right )} + 3 \, b^{3} e^{\left (3 \, x\right )} + 72 \, a^{3} e^{\left (2 \, x\right )} - 152 \, a b^{2} e^{\left (2 \, x\right )} - 12 \, a^{2} b e^{x} + 27 \, b^{3} e^{x} + 24 \, a^{3} - 56 \, a b^{2}}{12 \, b^{4} {\left (e^{\left (2 \, x\right )} + 1\right )}^{4}} \]

input
integrate(tanh(x)^6/(a+b*sech(x)),x, algorithm="giac")
 
output
x/a - 1/4*(8*a^4 - 20*a^2*b^2 + 15*b^4)*arctan(e^x)/b^5 + 2*(a^6 - 3*a^4*b 
^2 + 3*a^2*b^4 - b^6)*arctan((a*e^x + b)/sqrt(a^2 - b^2))/(sqrt(a^2 - b^2) 
*a*b^5) - 1/12*(12*a^2*b*e^(7*x) - 27*b^3*e^(7*x) + 24*a^3*e^(6*x) - 72*a* 
b^2*e^(6*x) + 12*a^2*b*e^(5*x) - 3*b^3*e^(5*x) + 72*a^3*e^(4*x) - 168*a*b^ 
2*e^(4*x) - 12*a^2*b*e^(3*x) + 3*b^3*e^(3*x) + 72*a^3*e^(2*x) - 152*a*b^2* 
e^(2*x) - 12*a^2*b*e^x + 27*b^3*e^x + 24*a^3 - 56*a*b^2)/(b^4*(e^(2*x) + 1 
)^4)
 
3.2.14.9 Mupad [B] (verification not implemented)

Time = 8.62 (sec) , antiderivative size = 1001, normalized size of antiderivative = 5.35 \[ \int \frac {\tanh ^6(x)}{a+b \text {sech}(x)} \, dx=\frac {\frac {8\,a}{3\,b^2}+\frac {6\,{\mathrm {e}}^x}{b}}{3\,{\mathrm {e}}^{2\,x}+3\,{\mathrm {e}}^{4\,x}+{\mathrm {e}}^{6\,x}+1}-\frac {\frac {{\mathrm {e}}^x\,\left (4\,a^2-9\,b^2\right )}{4\,b^3}+\frac {2\,\left (a^4-3\,a^2\,b^2\right )}{a\,b^4}}{{\mathrm {e}}^{2\,x}+1}-\frac {\frac {4\,a}{b^2}-\frac {{\mathrm {e}}^x\,\left (4\,a^2-13\,b^2\right )}{2\,b^3}}{2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1}+\frac {x}{a}+\frac {\ln \left ({\mathrm {e}}^x-\mathrm {i}\right )\,\left (a^4\,8{}\mathrm {i}-a^2\,b^2\,20{}\mathrm {i}+b^4\,15{}\mathrm {i}\right )}{8\,b^5}-\frac {\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,\left (a^4\,8{}\mathrm {i}-a^2\,b^2\,20{}\mathrm {i}+b^4\,15{}\mathrm {i}\right )}{8\,b^5}-\frac {4\,{\mathrm {e}}^x}{b\,\left (4\,{\mathrm {e}}^{2\,x}+6\,{\mathrm {e}}^{4\,x}+4\,{\mathrm {e}}^{6\,x}+{\mathrm {e}}^{8\,x}+1\right )}+\frac {\ln \left (\frac {\sqrt {-{\left (a+b\right )}^5\,{\left (a-b\right )}^5}\,\left (\frac {128\,a^{12}+192\,{\mathrm {e}}^x\,a^{11}\,b-832\,a^{10}\,b^2-1216\,{\mathrm {e}}^x\,a^9\,b^3+2240\,a^8\,b^4+3200\,{\mathrm {e}}^x\,a^7\,b^5-3160\,a^6\,b^6-4360\,{\mathrm {e}}^x\,a^5\,b^7+2385\,a^4\,b^8+3075\,{\mathrm {e}}^x\,a^3\,b^9-834\,a^2\,b^{10}-900\,{\mathrm {e}}^x\,a\,b^{11}+64\,b^{12}}{2\,a^6\,b^8}-\frac {\sqrt {-{\left (a+b\right )}^5\,{\left (a-b\right )}^5}\,\left (\frac {4\,\left (a^2-b^2\right )\,\left (16\,a^5+28\,{\mathrm {e}}^x\,a^4\,b-32\,a^3\,b^2-57\,{\mathrm {e}}^x\,a^2\,b^3+16\,a\,b^4+32\,{\mathrm {e}}^x\,b^5\right )}{a^6\,b^2}+\frac {32\,\sqrt {-{\left (a+b\right )}^5\,{\left (a-b\right )}^5}\,\left (-2\,a^3-3\,{\mathrm {e}}^x\,a^2\,b+3\,a\,b^2+4\,{\mathrm {e}}^x\,b^3\right )}{a^6\,b^3}\right )}{a\,b^5}\right )}{a\,b^5}-\frac {{\left (a^2-b^2\right )}^3\,\left (8\,a^4-20\,a^2\,b^2+15\,b^4\right )\,\left (16\,a^5+28\,{\mathrm {e}}^x\,a^4\,b-40\,a^3\,b^2-71\,{\mathrm {e}}^x\,a^2\,b^3+30\,a\,b^4+52\,{\mathrm {e}}^x\,b^5\right )}{2\,a^6\,b^{12}}\right )\,\sqrt {-{\left (a+b\right )}^5\,{\left (a-b\right )}^5}}{a\,b^5}-\frac {\ln \left (-\frac {\sqrt {-{\left (a+b\right )}^5\,{\left (a-b\right )}^5}\,\left (\frac {128\,a^{12}+192\,{\mathrm {e}}^x\,a^{11}\,b-832\,a^{10}\,b^2-1216\,{\mathrm {e}}^x\,a^9\,b^3+2240\,a^8\,b^4+3200\,{\mathrm {e}}^x\,a^7\,b^5-3160\,a^6\,b^6-4360\,{\mathrm {e}}^x\,a^5\,b^7+2385\,a^4\,b^8+3075\,{\mathrm {e}}^x\,a^3\,b^9-834\,a^2\,b^{10}-900\,{\mathrm {e}}^x\,a\,b^{11}+64\,b^{12}}{2\,a^6\,b^8}+\frac {\sqrt {-{\left (a+b\right )}^5\,{\left (a-b\right )}^5}\,\left (\frac {4\,\left (a^2-b^2\right )\,\left (16\,a^5+28\,{\mathrm {e}}^x\,a^4\,b-32\,a^3\,b^2-57\,{\mathrm {e}}^x\,a^2\,b^3+16\,a\,b^4+32\,{\mathrm {e}}^x\,b^5\right )}{a^6\,b^2}-\frac {32\,\sqrt {-{\left (a+b\right )}^5\,{\left (a-b\right )}^5}\,\left (-2\,a^3-3\,{\mathrm {e}}^x\,a^2\,b+3\,a\,b^2+4\,{\mathrm {e}}^x\,b^3\right )}{a^6\,b^3}\right )}{a\,b^5}\right )}{a\,b^5}-\frac {{\left (a^2-b^2\right )}^3\,\left (8\,a^4-20\,a^2\,b^2+15\,b^4\right )\,\left (16\,a^5+28\,{\mathrm {e}}^x\,a^4\,b-40\,a^3\,b^2-71\,{\mathrm {e}}^x\,a^2\,b^3+30\,a\,b^4+52\,{\mathrm {e}}^x\,b^5\right )}{2\,a^6\,b^{12}}\right )\,\sqrt {-{\left (a+b\right )}^5\,{\left (a-b\right )}^5}}{a\,b^5} \]

input
int(tanh(x)^6/(a + b/cosh(x)),x)
 
output
((8*a)/(3*b^2) + (6*exp(x))/b)/(3*exp(2*x) + 3*exp(4*x) + exp(6*x) + 1) - 
((exp(x)*(4*a^2 - 9*b^2))/(4*b^3) + (2*(a^4 - 3*a^2*b^2))/(a*b^4))/(exp(2* 
x) + 1) - ((4*a)/b^2 - (exp(x)*(4*a^2 - 13*b^2))/(2*b^3))/(2*exp(2*x) + ex 
p(4*x) + 1) + x/a + (log(exp(x) - 1i)*(a^4*8i + b^4*15i - a^2*b^2*20i))/(8 
*b^5) - (log(exp(x) + 1i)*(a^4*8i + b^4*15i - a^2*b^2*20i))/(8*b^5) - (4*e 
xp(x))/(b*(4*exp(2*x) + 6*exp(4*x) + 4*exp(6*x) + exp(8*x) + 1)) + (log((( 
-(a + b)^5*(a - b)^5)^(1/2)*((128*a^12 + 64*b^12 - 834*a^2*b^10 + 2385*a^4 
*b^8 - 3160*a^6*b^6 + 2240*a^8*b^4 - 832*a^10*b^2 - 900*a*b^11*exp(x) + 19 
2*a^11*b*exp(x) + 3075*a^3*b^9*exp(x) - 4360*a^5*b^7*exp(x) + 3200*a^7*b^5 
*exp(x) - 1216*a^9*b^3*exp(x))/(2*a^6*b^8) - ((-(a + b)^5*(a - b)^5)^(1/2) 
*((4*(a^2 - b^2)*(16*a*b^4 + 16*a^5 - 32*a^3*b^2 + 32*b^5*exp(x) + 28*a^4* 
b*exp(x) - 57*a^2*b^3*exp(x)))/(a^6*b^2) + (32*(-(a + b)^5*(a - b)^5)^(1/2 
)*(3*a*b^2 - 2*a^3 + 4*b^3*exp(x) - 3*a^2*b*exp(x)))/(a^6*b^3)))/(a*b^5))) 
/(a*b^5) - ((a^2 - b^2)^3*(8*a^4 + 15*b^4 - 20*a^2*b^2)*(30*a*b^4 + 16*a^5 
 - 40*a^3*b^2 + 52*b^5*exp(x) + 28*a^4*b*exp(x) - 71*a^2*b^3*exp(x)))/(2*a 
^6*b^12))*(-(a + b)^5*(a - b)^5)^(1/2))/(a*b^5) - (log(- ((-(a + b)^5*(a - 
 b)^5)^(1/2)*((128*a^12 + 64*b^12 - 834*a^2*b^10 + 2385*a^4*b^8 - 3160*a^6 
*b^6 + 2240*a^8*b^4 - 832*a^10*b^2 - 900*a*b^11*exp(x) + 192*a^11*b*exp(x) 
 + 3075*a^3*b^9*exp(x) - 4360*a^5*b^7*exp(x) + 3200*a^7*b^5*exp(x) - 1216* 
a^9*b^3*exp(x))/(2*a^6*b^8) + ((-(a + b)^5*(a - b)^5)^(1/2)*((4*(a^2 - ...