\(\int \frac {\coth ^4(x)}{a+b \coth (x)} \, dx\) [153]

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

Optimal result

Integrand size = 13, antiderivative size = 76 \[ \int \frac {\coth ^4(x)}{a+b \coth (x)} \, dx=\frac {a x}{a^2-b^2}+\frac {a \coth (x)}{b^2}-\frac {\coth ^2(x)}{2 b}-\frac {a^4 \log (a+b \coth (x))}{b^3 \left (a^2-b^2\right )}-\frac {b \log (\sinh (x))}{a^2-b^2} \] Output:

a*x/(a^2-b^2)+a*coth(x)/b^2-1/2*coth(x)^2/b-a^4*ln(a+b*coth(x))/b^3/(a^2-b 
^2)-b*ln(sinh(x))/(a^2-b^2)
 

Mathematica [A] (verified)

Time = 0.29 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.01 \[ \int \frac {\coth ^4(x)}{a+b \coth (x)} \, dx=\frac {a \coth (x)}{b^2}-\frac {\coth ^2(x)}{2 b}-\frac {\log (1-\coth (x))}{2 (a+b)}+\frac {\log (1+\coth (x))}{2 (a-b)}-\frac {a^4 \log (a+b \coth (x))}{b^3 \left (a^2-b^2\right )} \] Input:

Integrate[Coth[x]^4/(a + b*Coth[x]),x]
 

Output:

(a*Coth[x])/b^2 - Coth[x]^2/(2*b) - Log[1 - Coth[x]]/(2*(a + b)) + Log[1 + 
 Coth[x]]/(2*(a - b)) - (a^4*Log[a + b*Coth[x]])/(b^3*(a^2 - b^2))
 

Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 0.74 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.30, number of steps used = 16, number of rules used = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.154, Rules used = {3042, 4049, 27, 3042, 26, 4130, 25, 3042, 4110, 26, 3042, 26, 3956, 4100, 16}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4049

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

\(\Big \downarrow \) 27

\(\displaystyle \frac {\int \frac {\coth (x) \left (-a \coth ^2(x)+b \coth (x)+a\right )}{a+b \coth (x)}dx}{b}-\frac {\coth ^2(x)}{2 b}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 4130

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4110

\(\displaystyle -\frac {\coth ^2(x)}{2 b}-\frac {i \left (\frac {i a \coth (x)}{b}-\frac {i \left (-\frac {i b^3 \int i \coth (x)dx}{a^2-b^2}+\frac {a^4 \int \frac {1-\coth ^2(x)}{a+b \coth (x)}dx}{a^2-b^2}-\frac {a b^2 x}{a^2-b^2}\right )}{b}\right )}{b}\)

\(\Big \downarrow \) 26

\(\displaystyle -\frac {\coth ^2(x)}{2 b}-\frac {i \left (\frac {i a \coth (x)}{b}-\frac {i \left (\frac {b^3 \int \coth (x)dx}{a^2-b^2}+\frac {a^4 \int \frac {1-\coth ^2(x)}{a+b \coth (x)}dx}{a^2-b^2}-\frac {a b^2 x}{a^2-b^2}\right )}{b}\right )}{b}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\coth ^2(x)}{2 b}-\frac {i \left (\frac {i a \coth (x)}{b}-\frac {i \left (\frac {b^3 \int -i \tan \left (i x+\frac {\pi }{2}\right )dx}{a^2-b^2}+\frac {a^4 \int \frac {\tan \left (i x+\frac {\pi }{2}\right )^2+1}{a-i b \tan \left (i x+\frac {\pi }{2}\right )}dx}{a^2-b^2}-\frac {a b^2 x}{a^2-b^2}\right )}{b}\right )}{b}\)

\(\Big \downarrow \) 26

