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

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

Optimal result

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

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.41 (sec) , antiderivative size = 135, normalized size of antiderivative = 2.45 \[ \int \frac {\text {csch}(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {\frac {i \sqrt {b} \arctan \left (\frac {-i \sqrt {a+b}-\sqrt {a} \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b}}\right )}{\sqrt {a+b}}+\frac {i \sqrt {b} \arctan \left (\frac {-i \sqrt {a+b}+\sqrt {a} \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b}}\right )}{\sqrt {a+b}}-\log \left (\cosh \left (\frac {1}{2} (c+d x)\right )\right )+\log \left (\sinh \left (\frac {1}{2} (c+d x)\right )\right )}{a d} \] Input:

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

Output:

((I*Sqrt[b]*ArcTan[((-I)*Sqrt[a + b] - Sqrt[a]*Tanh[(c + d*x)/2])/Sqrt[b]] 
)/Sqrt[a + b] + (I*Sqrt[b]*ArcTan[((-I)*Sqrt[a + b] + Sqrt[a]*Tanh[(c + d* 
x)/2])/Sqrt[b]])/Sqrt[a + b] - Log[Cosh[(c + d*x)/2]] + Log[Sinh[(c + d*x) 
/2]])/(a*d)
 

Rubi [A] (verified)

Time = 0.28 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.96, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 26, 4147, 25, 303, 219, 221}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 4147

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 303

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

\(\Big \downarrow \) 219

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

\(\Big \downarrow \) 221

\(\displaystyle \frac {\frac {\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \text {sech}(c+d x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b}}-\frac {\text {arctanh}(\text {sech}(c+d x))}{a}}{d}\)

Input:

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

Output:

(-(ArcTanh[Sech[c + d*x]]/a) + (Sqrt[b]*ArcTanh[(Sqrt[b]*Sech[c + d*x])/Sq 
rt[a + b]])/(a*Sqrt[a + b]))/d
 

Defintions of rubi rules used

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 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 303
Int[1/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Simp[b/(b 
*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[d/(b*c - a*d)   Int[1/(c + d*x 
^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]
 

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

rule 4147
Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^ 
(p_.), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Simp[1/(f*ff^ 
m)   Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m + 1 
)), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[( 
m - 1)/2]
 
Maple [A] (verified)

Time = 0.98 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.22

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

Input:

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

Output:

1/d*(b/a/(a*b+b^2)^(1/2)*arctanh(1/4*(2*tanh(1/2*d*x+1/2*c)^2*a+2*a+4*b)/( 
a*b+b^2)^(1/2))+1/a*ln(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. 197 vs. \(2 (47) = 94\).

Time = 0.13 (sec) , antiderivative size = 587, normalized size of antiderivative = 10.67 \[ \int \frac {\text {csch}(c+d x)}{a+b \tanh ^2(c+d x)} \, dx =\text {Too large to display} \] Input:

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

Output:

[1/2*(sqrt(b/(a + b))*log(((a + b)*cosh(d*x + c)^4 + 4*(a + b)*cosh(d*x + 
c)*sinh(d*x + c)^3 + (a + b)*sinh(d*x + c)^4 + 2*(a + 3*b)*cosh(d*x + c)^2 
 + 2*(3*(a + b)*cosh(d*x + c)^2 + a + 3*b)*sinh(d*x + c)^2 + 4*((a + b)*co 
sh(d*x + c)^3 + (a + 3*b)*cosh(d*x + c))*sinh(d*x + c) + 4*((a + b)*cosh(d 
*x + c)^3 + 3*(a + b)*cosh(d*x + c)*sinh(d*x + c)^2 + (a + b)*sinh(d*x + c 
)^3 + (a + b)*cosh(d*x + c) + (3*(a + b)*cosh(d*x + c)^2 + a + b)*sinh(d*x 
 + c))*sqrt(b/(a + b)) + a + b)/((a + b)*cosh(d*x + c)^4 + 4*(a + b)*cosh( 
d*x + c)*sinh(d*x + c)^3 + (a + b)*sinh(d*x + c)^4 + 2*(a - b)*cosh(d*x + 
c)^2 + 2*(3*(a + b)*cosh(d*x + c)^2 + a - b)*sinh(d*x + c)^2 + 4*((a + b)* 
cosh(d*x + c)^3 + (a - b)*cosh(d*x + c))*sinh(d*x + c) + a + b)) - 2*log(c 
osh(d*x + c) + sinh(d*x + c) + 1) + 2*log(cosh(d*x + c) + sinh(d*x + c) - 
1))/(a*d), (sqrt(-b/(a + b))*arctan(1/2*((a + b)*cosh(d*x + c)^3 + 3*(a + 
b)*cosh(d*x + c)*sinh(d*x + c)^2 + (a + b)*sinh(d*x + c)^3 + (a - 3*b)*cos 
h(d*x + c) + (3*(a + b)*cosh(d*x + c)^2 + a - 3*b)*sinh(d*x + c))*sqrt(-b/ 
(a + b))/b) - sqrt(-b/(a + b))*arctan(1/2*((a + b)*cosh(d*x + c) + (a + b) 
*sinh(d*x + c))*sqrt(-b/(a + b))/b) - log(cosh(d*x + c) + sinh(d*x + c) + 
1) + log(cosh(d*x + c) + sinh(d*x + c) - 1))/(a*d)]
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F(-2)]

Exception generated. \[ \int \frac {\text {csch}(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\text {Exception raised: TypeError} \] Input:

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

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Limit: Max order reached or unable 
to make series expansion Error: Bad Argument Value
 

Mupad [B] (verification not implemented)

Time = 1.97 (sec) , antiderivative size = 284, normalized size of antiderivative = 5.16 \[ \int \frac {\text {csch}(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (9\,b^4\,\sqrt {-a^2\,d^2}+16\,a^2\,b^2\,\sqrt {-a^2\,d^2}+24\,a\,b^3\,\sqrt {-a^2\,d^2}\right )}{16\,d\,a^3\,b^2+24\,d\,a^2\,b^3+9\,d\,a\,b^4}\right )}{\sqrt {-a^2\,d^2}}-\frac {\sqrt {b}\,\left (2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}\,\sqrt {-a^2\,d^2\,\left (a+b\right )}+{\mathrm {e}}^{3\,c}\,{\mathrm {e}}^{3\,d\,x}\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}\,\sqrt {-a^2\,d^2\,\left (a+b\right )}+4\,a^2\,b\,d^2\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c}{2\,a\,\sqrt {b}\,d\,\sqrt {-a^2\,d^2\,\left (a+b\right )}}\right )-2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\sqrt {-a^2\,d^2\,\left (a+b\right )}}{2\,a\,\sqrt {b}\,d}\right )\right )}{2\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 145, normalized size of antiderivative = 2.64 \[ \int \frac {\text {csch}(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {-\sqrt {b}\, \sqrt {a +b}\, \mathrm {log}\left (e^{2 d x +2 c} \sqrt {a +b}+\sqrt {a +b}-2 e^{d x +c} \sqrt {b}\right )+\sqrt {b}\, \sqrt {a +b}\, \mathrm {log}\left (e^{2 d x +2 c} \sqrt {a +b}+\sqrt {a +b}+2 e^{d x +c} \sqrt {b}\right )+2 \,\mathrm {log}\left (e^{d x +c}-1\right ) a +2 \,\mathrm {log}\left (e^{d x +c}-1\right ) b -2 \,\mathrm {log}\left (e^{d x +c}+1\right ) a -2 \,\mathrm {log}\left (e^{d x +c}+1\right ) b}{2 a d \left (a +b \right )} \] Input:

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

Output:

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