\(\int \frac {\text {csch}(x)}{a+b \cosh ^2(x)} \, dx\) [10]

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 = 13, antiderivative size = 42 \[ \int \frac {\text {csch}(x)}{a+b \cosh ^2(x)} \, dx=-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \cosh (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\text {arctanh}(\cosh (x))}{a+b} \] Output:

-b^(1/2)*arctan(b^(1/2)*cosh(x)/a^(1/2))/a^(1/2)/(a+b)-arctanh(cosh(x))/(a 
+b)
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

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

Integrate[Csch[x]/(a + b*Cosh[x]^2),x]
 

Output:

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

Rubi [A] (verified)

Time = 0.24 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3042, 26, 3669, 303, 218, 219}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 3669

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

\(\Big \downarrow \) 303

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

\(\Big \downarrow \) 218

\(\displaystyle -\frac {\int \frac {1}{1-\cosh ^2(x)}d\cosh (x)}{a+b}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \cosh (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}\)

\(\Big \downarrow \) 219

\(\displaystyle -\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \cosh (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\text {arctanh}(\cosh (x))}{a+b}\)

Input:

Int[Csch[x]/(a + b*Cosh[x]^2),x]
 

Output:

-((Sqrt[b]*ArcTan[(Sqrt[b]*Cosh[x])/Sqrt[a]])/(Sqrt[a]*(a + b))) - ArcTanh 
[Cosh[x]]/(a + b)
 

Defintions of rubi rules used

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 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

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 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 3669
Int[cos[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^ 
(p_.), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f   S 
ubst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b*ff^2*x^2)^p, x], x, Sin[e + f*x] 
/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]
 
Maple [A] (verified)

Time = 3.62 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.24

method result size
default \(-\frac {b \arctan \left (\frac {2 \left (a +b \right ) \tanh \left (\frac {x}{2}\right )^{2}-2 a +2 b}{4 \sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a +b}\) \(52\)
risch \(\frac {\ln \left ({\mathrm e}^{x}-1\right )}{a +b}-\frac {\ln \left ({\mathrm e}^{x}+1\right )}{a +b}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 x}-\frac {2 \sqrt {-a b}\, {\mathrm e}^{x}}{b}+1\right )}{2 a \left (a +b \right )}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 x}+\frac {2 \sqrt {-a b}\, {\mathrm e}^{x}}{b}+1\right )}{2 a \left (a +b \right )}\) \(97\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 114 vs. \(2 (34) = 68\).

Time = 0.12 (sec) , antiderivative size = 349, normalized size of antiderivative = 8.31 \[ \int \frac {\text {csch}(x)}{a+b \cosh ^2(x)} \, dx=\left [\frac {\sqrt {-\frac {b}{a}} \log \left (\frac {b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} - 2 \, {\left (2 \, a - b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} - 2 \, a + b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} - {\left (2 \, a - b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) - 4 \, {\left (a \cosh \left (x\right )^{3} + 3 \, a \cosh \left (x\right ) \sinh \left (x\right )^{2} + a \sinh \left (x\right )^{3} + a \cosh \left (x\right ) + {\left (3 \, a \cosh \left (x\right )^{2} + a\right )} \sinh \left (x\right )\right )} \sqrt {-\frac {b}{a}} + b}{b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, {\left (2 \, a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} + 2 \, a + b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} + {\left (2 \, a + b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}\right ) - 2 \, \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) + 2 \, \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right )}{2 \, {\left (a + b\right )}}, -\frac {\sqrt {\frac {b}{a}} \arctan \left (\frac {1}{2} \, \sqrt {\frac {b}{a}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}\right ) - \sqrt {\frac {b}{a}} \arctan \left (\frac {{\left (b \cosh \left (x\right )^{3} + 3 \, b \cosh \left (x\right ) \sinh \left (x\right )^{2} + b \sinh \left (x\right )^{3} + {\left (4 \, a + b\right )} \cosh \left (x\right ) + {\left (3 \, b \cosh \left (x\right )^{2} + 4 \, a + b\right )} \sinh \left (x\right )\right )} \sqrt {\frac {b}{a}}}{2 \, b}\right ) + \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right )}{a + b}\right ] \] Input:

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

Output:

