3.2.38 \(\int \coth (c-b x) \coth (a+b x) \, dx\) [138]

3.2.38.1 Optimal result
3.2.38.2 Mathematica [A] (verified)
3.2.38.3 Rubi [C] (verified)
3.2.38.4 Maple [B] (verified)
3.2.38.5 Fricas [B] (verification not implemented)
3.2.38.6 Sympy [F]
3.2.38.7 Maxima [B] (verification not implemented)
3.2.38.8 Giac [B] (verification not implemented)
3.2.38.9 Mupad [B] (verification not implemented)

3.2.38.1 Optimal result

Integrand size = 14, antiderivative size = 36 \[ \int \coth (c-b x) \coth (a+b x) \, dx=-x-\frac {\coth (a+c) \log (\sinh (c-b x))}{b}+\frac {\coth (a+c) \log (\sinh (a+b x))}{b} \]

output
-x-coth(a+c)*ln(-sinh(b*x-c))/b+coth(a+c)*ln(sinh(b*x+a))/b
 
3.2.38.2 Mathematica [A] (verified)

Time = 0.31 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.89 \[ \int \coth (c-b x) \coth (a+b x) \, dx=-x+\frac {\coth (a+c) (-\log (\sinh (c-b x))+\log (-\sinh (a+b x)))}{b} \]

input
Integrate[Coth[c - b*x]*Coth[a + b*x],x]
 
output
-x + (Coth[a + c]*(-Log[Sinh[c - b*x]] + Log[-Sinh[a + b*x]]))/b
 
3.2.38.3 Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 0.31 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.39, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {6181, 6179, 3042, 26, 3956}

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 \coth (a+b x) \coth (c-b x) \, dx\)

\(\Big \downarrow \) 6181

\(\displaystyle \cosh (a+c) \int \text {csch}(c-b x) \text {csch}(a+b x)dx-x\)

\(\Big \downarrow \) 6179

\(\displaystyle \cosh (a+c) (\text {csch}(a+c) \int \coth (c-b x)dx+\text {csch}(a+c) \int \coth (a+b x)dx)-x\)

\(\Big \downarrow \) 3042

\(\displaystyle -x+\cosh (a+c) \left (\text {csch}(a+c) \int -i \tan \left (i c-i b x+\frac {\pi }{2}\right )dx+\text {csch}(a+c) \int -i \tan \left (i a+i b x+\frac {\pi }{2}\right )dx\right )\)

\(\Big \downarrow \) 26

\(\displaystyle -x+\cosh (a+c) \left (-i \text {csch}(a+c) \int \tan \left (\frac {1}{2} (2 i c+\pi )-i b x\right )dx-i \text {csch}(a+c) \int \tan \left (\frac {1}{2} (2 i a+\pi )+i b x\right )dx\right )\)

\(\Big \downarrow \) 3956

\(\displaystyle -x+\cosh (a+c) \left (\frac {\text {csch}(a+c) \log (-i \sinh (a+b x))}{b}-\frac {\text {csch}(a+c) \log (-i \sinh (c-b x))}{b}\right )\)

input
Int[Coth[c - b*x]*Coth[a + b*x],x]
 
output
-x + Cosh[a + c]*(-((Csch[a + c]*Log[(-I)*Sinh[c - b*x]])/b) + (Csch[a + c 
]*Log[(-I)*Sinh[a + b*x]])/b)
 

3.2.38.3.1 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 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3956
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d 
*x], x]]/d, x] /; FreeQ[{c, d}, x]
 

