\(\int \frac {\tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx\) [385]

Optimal result
Mathematica [A] (verified)
Rubi [A] (warning: unable to verify)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 90 \[ \int \frac {\tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {2 a^2 \text {arctanh}\left (\frac {b-a \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2} d}-\frac {b \text {sech}(c+d x)}{\left (a^2+b^2\right ) d}-\frac {a \tanh (c+d x)}{\left (a^2+b^2\right ) d} \] Output:

-2*a^2*arctanh((b-a*tanh(1/2*d*x+1/2*c))/(a^2+b^2)^(1/2))/(a^2+b^2)^(3/2)/ 
d-b*sech(d*x+c)/(a^2+b^2)/d-a*tanh(d*x+c)/(a^2+b^2)/d
 

Mathematica [A] (verified)

Time = 0.38 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.18 \[ \int \frac {\tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {-b \sqrt {-a^2-b^2} \text {sech}(c+d x)+a \left (2 a \arctan \left (\frac {b-a \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2-b^2}}\right )-\sqrt {-a^2-b^2} \tanh (c+d x)\right )}{\left (-a^2-b^2\right )^{3/2} d} \] Input:

Integrate[Tanh[c + d*x]^2/(a + b*Sinh[c + d*x]),x]
 

Output:

-((-(b*Sqrt[-a^2 - b^2]*Sech[c + d*x]) + a*(2*a*ArcTan[(b - a*Tanh[(c + d* 
x)/2])/Sqrt[-a^2 - b^2]] - Sqrt[-a^2 - b^2]*Tanh[c + d*x]))/((-a^2 - b^2)^ 
(3/2)*d))
 

Rubi [A] (warning: unable to verify)

Time = 0.55 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.98, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.619, Rules used = {3042, 25, 3206, 26, 3042, 26, 3086, 24, 3139, 1083, 217, 4254, 24}

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 ^2(c+d x)}{a+b \sinh (c+d x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int -\frac {\tan (i c+i d x)^2}{a-i b \sin (i c+i d x)}dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \frac {\tan (i c+i d x)^2}{a-i b \sin (i c+i d x)}dx\)

\(\Big \downarrow \) 3206

\(\displaystyle \frac {a^2 \int \frac {1}{a+b \sinh (c+d x)}dx}{a^2+b^2}-\frac {a \int \text {sech}^2(c+d x)dx}{a^2+b^2}-\frac {i b \int i \text {sech}(c+d x) \tanh (c+d x)dx}{a^2+b^2}\)

\(\Big \downarrow \) 26

\(\displaystyle \frac {a^2 \int \frac {1}{a+b \sinh (c+d x)}dx}{a^2+b^2}-\frac {a \int \text {sech}^2(c+d x)dx}{a^2+b^2}+\frac {b \int \text {sech}(c+d x) \tanh (c+d x)dx}{a^2+b^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {a^2 \int \frac {1}{a-i b \sin (i c+i d x)}dx}{a^2+b^2}-\frac {a \int \csc \left (i c+i d x+\frac {\pi }{2}\right )^2dx}{a^2+b^2}+\frac {b \int -i \sec (i c+i d x) \tan (i c+i d x)dx}{a^2+b^2}\)

\(\Big \downarrow \) 26

\(\displaystyle \frac {a^2 \int \frac {1}{a-i b \sin (i c+i d x)}dx}{a^2+b^2}-\frac {a \int \csc \left (i c+i d x+\frac {\pi }{2}\right )^2dx}{a^2+b^2}-\frac {i b \int \sec (i c+i d x) \tan (i c+i d x)dx}{a^2+b^2}\)

\(\Big \downarrow \) 3086

\(\displaystyle \frac {a^2 \int \frac {1}{a-i b \sin (i c+i d x)}dx}{a^2+b^2}-\frac {a \int \csc \left (i c+i d x+\frac {\pi }{2}\right )^2dx}{a^2+b^2}-\frac {b \int 1d\text {sech}(c+d x)}{d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {a^2 \int \frac {1}{a-i b \sin (i c+i d x)}dx}{a^2+b^2}-\frac {a \int \csc \left (i c+i d x+\frac {\pi }{2}\right )^2dx}{a^2+b^2}-\frac {b \text {sech}(c+d x)}{d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 3139

\(\displaystyle -\frac {a \int \csc \left (i c+i d x+\frac {\pi }{2}\right )^2dx}{a^2+b^2}-\frac {2 i a^2 \int \frac {1}{-a \tanh ^2\left (\frac {1}{2} (c+d x)\right )+2 b \tanh \left (\frac {1}{2} (c+d x)\right )+a}d\left (i \tanh \left (\frac {1}{2} (c+d x)\right )\right )}{d \left (a^2+b^2\right )}-\frac {b \text {sech}(c+d x)}{d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 1083

\(\displaystyle -\frac {a \int \csc \left (i c+i d x+\frac {\pi }{2}\right )^2dx}{a^2+b^2}+\frac {4 i a^2 \int \frac {1}{\tanh ^2\left (\frac {1}{2} (c+d x)\right )-4 \left (a^2+b^2\right )}d\left (2 i a \tanh \left (\frac {1}{2} (c+d x)\right )-2 i b\right )}{d \left (a^2+b^2\right )}-\frac {b \text {sech}(c+d x)}{d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 217

\(\displaystyle -\frac {a \int \csc \left (i c+i d x+\frac {\pi }{2}\right )^2dx}{a^2+b^2}+\frac {2 a^2 \text {arctanh}\left (\frac {\tanh \left (\frac {1}{2} (c+d x)\right )}{2 \sqrt {a^2+b^2}}\right )}{d \left (a^2+b^2\right )^{3/2}}-\frac {b \text {sech}(c+d x)}{d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 4254

\(\displaystyle -\frac {i a \int 1d(-i \tanh (c+d x))}{d \left (a^2+b^2\right )}+\frac {2 a^2 \text {arctanh}\left (\frac {\tanh \left (\frac {1}{2} (c+d x)\right )}{2 \sqrt {a^2+b^2}}\right )}{d \left (a^2+b^2\right )^{3/2}}-\frac {b \text {sech}(c+d x)}{d \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {2 a^2 \text {arctanh}\left (\frac {\tanh \left (\frac {1}{2} (c+d x)\right )}{2 \sqrt {a^2+b^2}}\right )}{d \left (a^2+b^2\right )^{3/2}}-\frac {a \tanh (c+d x)}{d \left (a^2+b^2\right )}-\frac {b \text {sech}(c+d x)}{d \left (a^2+b^2\right )}\)

Input:

Int[Tanh[c + d*x]^2/(a + b*Sinh[c + d*x]),x]
 

Output:

(2*a^2*ArcTanh[Tanh[(c + d*x)/2]/(2*Sqrt[a^2 + b^2])])/((a^2 + b^2)^(3/2)* 
d) - (b*Sech[c + d*x])/((a^2 + b^2)*d) - (a*Tanh[c + d*x])/((a^2 + b^2)*d)
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

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

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

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

rule 1083
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2   Subst[I 
nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, 
x]
 

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

rule 3086
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( 
n_.), x_Symbol] :> Simp[a/f   Subst[Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2 
), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2 
] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])
 

rule 3139
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre 
eFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d)   Subst[Int[1/(a + 2*b*e*x + a 
*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ 
[a^2 - b^2, 0]
 

rule 3206
Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x 
_)]), x_Symbol] :> Simp[a/(a^2 - b^2)   Int[(g*Tan[e + f*x])^p/Sin[e + f*x] 
^2, x], x] + (-Simp[b*(g/(a^2 - b^2))   Int[(g*Tan[e + f*x])^(p - 1)/Cos[e 
+ f*x], x], x] - Simp[a^2*(g^2/(a^2 - b^2))   Int[(g*Tan[e + f*x])^(p - 2)/ 
(a + b*Sin[e + f*x]), x], x]) /; FreeQ[{a, b, e, f, g}, x] && NeQ[a^2 - b^2 
, 0] && IntegersQ[2*p] && GtQ[p, 1]
 

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 
Maple [A] (verified)

Time = 0.34 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.14

method result size
derivativedivides \(\frac {\frac {8 a^{2} \operatorname {arctanh}\left (\frac {2 a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (4 a^{2}+4 b^{2}\right ) \sqrt {a^{2}+b^{2}}}+\frac {-2 a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{\left (a^{2}+b^{2}\right ) \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}}{d}\) \(103\)
default \(\frac {\frac {8 a^{2} \operatorname {arctanh}\left (\frac {2 a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (4 a^{2}+4 b^{2}\right ) \sqrt {a^{2}+b^{2}}}+\frac {-2 a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{\left (a^{2}+b^{2}\right ) \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}}{d}\) \(103\)
risch \(\frac {-2 b \,{\mathrm e}^{d x +c}+2 a}{d \left (a^{2}+b^{2}\right ) \left (1+{\mathrm e}^{2 d x +2 c}\right )}+\frac {a^{2} \ln \left ({\mathrm e}^{d x +c}+\frac {a \left (a^{2}+b^{2}\right )^{\frac {3}{2}}-a^{4}-2 a^{2} b^{2}-b^{4}}{b \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}} d}-\frac {a^{2} \ln \left ({\mathrm e}^{d x +c}+\frac {a \left (a^{2}+b^{2}\right )^{\frac {3}{2}}+a^{4}+2 a^{2} b^{2}+b^{4}}{b \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}} d}\) \(171\)

Input:

int(tanh(d*x+c)^2/(a+b*sinh(d*x+c)),x,method=_RETURNVERBOSE)
                                                                                    
                                                                                    
 

Output:

1/d*(8*a^2/(4*a^2+4*b^2)/(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*tanh(1/2*d*x+1/2 
*c)-2*b)/(a^2+b^2)^(1/2))+2/(a^2+b^2)*(-a*tanh(1/2*d*x+1/2*c)-b)/(1+tanh(1 
/2*d*x+1/2*c)^2))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 351 vs. \(2 (87) = 174\).

Time = 0.10 (sec) , antiderivative size = 351, normalized size of antiderivative = 3.90 \[ \int \frac {\tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {2 \, a^{3} + 2 \, a b^{2} + {\left (a^{2} \cosh \left (d x + c\right )^{2} + 2 \, a^{2} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + a^{2} \sinh \left (d x + c\right )^{2} + a^{2}\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {b^{2} \cosh \left (d x + c\right )^{2} + b^{2} \sinh \left (d x + c\right )^{2} + 2 \, a b \cosh \left (d x + c\right ) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \left (d x + c\right ) + a b\right )} \sinh \left (d x + c\right ) - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \left (d x + c\right ) + b \sinh \left (d x + c\right ) + a\right )}}{b \cosh \left (d x + c\right )^{2} + b \sinh \left (d x + c\right )^{2} + 2 \, a \cosh \left (d x + c\right ) + 2 \, {\left (b \cosh \left (d x + c\right ) + a\right )} \sinh \left (d x + c\right ) - b}\right ) - 2 \, {\left (a^{2} b + b^{3}\right )} \cosh \left (d x + c\right ) - 2 \, {\left (a^{2} b + b^{3}\right )} \sinh \left (d x + c\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d \cosh \left (d x + c\right )^{2} + 2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d \sinh \left (d x + c\right )^{2} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d} \] Input:

integrate(tanh(d*x+c)^2/(a+b*sinh(d*x+c)),x, algorithm="fricas")
 

Output:

(2*a^3 + 2*a*b^2 + (a^2*cosh(d*x + c)^2 + 2*a^2*cosh(d*x + c)*sinh(d*x + c 
) + a^2*sinh(d*x + c)^2 + a^2)*sqrt(a^2 + b^2)*log((b^2*cosh(d*x + c)^2 + 
b^2*sinh(d*x + c)^2 + 2*a*b*cosh(d*x + c) + 2*a^2 + b^2 + 2*(b^2*cosh(d*x 
+ c) + a*b)*sinh(d*x + c) - 2*sqrt(a^2 + b^2)*(b*cosh(d*x + c) + b*sinh(d* 
x + c) + a))/(b*cosh(d*x + c)^2 + b*sinh(d*x + c)^2 + 2*a*cosh(d*x + c) + 
2*(b*cosh(d*x + c) + a)*sinh(d*x + c) - b)) - 2*(a^2*b + b^3)*cosh(d*x + c 
) - 2*(a^2*b + b^3)*sinh(d*x + c))/((a^4 + 2*a^2*b^2 + b^4)*d*cosh(d*x + c 
)^2 + 2*(a^4 + 2*a^2*b^2 + b^4)*d*cosh(d*x + c)*sinh(d*x + c) + (a^4 + 2*a 
^2*b^2 + b^4)*d*sinh(d*x + c)^2 + (a^4 + 2*a^2*b^2 + b^4)*d)
 

Sympy [F]

\[ \int \frac {\tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\int \frac {\tanh ^{2}{\left (c + d x \right )}}{a + b \sinh {\left (c + d x \right )}}\, dx \] Input:

integrate(tanh(d*x+c)**2/(a+b*sinh(d*x+c)),x)
 

Output:

Integral(tanh(c + d*x)**2/(a + b*sinh(c + d*x)), x)
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.28 \[ \int \frac {\tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {a^{2} \log \left (\frac {b e^{\left (-d x - c\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-d x - c\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}} d} - \frac {2 \, {\left (b e^{\left (-d x - c\right )} + a\right )}}{{\left (a^{2} + b^{2} + {\left (a^{2} + b^{2}\right )} e^{\left (-2 \, d x - 2 \, c\right )}\right )} d} \] Input:

integrate(tanh(d*x+c)^2/(a+b*sinh(d*x+c)),x, algorithm="maxima")
 

Output:

a^2*log((b*e^(-d*x - c) - a - sqrt(a^2 + b^2))/(b*e^(-d*x - c) - a + sqrt( 
a^2 + b^2)))/((a^2 + b^2)^(3/2)*d) - 2*(b*e^(-d*x - c) + a)/((a^2 + b^2 + 
(a^2 + b^2)*e^(-2*d*x - 2*c))*d)
 

Giac [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.20 \[ \int \frac {\tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {\frac {a^{2} \log \left (\frac {{\left | 2 \, b e^{\left (d x + c\right )} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{\left (d x + c\right )} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (b e^{\left (d x + c\right )} - a\right )}}{{\left (a^{2} + b^{2}\right )} {\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}}}{d} \] Input:

integrate(tanh(d*x+c)^2/(a+b*sinh(d*x+c)),x, algorithm="giac")
 

Output:

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

Mupad [B] (verification not implemented)

Time = 1.68 (sec) , antiderivative size = 422, normalized size of antiderivative = 4.69 \[ \int \frac {\tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {\frac {2\,a}{d\,\left (a^2+b^2\right )}-\frac {2\,b\,{\mathrm {e}}^{c+d\,x}}{d\,\left (a^2+b^2\right )}}{{\mathrm {e}}^{2\,c+2\,d\,x}+1}-\frac {2\,\mathrm {atan}\left (\left ({\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (\frac {2\,a^2}{b^2\,d\,\sqrt {a^4}\,{\left (a^2+b^2\right )}^2}+\frac {2\,\left (a^3\,d\,\sqrt {a^4}+a\,b^2\,d\,\sqrt {a^4}\right )}{a\,b^2\,\sqrt {-d^2\,{\left (a^2+b^2\right )}^3}\,\left (a^2+b^2\right )\,\sqrt {-a^6\,d^2-3\,a^4\,b^2\,d^2-3\,a^2\,b^4\,d^2-b^6\,d^2}}\right )-\frac {2\,\left (b^3\,d\,\sqrt {a^4}+a^2\,b\,d\,\sqrt {a^4}\right )}{a\,b^2\,\sqrt {-d^2\,{\left (a^2+b^2\right )}^3}\,\left (a^2+b^2\right )\,\sqrt {-a^6\,d^2-3\,a^4\,b^2\,d^2-3\,a^2\,b^4\,d^2-b^6\,d^2}}\right )\,\left (\frac {b^3\,\sqrt {-a^6\,d^2-3\,a^4\,b^2\,d^2-3\,a^2\,b^4\,d^2-b^6\,d^2}}{2}+\frac {a^2\,b\,\sqrt {-a^6\,d^2-3\,a^4\,b^2\,d^2-3\,a^2\,b^4\,d^2-b^6\,d^2}}{2}\right )\right )\,\sqrt {a^4}}{\sqrt {-a^6\,d^2-3\,a^4\,b^2\,d^2-3\,a^2\,b^4\,d^2-b^6\,d^2}} \] Input:

int(tanh(c + d*x)^2/(a + b*sinh(c + d*x)),x)
 

Output:

((2*a)/(d*(a^2 + b^2)) - (2*b*exp(c + d*x))/(d*(a^2 + b^2)))/(exp(2*c + 2* 
d*x) + 1) - (2*atan((exp(d*x)*exp(c)*((2*a^2)/(b^2*d*(a^4)^(1/2)*(a^2 + b^ 
2)^2) + (2*(a^3*d*(a^4)^(1/2) + a*b^2*d*(a^4)^(1/2)))/(a*b^2*(-d^2*(a^2 + 
b^2)^3)^(1/2)*(a^2 + b^2)*(- a^6*d^2 - b^6*d^2 - 3*a^2*b^4*d^2 - 3*a^4*b^2 
*d^2)^(1/2))) - (2*(b^3*d*(a^4)^(1/2) + a^2*b*d*(a^4)^(1/2)))/(a*b^2*(-d^2 
*(a^2 + b^2)^3)^(1/2)*(a^2 + b^2)*(- a^6*d^2 - b^6*d^2 - 3*a^2*b^4*d^2 - 3 
*a^4*b^2*d^2)^(1/2)))*((b^3*(- a^6*d^2 - b^6*d^2 - 3*a^2*b^4*d^2 - 3*a^4*b 
^2*d^2)^(1/2))/2 + (a^2*b*(- a^6*d^2 - b^6*d^2 - 3*a^2*b^4*d^2 - 3*a^4*b^2 
*d^2)^(1/2))/2))*(a^4)^(1/2))/(- a^6*d^2 - b^6*d^2 - 3*a^2*b^4*d^2 - 3*a^4 
*b^2*d^2)^(1/2)
 

Reduce [B] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 213, normalized size of antiderivative = 2.37 \[ \int \frac {\tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {2 e^{2 d x +2 c} \sqrt {a^{2}+b^{2}}\, \mathit {atan} \left (\frac {e^{d x +c} b i +a i}{\sqrt {a^{2}+b^{2}}}\right ) a^{2} i +2 \sqrt {a^{2}+b^{2}}\, \mathit {atan} \left (\frac {e^{d x +c} b i +a i}{\sqrt {a^{2}+b^{2}}}\right ) a^{2} i -2 e^{2 d x +2 c} a^{3}-2 e^{2 d x +2 c} a \,b^{2}-2 e^{d x +c} a^{2} b -2 e^{d x +c} b^{3}}{d \left (e^{2 d x +2 c} a^{4}+2 e^{2 d x +2 c} a^{2} b^{2}+e^{2 d x +2 c} b^{4}+a^{4}+2 a^{2} b^{2}+b^{4}\right )} \] Input:

int(tanh(d*x+c)^2/(a+b*sinh(d*x+c)),x)
 

Output:

(2*(e**(2*c + 2*d*x)*sqrt(a**2 + b**2)*atan((e**(c + d*x)*b*i + a*i)/sqrt( 
a**2 + b**2))*a**2*i + sqrt(a**2 + b**2)*atan((e**(c + d*x)*b*i + a*i)/sqr 
t(a**2 + b**2))*a**2*i - e**(2*c + 2*d*x)*a**3 - e**(2*c + 2*d*x)*a*b**2 - 
 e**(c + d*x)*a**2*b - e**(c + d*x)*b**3))/(d*(e**(2*c + 2*d*x)*a**4 + 2*e 
**(2*c + 2*d*x)*a**2*b**2 + e**(2*c + 2*d*x)*b**4 + a**4 + 2*a**2*b**2 + b 
**4))