[1/2*(sqrt(-b/a)*log((b*cosh(x)^4 + 4*b*cosh(x)*sinh(x)^3 + b*sinh(x)^4 - 
2*(2*a - b)*cosh(x)^2 + 2*(3*b*cosh(x)^2 - 2*a + b)*sinh(x)^2 + 4*(b*cosh( 
x)^3 - (2*a - b)*cosh(x))*sinh(x) - 4*(a*cosh(x)^3 + 3*a*cosh(x)*sinh(x)^2 
 + a*sinh(x)^3 + a*cosh(x) + (3*a*cosh(x)^2 + a)*sinh(x))*sqrt(-b/a) + b)/ 
(b*cosh(x)^4 + 4*b*cosh(x)*sinh(x)^3 + b*sinh(x)^4 + 2*(2*a + b)*cosh(x)^2 
 + 2*(3*b*cosh(x)^2 + 2*a + b)*sinh(x)^2 + 4*(b*cosh(x)^3 + (2*a + b)*cosh 
(x))*sinh(x) + b)) - 2*log(cosh(x) + sinh(x) + 1) + 2*log(cosh(x) + sinh(x 
) - 1))/(a + b), -(sqrt(b/a)*arctan(1/2*sqrt(b/a)*(cosh(x) + sinh(x))) - s 
qrt(b/a)*arctan(1/2*(b*cosh(x)^3 + 3*b*cosh(x)*sinh(x)^2 + b*sinh(x)^3 + ( 
4*a + b)*cosh(x) + (3*b*cosh(x)^2 + 4*a + b)*sinh(x))*sqrt(b/a)/b) + log(c 
osh(x) + sinh(x) + 1) - log(cosh(x) + sinh(x) - 1))/(a + b)]
 

Sympy [F]

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

integrate(csch(x)/(a+b*cosh(x)**2),x)
 

Output:

Integral(csch(x)/(a + b*cosh(x)**2), x)
 

Maxima [F]

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

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

Output:

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

Giac [F(-2)]

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

integrate(csch(x)/(a+b*cosh(x)^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 = 2.55 (sec) , antiderivative size = 462, normalized size of antiderivative = 11.00 \[ \int \frac {\text {csch}(x)}{a+b \cosh ^2(x)} \, dx=-\frac {2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^x\,\left (16\,a^2\,\sqrt {-a^2-2\,a\,b-b^2}+b^2\,\sqrt {-a^2-2\,a\,b-b^2}+8\,a\,b\,\sqrt {-a^2-2\,a\,b-b^2}\right )}{16\,a^3+24\,a^2\,b+9\,a\,b^2+b^3}\right )}{\sqrt {-a^2-2\,a\,b-b^2}}-\frac {\sqrt {b}\,\left (2\,\mathrm {atan}\left (\frac {\sqrt {b}\,{\mathrm {e}}^x\,\sqrt {a\,{\left (a+b\right )}^2}}{2\,a\,\left (a+b\right )}\right )-2\,\mathrm {atan}\left (\frac {\left (a^3\,b^{5/2}\,\sqrt {a^3+2\,a^2\,b+a\,b^2}+a^2\,b^{7/2}\,\sqrt {a^3+2\,a^2\,b+a\,b^2}\right )\,\left ({\mathrm {e}}^x\,\left (\frac {64\,\left (8\,a^3+10\,a^2\,b+2\,a\,b^2\right )}{a\,b^3\,\sqrt {a\,{\left (a+b\right )}^2}\,\left (a^2+b\,a\right )\,\sqrt {a^3+2\,a^2\,b+a\,b^2}}+\frac {32\,\left (b^{3/2}\,\sqrt {a^3+2\,a^2\,b+a\,b^2}+4\,a\,\sqrt {b}\,\sqrt {a^3+2\,a^2\,b+a\,b^2}\right )}{a^2\,b^{5/2}\,\left (a+b\right )\,\left (a^2+b\,a\right )\,\sqrt {a^3+2\,a^2\,b+a\,b^2}}\right )+\frac {32\,{\mathrm {e}}^{3\,x}\,\left (b^{3/2}\,\sqrt {a^3+2\,a^2\,b+a\,b^2}+4\,a\,\sqrt {b}\,\sqrt {a^3+2\,a^2\,b+a\,b^2}\right )}{a^2\,b^{5/2}\,\left (a+b\right )\,\left (a^2+b\,a\right )\,\sqrt {a^3+2\,a^2\,b+a\,b^2}}\right )}{256\,a+64\,b}\right )\right )}{2\,\sqrt {a^3+2\,a^2\,b+a\,b^2}} \] Input:

int(1/(sinh(x)*(a + b*cosh(x)^2)),x)
 

Output:

