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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.339408, antiderivative size = 147, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {3516, 1647, 801} \[ -\frac{a^4 b \log (a+b \coth (x))}{\left (a^2-b^2\right )^3}-\frac{\sinh ^4(x) (b-a \coth (x))}{4 \left (a^2-b^2\right )}-\frac{\sinh ^2(x) \left (4 b \left (2 a^2-b^2\right )-a \left (5 a^2-b^2\right ) \coth (x)\right )}{8 \left (a^2-b^2\right )^2}-\frac{a (3 a+b) \log (1-\coth (x))}{16 (a+b)^3}+\frac{a (3 a-b) \log (\coth (x)+1)}{16 (a-b)^3} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3516

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[(x^m*(a + x)^n)/(b^2 + x^2)^(m/2 + 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rule 1647

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[(d +
 e*x)^m*Pq, a + c*x^2, x], f = Coeff[PolynomialRemainder[(d + e*x)^m*Pq, a + c*x^2, x], x, 0], g = Coeff[Polyn
omialRemainder[(d + e*x)^m*Pq, a + c*x^2, x], x, 1]}, Simp[((a*g - c*f*x)*(a + c*x^2)^(p + 1))/(2*a*c*(p + 1))
, x] + Dist[1/(2*a*c*(p + 1)), Int[(d + e*x)^m*(a + c*x^2)^(p + 1)*ExpandToSum[(2*a*c*(p + 1)*Q)/(d + e*x)^m +
 (c*f*(2*p + 3))/(d + e*x)^m, x], x], x]] /; FreeQ[{a, c, d, e}, x] && PolyQ[Pq, x] && NeQ[c*d^2 + a*e^2, 0] &
& LtQ[p, -1] && ILtQ[m, 0]

Rule 801

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
(d + e*x)^m*(f + g*x))/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rubi steps

\begin{align*} \int \frac{\cosh ^4(x)}{a+b \coth (x)} \, dx &=-\left (b \operatorname{Subst}\left (\int \frac{x^4}{(a+x) \left (-b^2+x^2\right )^3} \, dx,x,b \coth (x)\right )\right )\\ &=-\frac{(b-a \coth (x)) \sinh ^4(x)}{4 \left (a^2-b^2\right )}-\frac{\operatorname{Subst}\left (\int \frac{\frac{a^2 b^4}{a^2-b^2}-\frac{3 a b^4 x}{a^2-b^2}+4 b^2 x^2}{(a+x) \left (-b^2+x^2\right )^2} \, dx,x,b \coth (x)\right )}{4 b}\\ &=-\frac{\left (4 b \left (2 a^2-b^2\right )-a \left (5 a^2-b^2\right ) \coth (x)\right ) \sinh ^2(x)}{8 \left (a^2-b^2\right )^2}-\frac{(b-a \coth (x)) \sinh ^4(x)}{4 \left (a^2-b^2\right )}-\frac{\operatorname{Subst}\left (\int \frac{\frac{a^2 b^4 \left (3 a^2+b^2\right )}{\left (a^2-b^2\right )^2}-\frac{a b^4 \left (5 a^2-b^2\right ) x}{\left (a^2-b^2\right )^2}}{(a+x) \left (-b^2+x^2\right )} \, dx,x,b \coth (x)\right )}{8 b^3}\\ &=-\frac{\left (4 b \left (2 a^2-b^2\right )-a \left (5 a^2-b^2\right ) \coth (x)\right ) \sinh ^2(x)}{8 \left (a^2-b^2\right )^2}-\frac{(b-a \coth (x)) \sinh ^4(x)}{4 \left (a^2-b^2\right )}-\frac{\operatorname{Subst}\left (\int \left (-\frac{a b^3 (3 a+b)}{2 (a+b)^3 (b-x)}+\frac{8 a^4 b^4}{(a-b)^3 (a+b)^3 (a+x)}-\frac{a (3 a-b) b^3}{2 (a-b)^3 (b+x)}\right ) \, dx,x,b \coth (x)\right )}{8 b^3}\\ &=-\frac{a (3 a+b) \log (1-\coth (x))}{16 (a+b)^3}+\frac{a (3 a-b) \log (1+\coth (x))}{16 (a-b)^3}-\frac{a^4 b \log (a+b \coth (x))}{\left (a^2-b^2\right )^3}-\frac{\left (4 b \left (2 a^2-b^2\right )-a \left (5 a^2-b^2\right ) \coth (x)\right ) \sinh ^2(x)}{8 \left (a^2-b^2\right )^2}-\frac{(b-a \coth (x)) \sinh ^4(x)}{4 \left (a^2-b^2\right )}\\ \end{align*}