\(\displaystyle -\frac {\coth ^2(x)}{2 b}-\frac {i \left (\frac {i a \coth (x)}{b}-\frac {i \left (-\frac {i b^3 \int \tan \left (i x+\frac {\pi }{2}\right )dx}{a^2-b^2}+\frac {a^4 \int \frac {\tan \left (i x+\frac {\pi }{2}\right )^2+1}{a-i b \tan \left (i x+\frac {\pi }{2}\right )}dx}{a^2-b^2}-\frac {a b^2 x}{a^2-b^2}\right )}{b}\right )}{b}\)

\(\Big \downarrow \) 3956

\(\displaystyle -\frac {\coth ^2(x)}{2 b}-\frac {i \left (\frac {i a \coth (x)}{b}-\frac {i \left (\frac {a^4 \int \frac {\tan \left (i x+\frac {\pi }{2}\right )^2+1}{a-i b \tan \left (i x+\frac {\pi }{2}\right )}dx}{a^2-b^2}-\frac {a b^2 x}{a^2-b^2}+\frac {b^3 \log (\sinh (x))}{a^2-b^2}\right )}{b}\right )}{b}\)

\(\Big \downarrow \) 4100

\(\displaystyle -\frac {\coth ^2(x)}{2 b}-\frac {i \left (\frac {i a \coth (x)}{b}-\frac {i \left (\frac {a^4 \int \frac {1}{a+b \coth (x)}d(b \coth (x))}{b \left (a^2-b^2\right )}-\frac {a b^2 x}{a^2-b^2}+\frac {b^3 \log (\sinh (x))}{a^2-b^2}\right )}{b}\right )}{b}\)

\(\Big \downarrow \) 16

\(\displaystyle -\frac {\coth ^2(x)}{2 b}-\frac {i \left (\frac {i a \coth (x)}{b}-\frac {i \left (-\frac {a b^2 x}{a^2-b^2}+\frac {b^3 \log (\sinh (x))}{a^2-b^2}+\frac {a^4 \log (a+b \coth (x))}{b \left (a^2-b^2\right )}\right )}{b}\right )}{b}\)

Input:

Int[Coth[x]^4/(a + b*Coth[x]),x]
 

Output:

-1/2*Coth[x]^2/b - (I*((I*a*Coth[x])/b - (I*(-((a*b^2*x)/(a^2 - b^2)) + (a 
^4*Log[a + b*Coth[x]])/(b*(a^2 - b^2)) + (b^3*Log[Sinh[x]])/(a^2 - b^2)))/ 
b))/b
 

Defintions of rubi rules used

rule 16
Int[(c_.)/((a_.) + (b_.)*(x_)), x_Symbol] :> Simp[c*(Log[RemoveContent[a + 
b*x, x]]/b), x] /; FreeQ[{a, b, c}, 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 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

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 4049
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*(a + b*Tan[e + f*x])^(m - 2)*((c 
+ d*Tan[e + f*x])^(n + 1)/(d*f*(m + n - 1))), x] + Simp[1/(d*(m + n - 1)) 
 Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^n*Simp[a^3*d*(m + n 
- 1) - b^2*(b*c*(m - 2) + a*d*(1 + n)) + b*d*(m + n - 1)*(3*a^2 - b^2)*Tan[ 
e + f*x] - b^2*(b*c*(m - 2) - a*d*(3*m + 2*n - 4))*Tan[e + f*x]^2, x], x], 
x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2 
, 0] && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && GtQ[m, 2] && (GeQ[n, -1] || I 
ntegerQ[m]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])) 
)
 