- (2*atan((exp(x)*(16*a^2*(- 2*a*b - a^2 - b^2)^(1/2) + b^2*(- 2*a*b - a^2 
 - b^2)^(1/2) + 8*a*b*(- 2*a*b - a^2 - b^2)^(1/2)))/(9*a*b^2 + 24*a^2*b + 
16*a^3 + b^3)))/(- 2*a*b - a^2 - b^2)^(1/2) - (b^(1/2)*(2*atan((b^(1/2)*ex 
p(x)*(a*(a + b)^2)^(1/2))/(2*a*(a + b))) - 2*atan(((a^3*b^(5/2)*(a*b^2 + 2 
*a^2*b + a^3)^(1/2) + a^2*b^(7/2)*(a*b^2 + 2*a^2*b + a^3)^(1/2))*(exp(x)*( 
(64*(2*a*b^2 + 10*a^2*b + 8*a^3))/(a*b^3*(a*(a + b)^2)^(1/2)*(a*b + a^2)*( 
a*b^2 + 2*a^2*b + a^3)^(1/2)) + (32*(b^(3/2)*(a*b^2 + 2*a^2*b + a^3)^(1/2) 
 + 4*a*b^(1/2)*(a*b^2 + 2*a^2*b + a^3)^(1/2)))/(a^2*b^(5/2)*(a + b)*(a*b + 
 a^2)*(a*b^2 + 2*a^2*b + a^3)^(1/2))) + (32*exp(3*x)*(b^(3/2)*(a*b^2 + 2*a 
^2*b + a^3)^(1/2) + 4*a*b^(1/2)*(a*b^2 + 2*a^2*b + a^3)^(1/2)))/(a^2*b^(5/ 
2)*(a + b)*(a*b + a^2)*(a*b^2 + 2*a^2*b + a^3)^(1/2))))/(256*a + 64*b))))/ 
(2*(a*b^2 + 2*a^2*b + a^3)^(1/2))
 

Reduce [B] (verification not implemented)

Time = 0.43 (sec) , antiderivative size = 321, normalized size of antiderivative = 7.64 \[ \int \frac {\text {csch}(x)}{a+b \cosh ^2(x)} \, dx=\frac {-2 \sqrt {b}\, \sqrt {a}\, \sqrt {a +b}\, \sqrt {2 \sqrt {a}\, \sqrt {a +b}+2 a +b}\, \mathit {atan} \left (\frac {e^{x} b}{\sqrt {b}\, \sqrt {2 \sqrt {a}\, \sqrt {a +b}+2 a +b}}\right )+2 \sqrt {b}\, \sqrt {2 \sqrt {a}\, \sqrt {a +b}+2 a +b}\, \mathit {atan} \left (\frac {e^{x} b}{\sqrt {b}\, \sqrt {2 \sqrt {a}\, \sqrt {a +b}+2 a +b}}\right ) a -\sqrt {b}\, \sqrt {a}\, \sqrt {a +b}\, \sqrt {2 \sqrt {a}\, \sqrt {a +b}-2 a -b}\, \mathrm {log}\left (-\sqrt {2 \sqrt {a}\, \sqrt {a +b}-2 a -b}+e^{x} \sqrt {b}\right )+\sqrt {b}\, \sqrt {a}\, \sqrt {a +b}\, \sqrt {2 \sqrt {a}\, \sqrt {a +b}-2 a -b}\, \mathrm {log}\left (\sqrt {2 \sqrt {a}\, \sqrt {a +b}-2 a -b}+e^{x} \sqrt {b}\right )-\sqrt {b}\, \sqrt {2 \sqrt {a}\, \sqrt {a +b}-2 a -b}\, \mathrm {log}\left (-\sqrt {2 \sqrt {a}\, \sqrt {a +b}-2 a -b}+e^{x} \sqrt {b}\right ) a +\sqrt {b}\, \sqrt {2 \sqrt {a}\, \sqrt {a +b}-2 a -b}\, \mathrm {log}\left (\sqrt {2 \sqrt {a}\, \sqrt {a +b}-2 a -b}+e^{x} \sqrt {b}\right ) a +2 \,\mathrm {log}\left (e^{x}-1\right ) a b -2 \,\mathrm {log}\left (e^{x}+1\right ) a b}{2 a b \left (a +b \right )} \] Input:

int(csch(x)/(a+b*cosh(x)^2),x)
 

Output:

( - 2*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(a)*sqrt(a + b) + 2*a + b)*at 
an((e**x*b)/(sqrt(b)*sqrt(2*sqrt(a)*sqrt(a + b) + 2*a + b))) + 2*sqrt(b)*s 
qrt(2*sqrt(a)*sqrt(a + b) + 2*a + b)*atan((e**x*b)/(sqrt(b)*sqrt(2*sqrt(a) 
*sqrt(a + b) + 2*a + b)))*a - sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(a)*s 
qrt(a + b) - 2*a - b)*log( - sqrt(2*sqrt(a)*sqrt(a + b) - 2*a - b) + e**x* 
sqrt(b)) + sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(a)*sqrt(a + b) - 2*a - 
b)*log(sqrt(2*sqrt(a)*sqrt(a + b) - 2*a - b) + e**x*sqrt(b)) - sqrt(b)*sqr 
t(2*sqrt(a)*sqrt(a + b) - 2*a - b)*log( - sqrt(2*sqrt(a)*sqrt(a + b) - 2*a 
 - b) + e**x*sqrt(b))*a + sqrt(b)*sqrt(2*sqrt(a)*sqrt(a + b) - 2*a - b)*lo 
g(sqrt(2*sqrt(a)*sqrt(a + b) - 2*a - b) + e**x*sqrt(b))*a + 2*log(e**x - 1 
)*a*b - 2*log(e**x + 1)*a*b)/(2*a*b*(a + b))