Mathematica [A]  time = 0.521728, size = 144, normalized size = 0.98 \[ \frac{24 a^3 b^2 x+8 a^3 \left (a^2-b^2\right ) \sinh (2 x)-2 a^3 b^2 \sinh (4 x)-4 b \left (-4 a^2 b^2+3 a^4+b^4\right ) \cosh (2 x)-b \left (a^2-b^2\right )^2 \cosh (4 x)-32 a^4 b \log (a \sinh (x)+b \cosh (x))+12 a^5 x+a^5 \sinh (4 x)-4 a b^4 x+a b^4 \sinh (4 x)}{32 (a-b)^3 (a+b)^3} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(12*a^5*x + 24*a^3*b^2*x - 4*a*b^4*x - 4*b*(3*a^4 - 4*a^2*b^2 + b^4)*Cosh[2*x] - b*(a^2 - b^2)^2*Cosh[4*x] - 3
2*a^4*b*Log[b*Cosh[x] + a*Sinh[x]] + 8*a^3*(a^2 - b^2)*Sinh[2*x] + a^5*Sinh[4*x] - 2*a^3*b^2*Sinh[4*x] + a*b^4
*Sinh[4*x])/(32*(a - b)^3*(a + b)^3)

________________________________________________________________________________________

Maple [B]  time = 0.047, size = 319, normalized size = 2.2 \begin{align*} -{\frac{1}{4\,a-4\,b} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-4}}+4\,{\frac{1}{ \left ( 8\,a-8\,b \right ) \left ( \tanh \left ( x/2 \right ) +1 \right ) ^{3}}}+{\frac{5\,a}{8\, \left ( a-b \right ) ^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}-{\frac{3\,b}{8\, \left ( a-b \right ) ^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}-{\frac{7\,a}{8\, \left ( a-b \right ) ^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-2}}+{\frac{5\,b}{8\, \left ( a-b \right ) ^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-2}}+{\frac{3\,{a}^{2}}{8\, \left ( a-b \right ) ^{3}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-{\frac{ab}{8\, \left ( a-b \right ) ^{3}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{1}{4\,a+4\,b} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-4}}+4\,{\frac{1}{ \left ( 8\,a+8\,b \right ) \left ( \tanh \left ( x/2 \right ) -1 \right ) ^{3}}}+{\frac{7\,a}{8\, \left ( a+b \right ) ^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-2}}+{\frac{5\,b}{8\, \left ( a+b \right ) ^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-2}}+{\frac{5\,a}{8\, \left ( a+b \right ) ^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}+{\frac{3\,b}{8\, \left ( a+b \right ) ^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}-{\frac{3\,{a}^{2}}{8\, \left ( a+b \right ) ^{3}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }-{\frac{ab}{8\, \left ( a+b \right ) ^{3}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }-{\frac{{a}^{4}b}{ \left ( a-b \right ) ^{3} \left ( a+b \right ) ^{3}}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}b+2\,a\tanh \left ( x/2 \right ) +b \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/(4*a-4*b)/(tanh(1/2*x)+1)^4+4/(8*a-8*b)/(tanh(1/2*x)+1)^3+5/8/(a-b)^2/(tanh(1/2*x)+1)*a-3/8/(a-b)^2/(tanh(1
/2*x)+1)*b-7/8/(a-b)^2/(tanh(1/2*x)+1)^2*a+5/8/(a-b)^2/(tanh(1/2*x)+1)^2*b+3/8/(a-b)^3*ln(tanh(1/2*x)+1)*a^2-1
/8/(a-b)^3*ln(tanh(1/2*x)+1)*a*b+1/(4*a+4*b)/(tanh(1/2*x)-1)^4+4/(8*a+8*b)/(tanh(1/2*x)-1)^3+7/8/(a+b)^2/(tanh
(1/2*x)-1)^2*a+5/8/(a+b)^2/(tanh(1/2*x)-1)^2*b+5/8/(a+b)^2/(tanh(1/2*x)-1)*a+3/8/(a+b)^2/(tanh(1/2*x)-1)*b-3/8
/(a+b)^3*ln(tanh(1/2*x)-1)*a^2-1/8/(a+b)^3*ln(tanh(1/2*x)-1)*a*b-a^4*b/(a-b)^3/(a+b)^3*ln(tanh(1/2*x)^2*b+2*a*
tanh(1/2*x)+b)

________________________________________________________________________________________

Maxima [A]  time = 1.19885, size = 208, normalized size = 1.41 \begin{align*} -\frac{a^{4} b \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} + a + b\right )}{a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}} + \frac{{\left (3 \, a^{2} + a b\right )} x}{8 \,{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )}} + \frac{{\left (4 \,{\left (2 \, a + b\right )} e^{\left (-2 \, x\right )} + a + b\right )} e^{\left (4 \, x\right )}}{64 \,{\left (a^{2} + 2 \, a b + b^{2}\right )}} - \frac{4 \,{\left (2 \, a - b\right )} e^{\left (-2 \, x\right )} +{\left (a - b\right )} e^{\left (-4 \, x\right )}}{64 \,{\left (a^{2} - 2 \, a b + b^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.85631, size = 2747, normalized size = 18.69 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/64*((a^5 - a^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)^8 + 8*(a^5 - a^4*b - 2*a^3*b^2 + 2*a^2*b^3 +
 a*b^4 - b^5)*cosh(x)*sinh(x)^7 + (a^5 - a^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5)*sinh(x)^8 + 4*(2*a^5 - 3
*a^4*b - 2*a^3*b^2 + 4*a^2*b^3 - b^5)*cosh(x)^6 + 4*(2*a^5 - 3*a^4*b - 2*a^3*b^2 + 4*a^2*b^3 - b^5 + 7*(a^5 -
a^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)^2)*sinh(x)^6 + 8*(3*a^5 + 8*a^4*b + 6*a^3*b^2 - a*b^4)*x*
cosh(x)^4 + 8*(7*(a^5 - a^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)^3 + 3*(2*a^5 - 3*a^4*b - 2*a^3*b^
2 + 4*a^2*b^3 - b^5)*cosh(x))*sinh(x)^5 - a^5 - a^4*b + 2*a^3*b^2 + 2*a^2*b^3 - a*b^4 - b^5 + 2*(35*(a^5 - a^4
*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)^4 + 30*(2*a^5 - 3*a^4*b - 2*a^3*b^2 + 4*a^2*b^3 - b^5)*cosh(
x)^2 + 4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- 3*a^4*b^2 + 3*a^2*b^4 - b^6)*cosh(x)^2*sinh(x)^2 + 4*(a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6)*cosh(x)*sinh(
x)^3 + (a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6)*sinh(x)^4)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cosh ^{4}{\left (x \right )}}{a + b \coth{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral(cosh(x)**4/(a + b*coth(x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.15977, size = 292, normalized size = 1.99 \begin{align*} -\frac{a^{4} b \log \left ({\left | -a e^{\left (2 \, x\right )} - b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}} + \frac{{\left (3 \, a^{2} - a b\right )} x}{8 \,{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )}} - \frac{{\left (18 \, a^{2} e^{\left (4 \, x\right )} - 6 \, a b e^{\left (4 \, x\right )} + 8 \, a^{2} e^{\left (2 \, x\right )} - 12 \, a b e^{\left (2 \, x\right )} + 4 \, b^{2} e^{\left (2 \, x\right )} + a^{2} - 2 \, a b + b^{2}\right )} e^{\left (-4 \, x\right )}}{64 \,{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )}} + \frac{a e^{\left (4 \, x\right )} + b e^{\left (4 \, x\right )} + 8 \, a e^{\left (2 \, x\right )} + 4 \, b e^{\left (2 \, x\right )}}{64 \,{\left (a^{2} + 2 \, a b + b^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-a^4*b*log(abs(-a*e^(2*x) - b*e^(2*x) + a - b))/(a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6) + 1/8*(3*a^2 - a*b)*x/(a^3
 - 3*a^2*b + 3*a*b^2 - b^3) - 1/64*(18*a^2*e^(4*x) - 6*a*b*e^(4*x) + 8*a^2*e^(2*x) - 12*a*b*e^(2*x) + 4*b^2*e^
(2*x) + a^2 - 2*a*b + b^2)*e^(-4*x)/(a^3 - 3*a^2*b + 3*a*b^2 - b^3) + 1/64*(a*e^(4*x) + b*e^(4*x) + 8*a*e^(2*x
) + 4*b*e^(2*x))/(a^2 + 2*a*b + b^2)