rule 6179
Int[Csch[(a_.) + (b_.)*(x_)]*Csch[(c_) + (d_.)*(x_)], x_Symbol] :> Simp[Csc 
h[(b*c - a*d)/b]   Int[Coth[a + b*x], x], x] - Simp[Csch[(b*c - a*d)/d]   I 
nt[Coth[c + d*x], x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[b^2 - d^2, 0] && 
NeQ[b*c - a*d, 0]
 

rule 6181
Int[Coth[(a_.) + (b_.)*(x_)]*Coth[(c_) + (d_.)*(x_)], x_Symbol] :> Simp[b*( 
x/d), x] + Simp[Cosh[(b*c - a*d)/d]   Int[Csch[a + b*x]*Csch[c + d*x], x], 
x] /; FreeQ[{a, b, c, d}, x] && EqQ[b^2 - d^2, 0] && NeQ[b*c - a*d, 0]
 
3.2.38.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(152\) vs. \(2(39)=78\).

Time = 0.25 (sec) , antiderivative size = 153, normalized size of antiderivative = 4.25

method result size
risch \(-x -\frac {\ln \left (-{\mathrm e}^{2 a +2 c}+{\mathrm e}^{2 b x +2 a}\right ) {\mathrm e}^{2 a +2 c}}{b \left ({\mathrm e}^{2 a +2 c}-1\right )}-\frac {\ln \left (-{\mathrm e}^{2 a +2 c}+{\mathrm e}^{2 b x +2 a}\right )}{b \left ({\mathrm e}^{2 a +2 c}-1\right )}+\frac {\ln \left ({\mathrm e}^{2 b x +2 a}-1\right ) {\mathrm e}^{2 a +2 c}}{b \left ({\mathrm e}^{2 a +2 c}-1\right )}+\frac {\ln \left ({\mathrm e}^{2 b x +2 a}-1\right )}{b \left ({\mathrm e}^{2 a +2 c}-1\right )}\) \(153\)

input
int(-coth(b*x-c)*coth(b*x+a),x,method=_RETURNVERBOSE)
 
output
-x-1/b/(exp(2*a+2*c)-1)*ln(-exp(2*a+2*c)+exp(2*b*x+2*a))*exp(2*a+2*c)-1/b/ 
(exp(2*a+2*c)-1)*ln(-exp(2*a+2*c)+exp(2*b*x+2*a))+1/b/(exp(2*a+2*c)-1)*ln( 
exp(2*b*x+2*a)-1)*exp(2*a+2*c)+1/b/(exp(2*a+2*c)-1)*ln(exp(2*b*x+2*a)-1)
 
3.2.38.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 216 vs. \(2 (39) = 78\).

Time = 0.27 (sec) , antiderivative size = 216, normalized size of antiderivative = 6.00 \[ \int \coth (c-b x) \coth (a+b x) \, dx=-\frac {b x \cosh \left (a + c\right )^{2} - 2 \, b x \cosh \left (a + c\right ) \sinh \left (a + c\right ) + b x \sinh \left (a + c\right )^{2} - b x - {\left (\cosh \left (a + c\right )^{2} - 2 \, \cosh \left (a + c\right ) \sinh \left (a + c\right ) + \sinh \left (a + c\right )^{2} + 1\right )} \log \left (\frac {2 \, {\left (\cosh \left (a + c\right ) \sinh \left (b x + a\right ) - \cosh \left (b x + a\right ) \sinh \left (a + c\right )\right )}}{\cosh \left (b x + a\right ) \cosh \left (a + c\right ) - {\left (\cosh \left (a + c\right ) + \sinh \left (a + c\right )\right )} \sinh \left (b x + a\right ) + \cosh \left (b x + a\right ) \sinh \left (a + c\right )}\right ) + {\left (\cosh \left (a + c\right )^{2} - 2 \, \cosh \left (a + c\right ) \sinh \left (a + c\right ) + \sinh \left (a + c\right )^{2} + 1\right )} \log \left (\frac {2 \, \sinh \left (b x + a\right )}{\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )}\right )}{b \cosh \left (a + c\right )^{2} - 2 \, b \cosh \left (a + c\right ) \sinh \left (a + c\right ) + b \sinh \left (a + c\right )^{2} - b} \]

input
integrate(-coth(b*x-c)*coth(b*x+a),x, algorithm="fricas")
 
output
-(b*x*cosh(a + c)^2 - 2*b*x*cosh(a + c)*sinh(a + c) + b*x*sinh(a + c)^2 - 
b*x - (cosh(a + c)^2 - 2*cosh(a + c)*sinh(a + c) + sinh(a + c)^2 + 1)*log( 
2*(cosh(a + c)*sinh(b*x + a) - cosh(b*x + a)*sinh(a + c))/(cosh(b*x + a)*c 
osh(a + c) - (cosh(a + c) + sinh(a + c))*sinh(b*x + a) + cosh(b*x + a)*sin 
h(a + c))) + (cosh(a + c)^2 - 2*cosh(a + c)*sinh(a + c) + sinh(a + c)^2 + 
1)*log(2*sinh(b*x + a)/(cosh(b*x + a) - sinh(b*x + a))))/(b*cosh(a + c)^2 
- 2*b*cosh(a + c)*sinh(a + c) + b*sinh(a + c)^2 - b)
 
3.2.38.6 Sympy [F]

\[ \int \coth (c-b x) \coth (a+b x) \, dx=- \int \coth {\left (a + b x \right )} \coth {\left (b x - c \right )}\, dx \]

input
integrate(-coth(b*x-c)*coth(b*x+a),x)
 
output
-Integral(coth(a + b*x)*coth(b*x - c), x)
 
3.2.38.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 160 vs. \(2 (39) = 78\).

Time = 0.22 (sec) , antiderivative size = 160, normalized size of antiderivative = 4.44 \[ \int \coth (c-b x) \coth (a+b x) \, dx=-x - \frac {a}{b} + \frac {{\left (e^{\left (2 \, a + 2 \, c\right )} + 1\right )} \log \left (e^{\left (-b x - a\right )} + 1\right )}{b {\left (e^{\left (2 \, a + 2 \, c\right )} - 1\right )}} + \frac {{\left (e^{\left (2 \, a + 2 \, c\right )} + 1\right )} \log \left (e^{\left (-b x - a\right )} - 1\right )}{b {\left (e^{\left (2 \, a + 2 \, c\right )} - 1\right )}} - \frac {{\left (e^{\left (2 \, a + 2 \, c\right )} + 1\right )} \log \left (e^{\left (-b x + c\right )} + 1\right )}{b {\left (e^{\left (2 \, a + 2 \, c\right )} - 1\right )}} - \frac {{\left (e^{\left (2 \, a + 2 \, c\right )} + 1\right )} \log \left (e^{\left (-b x + c\right )} - 1\right )}{b {\left (e^{\left (2 \, a + 2 \, c\right )} - 1\right )}} \]

input
integrate(-coth(b*x-c)*coth(b*x+a),x, algorithm="maxima")
 
output
-x - a/b + (e^(2*a + 2*c) + 1)*log(e^(-b*x - a) + 1)/(b*(e^(2*a + 2*c) - 1 
)) + (e^(2*a + 2*c) + 1)*log(e^(-b*x - a) - 1)/(b*(e^(2*a + 2*c) - 1)) - ( 
e^(2*a + 2*c) + 1)*log(e^(-b*x + c) + 1)/(b*(e^(2*a + 2*c) - 1)) - (e^(2*a 
 + 2*c) + 1)*log(e^(-b*x + c) - 1)/(b*(e^(2*a + 2*c) - 1))
 
3.2.38.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 90 vs. \(2 (39) = 78\).

Time = 0.28 (sec) , antiderivative size = 90, normalized size of antiderivative = 2.50 \[ \int \coth (c-b x) \coth (a+b x) \, dx=-\frac {b x + \frac {{\left (e^{\left (2 \, a + 2 \, c\right )} + 1\right )} \log \left ({\left | e^{\left (2 \, b x\right )} - e^{\left (2 \, c\right )} \right |}\right )}{e^{\left (2 \, a + 2 \, c\right )} - 1} + \frac {{\left (e^{\left (2 \, a\right )} + e^{\left (4 \, a + 2 \, c\right )}\right )} \log \left ({\left | e^{\left (2 \, b x + 2 \, a\right )} - 1 \right |}\right )}{e^{\left (2 \, a\right )} - e^{\left (4 \, a + 2 \, c\right )}}}{b} \]

input
integrate(-coth(b*x-c)*coth(b*x+a),x, algorithm="giac")
 
output
-(b*x + (e^(2*a + 2*c) + 1)*log(abs(e^(2*b*x) - e^(2*c)))/(e^(2*a + 2*c) - 
 1) + (e^(2*a) + e^(4*a + 2*c))*log(abs(e^(2*b*x + 2*a) - 1))/(e^(2*a) - e 
^(4*a + 2*c)))/b
 
3.2.38.9 Mupad [B] (verification not implemented)

Time = 2.56 (sec) , antiderivative size = 121, normalized size of antiderivative = 3.36 \[ \int \coth (c-b x) \coth (a+b x) \, dx=\frac {\mathrm {coth}\left (a+c\right )\,\ln \left (4\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,c}+4\,{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{4\,c}-4\,{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,b\,x}-4\,{\mathrm {e}}^{6\,a}\,{\mathrm {e}}^{4\,c}\,{\mathrm {e}}^{2\,b\,x}\right )}{b}-\frac {\mathrm {coth}\left (a+c\right )\,\ln \left (4\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-4\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,c}-4\,{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{4\,c}+4\,{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,b\,x}\right )}{b}-x \]

input
int(coth(a + b*x)*coth(c - b*x),x)
 
output
(coth(a + c)*log(4*exp(2*a)*exp(2*c) + 4*exp(4*a)*exp(4*c) - 4*exp(4*a)*ex 
p(2*c)*exp(2*b*x) - 4*exp(6*a)*exp(4*c)*exp(2*b*x)))/b - (coth(a + c)*log( 
4*exp(2*a)*exp(2*b*x) - 4*exp(2*a)*exp(2*c) - 4*exp(4*a)*exp(4*c) + 4*exp( 
4*a)*exp(2*c)*exp(2*b*x)))/b - x