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

Optimal result
Mathematica [C] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 121 \[ \int \frac {\text {sech}(c+d x) \tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {a \left (a^2-b^2\right ) \arctan (\sinh (c+d x))}{2 \left (a^2+b^2\right )^2 d}-\frac {a^2 b \log (\cosh (c+d x))}{\left (a^2+b^2\right )^2 d}+\frac {a^2 b \log (a+b \sinh (c+d x))}{\left (a^2+b^2\right )^2 d}-\frac {\text {sech}^2(c+d x) (b+a \sinh (c+d x))}{2 \left (a^2+b^2\right ) d} \] Output:

1/2*a*(a^2-b^2)*arctan(sinh(d*x+c))/(a^2+b^2)^2/d-a^2*b*ln(cosh(d*x+c))/(a 
^2+b^2)^2/d+a^2*b*ln(a+b*sinh(d*x+c))/(a^2+b^2)^2/d-1/2*sech(d*x+c)^2*(b+a 
*sinh(d*x+c))/(a^2+b^2)/d
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.26 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.07 \[ \int \frac {\text {sech}(c+d x) \tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {a \left (\left (a^2+b^2\right ) \arctan (\sinh (c+d x))+a ((i a+b) \log (i-\sinh (c+d x))+(-i a+b) \log (i+\sinh (c+d x))-2 b \log (a+b \sinh (c+d x)))\right )+b \left (a^2+b^2\right ) \text {sech}^2(c+d x)+a \left (a^2+b^2\right ) \text {sech}(c+d x) \tanh (c+d x)}{2 \left (a^2+b^2\right )^2 d} \] Input:

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

Output:

-1/2*(a*((a^2 + b^2)*ArcTan[Sinh[c + d*x]] + a*((I*a + b)*Log[I - Sinh[c + 
 d*x]] + ((-I)*a + b)*Log[I + Sinh[c + d*x]] - 2*b*Log[a + b*Sinh[c + d*x] 
])) + b*(a^2 + b^2)*Sech[c + d*x]^2 + a*(a^2 + b^2)*Sech[c + d*x]*Tanh[c + 
 d*x])/((a^2 + b^2)^2*d)
 

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.21, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.370, Rules used = {3042, 25, 3316, 25, 27, 601, 25, 27, 657, 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 ^2(c+d x) \text {sech}(c+d x)}{a+b \sinh (c+d x)} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3316

\(\displaystyle -\frac {b^3 \int -\frac {\sinh ^2(c+d x)}{(a+b \sinh (c+d x)) \left (\sinh ^2(c+d x) b^2+b^2\right )^2}d(b \sinh (c+d x))}{d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {b^3 \int \frac {\sinh ^2(c+d x)}{(a+b \sinh (c+d x)) \left (\sinh ^2(c+d x) b^2+b^2\right )^2}d(b \sinh (c+d x))}{d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {b \int \frac {b^2 \sinh ^2(c+d x)}{(a+b \sinh (c+d x)) \left (\sinh ^2(c+d x) b^2+b^2\right )^2}d(b \sinh (c+d x))}{d}\)

\(\Big \downarrow \) 601

\(\displaystyle \frac {b \left (-\frac {\int -\frac {a b^2 (a-b \sinh (c+d x))}{\left (a^2+b^2\right ) (a+b \sinh (c+d x)) \left (\sinh ^2(c+d x) b^2+b^2\right )}d(b \sinh (c+d x))}{2 b^2}-\frac {a b \sinh (c+d x)+b^2}{2 \left (a^2+b^2\right ) \left (b^2 \sinh ^2(c+d x)+b^2\right )}\right )}{d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {b \left (\frac {\int \frac {a b^2 (a-b \sinh (c+d x))}{\left (a^2+b^2\right ) (a+b \sinh (c+d x)) \left (\sinh ^2(c+d x) b^2+b^2\right )}d(b \sinh (c+d x))}{2 b^2}-\frac {a b \sinh (c+d x)+b^2}{2 \left (a^2+b^2\right ) \left (b^2 \sinh ^2(c+d x)+b^2\right )}\right )}{d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {b \left (\frac {a \int \frac {a-b \sinh (c+d x)}{(a+b \sinh (c+d x)) \left (\sinh ^2(c+d x) b^2+b^2\right )}d(b \sinh (c+d x))}{2 \left (a^2+b^2\right )}-\frac {a b \sinh (c+d x)+b^2}{2 \left (a^2+b^2\right ) \left (b^2 \sinh ^2(c+d x)+b^2\right )}\right )}{d}\)

\(\Big \downarrow \) 657

\(\displaystyle \frac {b \left (\frac {a \int \left (\frac {2 a}{\left (a^2+b^2\right ) (a+b \sinh (c+d x))}+\frac {a^2-2 b \sinh (c+d x) a-b^2}{\left (a^2+b^2\right ) \left (\sinh ^2(c+d x) b^2+b^2\right )}\right )d(b \sinh (c+d x))}{2 \left (a^2+b^2\right )}-\frac {a b \sinh (c+d x)+b^2}{2 \left (a^2+b^2\right ) \left (b^2 \sinh ^2(c+d x)+b^2\right )}\right )}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {b \left (\frac {a \left (\frac {\left (a^2-b^2\right ) \arctan (\sinh (c+d x))}{b \left (a^2+b^2\right )}-\frac {a \log \left (b^2 \sinh ^2(c+d x)+b^2\right )}{a^2+b^2}+\frac {2 a \log (a+b \sinh (c+d x))}{a^2+b^2}\right )}{2 \left (a^2+b^2\right )}-\frac {a b \sinh (c+d x)+b^2}{2 \left (a^2+b^2\right ) \left (b^2 \sinh ^2(c+d x)+b^2\right )}\right )}{d}\)

Input:

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

Output:

(b*((a*(((a^2 - b^2)*ArcTan[Sinh[c + d*x]])/(b*(a^2 + b^2)) + (2*a*Log[a + 
 b*Sinh[c + d*x]])/(a^2 + b^2) - (a*Log[b^2 + b^2*Sinh[c + d*x]^2])/(a^2 + 
 b^2)))/(2*(a^2 + b^2)) - (b^2 + a*b*Sinh[c + d*x])/(2*(a^2 + b^2)*(b^2 + 
b^2*Sinh[c + d*x]^2))))/d
 

Defintions of rubi rules used

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

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 601
Int[(x_)^(m_)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbo 
l] :> With[{Qx = PolynomialQuotient[x^m*(c + d*x)^n, a + b*x^2, x], e = Coe 
ff[PolynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 0], f = Coeff[Pol 
ynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 1]}, Simp[(a*f - b*e*x) 
*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Simp[1/(2*a*(p + 1))   Int[(c 
+ d*x)^n*(a + b*x^2)^(p + 1)*ExpandToSum[(2*a*(p + 1)*Qx)/(c + d*x)^n + (e* 
(2*p + 3))/(c + d*x)^n, x], x], x]] /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 1] 
 && LtQ[p, -1] && ILtQ[n, 0] && NeQ[b*c^2 + a*d^2, 0]
 

rule 657
Int[(((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.))/((a_) + (c_.)*( 
x_)^2), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*((f + g*x)^n/(a + c*x^ 
2)), x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && IntegersQ[n]
 

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 3316
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_ 
.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[1/(b^p* 
f)   Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x, b* 
Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1) 
/2] && NeQ[a^2 - b^2, 0]
 
Maple [A] (verified)

Time = 2.07 (sec) , antiderivative size = 209, normalized size of antiderivative = 1.73

method result size
derivativedivides \(\frac {\frac {4 a^{2} b \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{4 a^{4}+8 a^{2} b^{2}+4 b^{4}}+\frac {\frac {2 \left (\left (\frac {1}{2} a^{3}+\frac {1}{2} a \,b^{2}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (a^{2} b +b^{3}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (-\frac {1}{2} a^{3}-\frac {1}{2} a \,b^{2}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}+a \left (-a b \ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )+\left (a^{2}-b^{2}\right ) \arctan \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{a^{4}+2 a^{2} b^{2}+b^{4}}}{d}\) \(209\)
default \(\frac {\frac {4 a^{2} b \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{4 a^{4}+8 a^{2} b^{2}+4 b^{4}}+\frac {\frac {2 \left (\left (\frac {1}{2} a^{3}+\frac {1}{2} a \,b^{2}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (a^{2} b +b^{3}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (-\frac {1}{2} a^{3}-\frac {1}{2} a \,b^{2}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}+a \left (-a b \ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )+\left (a^{2}-b^{2}\right ) \arctan \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{a^{4}+2 a^{2} b^{2}+b^{4}}}{d}\) \(209\)
risch \(\frac {2 a^{2} b \,d^{2} x}{a^{4} d^{2}+2 a^{2} b^{2} d^{2}+b^{4} d^{2}}+\frac {2 a^{2} b d c}{a^{4} d^{2}+2 a^{2} b^{2} d^{2}+b^{4} d^{2}}-\frac {2 a^{2} b x}{a^{4}+2 a^{2} b^{2}+b^{4}}-\frac {2 a^{2} b c}{d \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}-\frac {{\mathrm e}^{d x +c} \left ({\mathrm e}^{2 d x +2 c} a +2 b \,{\mathrm e}^{d x +c}-a \right )}{d \left (a^{2}+b^{2}\right ) \left (1+{\mathrm e}^{2 d x +2 c}\right )^{2}}-\frac {i a^{3} \ln \left ({\mathrm e}^{d x +c}-i\right )}{2 \left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) d}+\frac {i a \ln \left ({\mathrm e}^{d x +c}-i\right ) b^{2}}{2 \left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) d}-\frac {a^{2} \ln \left ({\mathrm e}^{d x +c}-i\right ) b}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) d}+\frac {i \ln \left ({\mathrm e}^{d x +c}+i\right ) a^{3}}{2 \left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) d}-\frac {i a \ln \left ({\mathrm e}^{d x +c}+i\right ) b^{2}}{2 \left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) d}-\frac {a^{2} \ln \left ({\mathrm e}^{d x +c}+i\right ) b}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) d}+\frac {a^{2} b \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {2 a \,{\mathrm e}^{d x +c}}{b}-1\right )}{d \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}\) \(451\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 917 vs. \(2 (117) = 234\).

Time = 0.11 (sec) , antiderivative size = 917, normalized size of antiderivative = 7.58 \[ \int \frac {\text {sech}(c+d x) \tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\text {Too large to display} \] Input:

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 219, normalized size of antiderivative = 1.81 \[ \int \frac {\text {sech}(c+d x) \tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {a^{2} b \log \left (-2 \, a e^{\left (-d x - c\right )} + b e^{\left (-2 \, d x - 2 \, c\right )} - b\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d} - \frac {a^{2} b \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d} - \frac {{\left (a^{3} - a b^{2}\right )} \arctan \left (e^{\left (-d x - c\right )}\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d} - \frac {a e^{\left (-d x - c\right )} + 2 \, b e^{\left (-2 \, d x - 2 \, c\right )} - a e^{\left (-3 \, d x - 3 \, c\right )}}{{\left (a^{2} + b^{2} + 2 \, {\left (a^{2} + b^{2}\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a^{2} + b^{2}\right )} e^{\left (-4 \, d x - 4 \, c\right )}\right )} d} \] Input:

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

Output:

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 281 vs. \(2 (117) = 234\).

Time = 0.16 (sec) , antiderivative size = 281, normalized size of antiderivative = 2.32 \[ \int \frac {\text {sech}(c+d x) \tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {\frac {4 \, a^{2} b^{2} \log \left ({\left | b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )} + 2 \, a \right |}\right )}{a^{4} b + 2 \, a^{2} b^{3} + b^{5}} - \frac {2 \, a^{2} b \log \left ({\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{2} + 4\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {{\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )} e^{\left (-d x - c\right )}\right )\right )} {\left (a^{3} - a b^{2}\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {2 \, {\left (a^{2} b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{2} - 2 \, a^{3} {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )} - 2 \, a b^{2} {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )} - 4 \, b^{3}\right )}}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} {\left ({\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{2} + 4\right )}}}{4 \, d} \] Input:

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

Output:

1/4*(4*a^2*b^2*log(abs(b*(e^(d*x + c) - e^(-d*x - c)) + 2*a))/(a^4*b + 2*a 
^2*b^3 + b^5) - 2*a^2*b*log((e^(d*x + c) - e^(-d*x - c))^2 + 4)/(a^4 + 2*a 
^2*b^2 + b^4) + (pi + 2*arctan(1/2*(e^(2*d*x + 2*c) - 1)*e^(-d*x - c)))*(a 
^3 - a*b^2)/(a^4 + 2*a^2*b^2 + b^4) + 2*(a^2*b*(e^(d*x + c) - e^(-d*x - c) 
)^2 - 2*a^3*(e^(d*x + c) - e^(-d*x - c)) - 2*a*b^2*(e^(d*x + c) - e^(-d*x 
- c)) - 4*b^3)/((a^4 + 2*a^2*b^2 + b^4)*((e^(d*x + c) - e^(-d*x - c))^2 + 
4)))/d
 

Mupad [B] (verification not implemented)

Time = 2.93 (sec) , antiderivative size = 339, normalized size of antiderivative = 2.80 \[ \int \frac {\text {sech}(c+d x) \tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {\frac {2\,b}{d\,\left (a^2+b^2\right )}+\frac {2\,a\,{\mathrm {e}}^{c+d\,x}}{d\,\left (a^2+b^2\right )}}{2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1}-\frac {\frac {2\,\left (a^2\,b+b^3\right )}{d\,{\left (a^2+b^2\right )}^2}+\frac {{\mathrm {e}}^{c+d\,x}\,\left (a^3+a\,b^2\right )}{d\,{\left (a^2+b^2\right )}^2}}{{\mathrm {e}}^{2\,c+2\,d\,x}+1}-\frac {a\,\ln \left (1+{\mathrm {e}}^{c+d\,x}\,1{}\mathrm {i}\right )}{2\,\left (-1{}\mathrm {i}\,d\,a^2+2\,d\,a\,b+1{}\mathrm {i}\,d\,b^2\right )}+\frac {a^2\,b\,\ln \left (2\,a^7\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c-a^2\,b^5-14\,a^4\,b^3-a^6\,b+a^6\,b\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+2\,a^3\,b^4\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c+28\,a^5\,b^2\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c+a^2\,b^5\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+14\,a^4\,b^3\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}\right )}{d\,a^4+2\,d\,a^2\,b^2+d\,b^4}-\frac {a\,\ln \left ({\mathrm {e}}^{c+d\,x}+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,\left (-d\,a^2+2{}\mathrm {i}\,d\,a\,b+d\,b^2\right )} \] Input:

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

Output:

((2*b)/(d*(a^2 + b^2)) + (2*a*exp(c + d*x))/(d*(a^2 + b^2)))/(2*exp(2*c + 
2*d*x) + exp(4*c + 4*d*x) + 1) - ((2*(a^2*b + b^3))/(d*(a^2 + b^2)^2) + (e 
xp(c + d*x)*(a*b^2 + a^3))/(d*(a^2 + b^2)^2))/(exp(2*c + 2*d*x) + 1) - (a* 
log(exp(c + d*x) + 1i)*1i)/(2*(b^2*d - a^2*d + a*b*d*2i)) - (a*log(exp(c + 
 d*x)*1i + 1))/(2*(b^2*d*1i - a^2*d*1i + 2*a*b*d)) + (a^2*b*log(2*a^7*exp( 
d*x)*exp(c) - a^2*b^5 - 14*a^4*b^3 - a^6*b + a^6*b*exp(2*c)*exp(2*d*x) + 2 
*a^3*b^4*exp(d*x)*exp(c) + 28*a^5*b^2*exp(d*x)*exp(c) + a^2*b^5*exp(2*c)*e 
xp(2*d*x) + 14*a^4*b^3*exp(2*c)*exp(2*d*x)))/(a^4*d + b^4*d + 2*a^2*b^2*d)
 

Reduce [B] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 520, normalized size of antiderivative = 4.30 \[ \int \frac {\text {sech}(c+d x) \tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {e^{4 d x +4 c} \mathit {atan} \left (e^{d x +c}\right ) a^{3}-e^{4 d x +4 c} \mathit {atan} \left (e^{d x +c}\right ) a \,b^{2}+2 e^{2 d x +2 c} \mathit {atan} \left (e^{d x +c}\right ) a^{3}-2 e^{2 d x +2 c} \mathit {atan} \left (e^{d x +c}\right ) a \,b^{2}+\mathit {atan} \left (e^{d x +c}\right ) a^{3}-\mathit {atan} \left (e^{d x +c}\right ) a \,b^{2}-e^{4 d x +4 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a^{2} b +e^{4 d x +4 c} \mathrm {log}\left (e^{2 d x +2 c} b +2 e^{d x +c} a -b \right ) a^{2} b +e^{4 d x +4 c} a^{2} b +e^{4 d x +4 c} b^{3}-e^{3 d x +3 c} a^{3}-e^{3 d x +3 c} a \,b^{2}-2 e^{2 d x +2 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a^{2} b +2 e^{2 d x +2 c} \mathrm {log}\left (e^{2 d x +2 c} b +2 e^{d x +c} a -b \right ) a^{2} b +e^{d x +c} a^{3}+e^{d x +c} a \,b^{2}-\mathrm {log}\left (e^{2 d x +2 c}+1\right ) a^{2} b +\mathrm {log}\left (e^{2 d x +2 c} b +2 e^{d x +c} a -b \right ) a^{2} b +a^{2} b +b^{3}}{d \left (e^{4 d x +4 c} a^{4}+2 e^{4 d x +4 c} a^{2} b^{2}+e^{4 d x +4 c} b^{4}+2 e^{2 d x +2 c} a^{4}+4 e^{2 d x +2 c} a^{2} b^{2}+2 e^{2 d x +2 c} b^{4}+a^{4}+2 a^{2} b^{2}+b^{4}\right )} \] Input:

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

Output:

(e**(4*c + 4*d*x)*atan(e**(c + d*x))*a**3 - e**(4*c + 4*d*x)*atan(e**(c + 
d*x))*a*b**2 + 2*e**(2*c + 2*d*x)*atan(e**(c + d*x))*a**3 - 2*e**(2*c + 2* 
d*x)*atan(e**(c + d*x))*a*b**2 + atan(e**(c + d*x))*a**3 - atan(e**(c + d* 
x))*a*b**2 - e**(4*c + 4*d*x)*log(e**(2*c + 2*d*x) + 1)*a**2*b + e**(4*c + 
 4*d*x)*log(e**(2*c + 2*d*x)*b + 2*e**(c + d*x)*a - b)*a**2*b + e**(4*c + 
4*d*x)*a**2*b + e**(4*c + 4*d*x)*b**3 - e**(3*c + 3*d*x)*a**3 - e**(3*c + 
3*d*x)*a*b**2 - 2*e**(2*c + 2*d*x)*log(e**(2*c + 2*d*x) + 1)*a**2*b + 2*e* 
*(2*c + 2*d*x)*log(e**(2*c + 2*d*x)*b + 2*e**(c + d*x)*a - b)*a**2*b + e** 
(c + d*x)*a**3 + e**(c + d*x)*a*b**2 - log(e**(2*c + 2*d*x) + 1)*a**2*b + 
log(e**(2*c + 2*d*x)*b + 2*e**(c + d*x)*a - b)*a**2*b + a**2*b + b**3)/(d* 
(e**(4*c + 4*d*x)*a**4 + 2*e**(4*c + 4*d*x)*a**2*b**2 + e**(4*c + 4*d*x)*b 
**4 + 2*e**(2*c + 2*d*x)*a**4 + 4*e**(2*c + 2*d*x)*a**2*b**2 + 2*e**(2*c + 
 2*d*x)*b**4 + a**4 + 2*a**2*b**2 + b**4))