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

Optimal. Leaf size=76 \[ \frac{a x}{a^2-b^2}-\frac{b \log (\sinh (x))}{a^2-b^2}-\frac{a^4 \log (a+b \coth (x))}{b^3 \left (a^2-b^2\right )}+\frac{a \coth (x)}{b^2}-\frac{\coth ^2(x)}{2 b} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.221255, antiderivative size = 76, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.462, Rules used = {3566, 3647, 3627, 3617, 31, 3475} \[ \frac{a x}{a^2-b^2}-\frac{b \log (\sinh (x))}{a^2-b^2}-\frac{a^4 \log (a+b \coth (x))}{b^3 \left (a^2-b^2\right )}+\frac{a \coth (x)}{b^2}-\frac{\coth ^2(x)}{2 b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3566

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[(b^2*(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^(n + 1))/(d*f*(m + n - 1)), x] + Dist[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] || IntegerQ[m]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0]
&& NeQ[a, 0])))

Rule 3647

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] + Dist[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] && ( !Intege
rQ[m] || (EqQ[c, 0] && NeQ[a, 0])))

Rule 3627

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] + (Dist[(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] - Dist[(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 3617

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
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 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3475

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

Rubi steps

\begin{align*} \int \frac{\coth ^4(x)}{a+b \coth (x)} \, dx &=-\frac{\coth ^2(x)}{2 b}-\frac{\int \frac{\coth (x) \left (-2 a-2 b \coth (x)+2 a \coth ^2(x)\right )}{a+b \coth (x)} \, dx}{2 b}\\ &=\frac{a \coth (x)}{b^2}-\frac{\coth ^2(x)}{2 b}-\frac{\int \frac{2 a^2-2 \left (a^2+b^2\right ) \coth ^2(x)}{a+b \coth (x)} \, dx}{2 b^2}\\ &=\frac{a x}{a^2-b^2}+\frac{a \coth (x)}{b^2}-\frac{\coth ^2(x)}{2 b}-\frac{a^4 \int \frac{1-\coth ^2(x)}{a+b \coth (x)} \, dx}{b^2 \left (a^2-b^2\right )}-\frac{b \int \coth (x) \, dx}{a^2-b^2}\\ &=\frac{a x}{a^2-b^2}+\frac{a \coth (x)}{b^2}-\frac{\coth ^2(x)}{2 b}-\frac{b \log (\sinh (x))}{a^2-b^2}-\frac{a^4 \operatorname{Subst}\left (\int \frac{1}{a+x} \, dx,x,b \coth (x)\right )}{b^3 \left (a^2-b^2\right )}\\ &=\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}\\ \end{align*}

Mathematica [A]  time = 0.2014, size = 88, normalized size = 1.16 \[ \frac{2 a b \left (a^2-b^2\right ) \coth (x)+\left (b^4-a^2 b^2\right ) \text{csch}^2(x)+2 \left (a^4-b^4\right ) \log (\sinh (x))-2 a^4 \log (a \sinh (x)+b \cosh (x))+2 a b^3 x}{2 b^3 (a-b) (a+b)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.021, size = 76, normalized size = 1. \begin{align*} -{\frac{ \left ({\rm coth} \left (x\right ) \right ) ^{2}}{2\,b}}+{\frac{a{\rm coth} \left (x\right )}{{b}^{2}}}+{\frac{\ln \left ( 1+{\rm coth} \left (x\right ) \right ) }{2\,a-2\,b}}-{\frac{\ln \left ({\rm coth} \left (x\right )-1 \right ) }{2\,b+2\,a}}-{\frac{{a}^{4}\ln \left ( a+b{\rm coth} \left (x\right ) \right ) }{{b}^{3} \left ( a+b \right ) \left ( a-b \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.19526, size = 161, normalized size = 2.12 \begin{align*} -\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}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-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

________________________________________________________________________________________

Fricas [B]  time = 2.93003, size = 1538, normalized size = 20.24 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

((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 [A]  time = 7.99349, size = 882, normalized size = 11.61 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((zoo*(x - log(tanh(x) + 1) + log(tanh(x)) - 1/(2*tanh(x)**2)), Eq(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*l
og(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 - 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*ta
nh(x)**2) - a**2*b**2/(2*a**2*b**3*tanh(x)**2 - 2*b**5*tanh(x)**2) + 2*a*b**3*x*tanh(x)**2/(2*a**2*b**3*tanh(x
)**2 - 2*b**5*tanh(x)**2) - 2*a*b**3*tanh(x)/(2*a**2*b**3*tanh(x)**2 - 2*b**5*tanh(x)**2) - 2*b**4*x*tanh(x)**
2/(2*a**2*b**3*tanh(x)**2 - 2*b**5*tanh(x)**2) + 2*b**4*log(tanh(x) + 1)*tanh(x)**2/(2*a**2*b**3*tanh(x)**2 -
2*b**5*tanh(x)**2) - 2*b**4*log(tanh(x))*tanh(x)**2/(2*a**2*b**3*tanh(x)**2 - 2*b**5*tanh(x)**2) + b**4/(2*a**
2*b**3*tanh(x)**2 - 2*b**5*tanh(x)**2), True))

________________________________________________________________________________________

Giac [A]  time = 1.17949, size = 135, normalized size = 1.78 \begin{align*} -\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}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-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)