rule 4100
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + 
 (f_.)*(x_)]^2), x_Symbol] :> Simp[A/(b*f)   Subst[Int[(a + x)^m, x], x, b* 
Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]
 

rule 4110
Int[((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_) + (b_.)*tan[(e_.) + (f_. 
)*(x_)]), x_Symbol] :> Simp[a*(A - C)*(x/(a^2 + b^2)), x] + (Simp[(a^2*C + 
A*b^2)/(a^2 + b^2)   Int[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] 
- Simp[b*((A - C)/(a^2 + b^2))   Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, 
e, f, A, C}, x] && NeQ[a^2*C + A*b^2, 0] && NeQ[a^2 + b^2, 0] && NeQ[A, C]
 

rule 4130
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) 
+ (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_. 
) + (f_.)*(x_)]^2), x_Symbol] :> Simp[C*(a + b*Tan[e + f*x])^m*((c + d*Tan[ 
e + f*x])^(n + 1)/(d*f*(m + n + 1))), x] + Simp[1/(d*(m + n + 1))   Int[(a 
+ b*Tan[e + f*x])^(m - 1)*(c + d*Tan[e + f*x])^n*Simp[a*A*d*(m + n + 1) - C 
*(b*c*m + a*d*(n + 1)) + d*(A*b + a*B - b*C)*(m + n + 1)*Tan[e + f*x] - (C* 
m*(b*c - a*d) - b*B*d*(m + n + 1))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, 
b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && 
 NeQ[c^2 + d^2, 0] && GtQ[m, 0] &&  !(IGtQ[n, 0] && ( !IntegerQ[m] || (EqQ[ 
c, 0] && NeQ[a, 0])))
 
Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.00

method result size
derivativedivides \(-\frac {\coth \left (x \right )^{2}}{2 b}+\frac {a \coth \left (x \right )}{b^{2}}-\frac {a^{4} \ln \left (a +b \coth \left (x \right )\right )}{b^{3} \left (a +b \right ) \left (a -b \right )}-\frac {\ln \left (\coth \left (x \right )-1\right )}{2 a +2 b}+\frac {\ln \left (1+\coth \left (x \right )\right )}{2 a -2 b}\) \(76\)
default \(-\frac {\coth \left (x \right )^{2}}{2 b}+\frac {a \coth \left (x \right )}{b^{2}}-\frac {a^{4} \ln \left (a +b \coth \left (x \right )\right )}{b^{3} \left (a +b \right ) \left (a -b \right )}-\frac {\ln \left (\coth \left (x \right )-1\right )}{2 a +2 b}+\frac {\ln \left (1+\coth \left (x \right )\right )}{2 a -2 b}\) \(76\)
parallelrisch \(\frac {-2 \ln \left (\tanh \left (x \right ) a +b \right ) a^{4}+2 \ln \left (1-\tanh \left (x \right )\right ) b^{4}+\left (2 a^{4}-2 b^{4}\right ) \ln \left (\tanh \left (x \right )\right )+2 b \left (-\frac {b \coth \left (x \right )^{2} \left (a -b \right )}{2}+\coth \left (x \right ) a \left (a -b \right )+b^{2} x \right ) \left (a +b \right )}{2 b^{3} a^{2}-2 b^{5}}\) \(91\)
risch \(\frac {x}{a +b}-\frac {2 a^{2} x}{b^{3}}-\frac {2 x}{b}+\frac {2 x \,a^{4}}{b^{3} \left (a^{2}-b^{2}\right )}+\frac {2 \,{\mathrm e}^{2 x} a -2 \,{\mathrm e}^{2 x} b -2 a}{\left ({\mathrm e}^{2 x}-1\right )^{2} b^{2}}+\frac {\ln \left ({\mathrm e}^{2 x}-1\right ) a^{2}}{b^{3}}+\frac {\ln \left ({\mathrm e}^{2 x}-1\right )}{b}-\frac {a^{4} \ln \left ({\mathrm e}^{2 x}-\frac {a -b}{a +b}\right )}{b^{3} \left (a^{2}-b^{2}\right )}\) \(136\)

Input:

int(coth(x)^4/(a+b*coth(x)),x,method=_RETURNVERBOSE)
 

Output:

-1/2*coth(x)^2/b+a*coth(x)/b^2-1/b^3*a^4/(a+b)/(a-b)*ln(a+b*coth(x))-1/(2* 
a+2*b)*ln(coth(x)-1)+1/(2*a-2*b)*ln(1+coth(x))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 648 vs. \(2 (74) = 148\).

Time = 0.13 (sec) , antiderivative size = 648, normalized size of antiderivative = 8.53 \[ \int \frac {\coth ^4(x)}{a+b \coth (x)} \, dx =\text {Too large to display} \] Input:

integrate(coth(x)^4/(a+b*coth(x)),x, algorithm="fricas")
 

Output:

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 882 vs. \(2 (61) = 122\).

Time = 1.65 (sec) , antiderivative size = 882, normalized size of antiderivative = 11.61 \[ \int \frac {\coth ^4(x)}{a+b \coth (x)} \, dx=\text {Too large to display} \] Input:

integrate(coth(x)**4/(a+b*coth(x)),x)
 

Output:

Piecewise((zoo*(x - log(tanh(x) + 1) + log(tanh(x)) - 1/(2*tanh(x)**2)), E 
q(a, 0) & Eq(b, 0)), ((x - log(tanh(x) + 1) + log(tanh(x)) - 1/(2*tanh(x)* 
*2))/b, Eq(a, 0)), (7*x*tanh(x)**3/(2*b*tanh(x)**3 - 2*b*tanh(x)**2) - 7*x 
*tanh(x)**2/(2*b*tanh(x)**3 - 2*b*tanh(x)**2) - 4*log(tanh(x) + 1)*tanh(x) 
**3/(2*b*tanh(x)**3 - 2*b*tanh(x)**2) + 4*log(tanh(x) + 1)*tanh(x)**2/(2*b 
*tanh(x)**3 - 2*b*tanh(x)**2) + 4*log(tanh(x))*tanh(x)**3/(2*b*tanh(x)**3 
- 2*b*tanh(x)**2) - 4*log(tanh(x))*tanh(x)**2/(2*b*tanh(x)**3 - 2*b*tanh(x 
)**2) - 3*tanh(x)**2/(2*b*tanh(x)**3 - 2*b*tanh(x)**2) + tanh(x)/(2*b*tanh 
(x)**3 - 2*b*tanh(x)**2) + 1/(2*b*tanh(x)**3 - 2*b*tanh(x)**2), Eq(a, -b)) 
, (x*tanh(x)**3/(2*b*tanh(x)**3 + 2*b*tanh(x)**2) + x*tanh(x)**2/(2*b*tanh 
(x)**3 + 2*b*tanh(x)**2) - 4*log(tanh(x) + 1)*tanh(x)**3/(2*b*tanh(x)**3 + 
 2*b*tanh(x)**2) - 4*log(tanh(x) + 1)*tanh(x)**2/(2*b*tanh(x)**3 + 2*b*tan 
h(x)**2) + 4*log(tanh(x))*tanh(x)**3/(2*b*tanh(x)**3 + 2*b*tanh(x)**2) + 4 
*log(tanh(x))*tanh(x)**2/(2*b*tanh(x)**3 + 2*b*tanh(x)**2) + 3*tanh(x)**2/ 
(2*b*tanh(x)**3 + 2*b*tanh(x)**2) + tanh(x)/(2*b*tanh(x)**3 + 2*b*tanh(x)* 
*2) - 1/(2*b*tanh(x)**3 + 2*b*tanh(x)**2), Eq(a, b)), ((x - 1/tanh(x) - 1/ 
(3*tanh(x)**3))/a, Eq(b, 0)), (-2*a**4*log(tanh(x) + b/a)*tanh(x)**2/(2*a* 
*2*b**3*tanh(x)**2 - 2*b**5*tanh(x)**2) + 2*a**4*log(tanh(x))*tanh(x)**2/( 
2*a**2*b**3*tanh(x)**2 - 2*b**5*tanh(x)**2) + 2*a**3*b*tanh(x)/(2*a**2*b** 
3*tanh(x)**2 - 2*b**5*tanh(x)**2) - a**2*b**2/(2*a**2*b**3*tanh(x)**2 -...
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.57 \[ \int \frac {\coth ^4(x)}{a+b \coth (x)} \, dx=-\frac {a^{4} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} + a + b\right )}{a^{2} b^{3} - b^{5}} + \frac {2 \, {\left ({\left (a + b\right )} e^{\left (-2 \, x\right )} - a\right )}}{2 \, b^{2} e^{\left (-2 \, x\right )} - b^{2} e^{\left (-4 \, x\right )} - b^{2}} + \frac {x}{a + b} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (e^{\left (-x\right )} + 1\right )}{b^{3}} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (e^{\left (-x\right )} - 1\right )}{b^{3}} \] Input:

integrate(coth(x)^4/(a+b*coth(x)),x, algorithm="maxima")
 

Output:

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

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.32 \[ \int \frac {\coth ^4(x)}{a+b \coth (x)} \, dx=-\frac {a^{4} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} - a + b \right |}\right )}{a^{2} b^{3} - b^{5}} + \frac {x}{a - b} + \frac {{\left (a^{2} + b^{2}\right )} \log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right )}{b^{3}} - \frac {2 \, {\left (a b - {\left (a b - b^{2}\right )} e^{\left (2 \, x\right )}\right )}}{b^{3} {\left (e^{\left (2 \, x\right )} - 1\right )}^{2}} \] Input:

integrate(coth(x)^4/(a+b*coth(x)),x, algorithm="giac")
                                                                                    
                                                                                    
 

Output:

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

Mupad [B] (verification not implemented)

Time = 2.64 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.45 \[ \int \frac {\coth ^4(x)}{a+b \coth (x)} \, dx=\frac {x}{a-b}-\frac {2}{b\,\left ({\mathrm {e}}^{4\,x}-2\,{\mathrm {e}}^{2\,x}+1\right )}+\frac {\ln \left ({\mathrm {e}}^{2\,x}-1\right )\,\left (a^2+b^2\right )}{b^3}+\frac {a^4\,\ln \left (b-a+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{b^5-a^2\,b^3}+\frac {2\,\left (a^2-b^2\right )}{b^2\,\left (a+b\right )\,\left ({\mathrm {e}}^{2\,x}-1\right )} \] Input:

int(coth(x)^4/(a + b*coth(x)),x)
 

Output:

x/(a - b) - 2/(b*(exp(4*x) - 2*exp(2*x) + 1)) + (log(exp(2*x) - 1)*(a^2 + 
b^2))/b^3 + (a^4*log(b - a + a*exp(2*x) + b*exp(2*x)))/(b^5 - a^2*b^3) + ( 
2*(a^2 - b^2))/(b^2*(a + b)*(exp(2*x) - 1))
 

Reduce [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.51 \[ \int \frac {\coth ^4(x)}{a+b \coth (x)} \, dx=\frac {-\coth \left (x \right )^{2} a^{2} b^{2}+\coth \left (x \right )^{2} b^{4}+2 \coth \left (x \right ) a^{3} b -2 \coth \left (x \right ) a \,b^{3}-2 \,\mathrm {log}\left (\coth \left (x \right ) b +a \right ) a^{4}+2 \,\mathrm {log}\left (\coth \left (x \right ) b +a \right ) b^{4}-2 \,\mathrm {log}\left (e^{2 x} a +e^{2 x} b -a +b \right ) b^{4}+2 a \,b^{3} x +2 b^{4} x}{2 b^{3} \left (a^{2}-b^{2}\right )} \] Input:

int(coth(x)^4/(a+b*coth(x)),x)
 

Output:

( - coth(x)**2*a**2*b**2 + coth(x)**2*b**4 + 2*coth(x)*a**3*b - 2*coth(x)* 
a*b**3 - 2*log(coth(x)*b + a)*a**4 + 2*log(coth(x)*b + a)*b**4 - 2*log(e** 
(2*x)*a + e**(2*x)*b - a + b)*b**4 + 2*a*b**3*x + 2*b**4*x)/(2*b**3*(a**2 
- b**2))