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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
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 = 147 \[ \int \frac {\cosh ^4(x)}{a+b \coth (x)} \, dx=-\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 )} \] Output:

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

Mathematica [A] (verified)

Time = 0.62 (sec) , antiderivative size = 144, normalized size of antiderivative = 0.98 \[ \int \frac {\cosh ^4(x)}{a+b \coth (x)} \, dx=\frac {12 a^5 x+24 a^3 b^2 x-4 a b^4 x-4 b \left (3 a^4-4 a^2 b^2+b^4\right ) \cosh (2 x)-b \left (a^2-b^2\right )^2 \cosh (4 x)-32 a^4 b \log (b \cosh (x)+a \sinh (x))+8 a^3 \left (a^2-b^2\right ) \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} \] Input:

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

Output:

(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] - 32*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*S 
inh[4*x])/(32*(a - b)^3*(a + b)^3)
 

Rubi [A] (verified)

Time = 0.70 (sec) , antiderivative size = 242, normalized size of antiderivative = 1.65, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.692, Rules used = {3042, 3999, 25, 601, 2178, 25, 27, 657, 2009}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3999

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 601

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

\(\Big \downarrow \) 2178

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 657

\(\displaystyle -b \left (\frac {-\frac {a b^2 \int \left (-\frac {8 a^3}{(a-b) (a+b) (a+b \coth (x))}+\frac {(a-b)^2 (3 a+b)}{2 b (a+b) (b-b \coth (x))}+\frac {(3 a-b) (a+b)^2}{2 (a-b) b (\coth (x) b+b)}\right )d(b \coth (x))}{2 \left (a^2-b^2\right )^2}-\frac {b^2 \left (4 b^2 \left (2 a^2-b^2\right )-a b \left (5 a^2-b^2\right ) \coth (x)\right )}{2 \left (a^2-b^2\right )^2 \left (b^2-b^2 \coth ^2(x)\right )}}{4 b^2}+\frac {b^2 \left (\frac {b^2}{a^2-b^2}-\frac {a b \coth (x)}{a^2-b^2}\right )}{4 \left (b^2-b^2 \coth ^2(x)\right )^2}\right )\)

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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 601
Int[(x_)^(m_)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbo 
l] :> With[{Qx = PolynomialQuotient[x^m*(c + d*x)^n, a + b*x^2, x], e = Coe 
ff[PolynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 0], f = Coeff[Pol 
ynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 1]}, Simp[(a*f - b*e*x) 
*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Simp[1/(2*a*(p + 1))   Int[(c 
+ d*x)^n*(a + b*x^2)^(p + 1)*ExpandToSum[(2*a*(p + 1)*Qx)/(c + d*x)^n + (e* 
(2*p + 3))/(c + d*x)^n, x], x], x]] /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 1] 
 && LtQ[p, -1] && ILtQ[n, 0] && NeQ[b*c^2 + a*d^2, 0]
 

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

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2178
Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] : 
> With[{Qx = PolynomialQuotient[(d + e*x)^m*Pq, a + b*x^2, x], R = Coeff[Po 
lynomialRemainder[(d + e*x)^m*Pq, a + b*x^2, x], x, 0], S = Coeff[Polynomia 
lRemainder[(d + e*x)^m*Pq, a + b*x^2, x], x, 1]}, Simp[(a*S - b*R*x)*((a + 
b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Simp[1/(2*a*b*(p + 1))   Int[(d + e*x 
)^m*(a + b*x^2)^(p + 1)*ExpandToSum[(2*a*b*(p + 1)*Qx)/(d + e*x)^m + (b*R*( 
2*p + 3))/(d + e*x)^m, x], x], x]] /; FreeQ[{a, b, d, e}, x] && PolyQ[Pq, x 
] && NeQ[b*d^2 + a*e^2, 0] && LtQ[p, -1] && ILtQ[m, 0]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3999
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ 
), x_Symbol] :> Simp[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]
 
Maple [A] (verified)

Time = 4.51 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.25

method result size
risch \(\frac {3 x \,a^{2}}{8 \left (a +b \right )^{3}}+\frac {x a b}{8 \left (a +b \right )^{3}}+\frac {{\mathrm e}^{4 x}}{64 a +64 b}+\frac {{\mathrm e}^{2 x} a}{8 \left (a +b \right )^{2}}+\frac {{\mathrm e}^{2 x} b}{16 \left (a +b \right )^{2}}-\frac {{\mathrm e}^{-2 x} a}{8 \left (a -b \right )^{2}}+\frac {{\mathrm e}^{-2 x} b}{16 \left (a -b \right )^{2}}-\frac {{\mathrm e}^{-4 x}}{64 \left (a -b \right )}+\frac {2 a^{4} b x}{a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}}-\frac {a^{4} b \ln \left ({\mathrm e}^{2 x}-\frac {a -b}{a +b}\right )}{a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}}\) \(184\)
default \(-\frac {1}{\left (4 a -4 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )^{4}}+\frac {4}{\left (8 a -8 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )^{3}}-\frac {-5 a +3 b}{8 \left (a -b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )+1\right )}-\frac {7 a -5 b}{8 \left (a -b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )+1\right )^{2}}+\frac {a \left (3 a -b \right ) \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{8 \left (a -b \right )^{3}}-\frac {a^{4} b \ln \left (b \tanh \left (\frac {x}{2}\right )^{2}+2 a \tanh \left (\frac {x}{2}\right )+b \right )}{\left (a -b \right )^{3} \left (a +b \right )^{3}}+\frac {1}{\left (4 a +4 b \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )^{4}}+\frac {4}{\left (8 a +8 b \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )^{3}}-\frac {-7 a -5 b}{8 \left (a +b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )-1\right )^{2}}-\frac {-5 a -3 b}{8 \left (a +b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )-1\right )}-\frac {a \left (3 a +b \right ) \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{8 \left (a +b \right )^{3}}\) \(249\)

Input:

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

Output:

3/8*x/(a+b)^3*a^2+1/8*x/(a+b)^3*a*b+1/64/(a+b)*exp(4*x)+1/8/(a+b)^2*exp(2* 
x)*a+1/16/(a+b)^2*exp(2*x)*b-1/8/(a-b)^2*exp(-2*x)*a+1/16/(a-b)^2*exp(-2*x 
)*b-1/64/(a-b)*exp(-4*x)+2*a^4*b/(a^6-3*a^4*b^2+3*a^2*b^4-b^6)*x-a^4*b/(a^ 
6-3*a^4*b^2+3*a^2*b^4-b^6)*ln(exp(2*x)-(a-b)/(a+b))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1229 vs. \(2 (139) = 278\).

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

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

Output:

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*(3*a^5 + 8*a^4*b + 6*a^3*b^2 - a*b^ 
4)*x)*sinh(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)^5 + 10*(2*a^5 - 3*a^4*b - 2*a^3*b^2 + 4*a^2*b^3 - b^5)*cosh(x)^3 
+ 4*(3*a^5 + 8*a^4*b + 6*a^3*b^2 - a*b^4)*x*cosh(x))*sinh(x)^3 - 4*(2*a^5 
+ 3*a^4*b - 2*a^3*b^2 - 4*a^2*b^3 + b^5)*cosh(x)^2 + 4*(7*(a^5 - a^4*b - 2 
*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)^6 - 2*a^5 - 3*a^4*b + 2*a^3*b^ 
2 + 4*a^2*b^3 - b^5 + 15*(2*a^5 - 3*a^4*b - 2*a^3*b^2 + 4*a^2*b^3 - b^5)*c 
osh(x)^4 + 12*(3*a^5 + 8*a^4*b + 6*a^3*b^2 - a*b^4)*x*cosh(x)^2)*sinh(x)^2 
 - 64*(a^4*b*cosh(x)^4 + 4*a^4*b*cosh(x)^3*sinh(x) + 6*a^4*b*cosh(x)^2*sin 
h(x)^2 + 4*a^4*b*cosh(x)*sinh(x)^3 + a^4*b*sinh(x)^4)*log(2*(b*cosh(x) ...
 

Sympy [F]

\[ \int \frac {\cosh ^4(x)}{a+b \coth (x)} \, dx=\int \frac {\cosh ^{4}{\left (x \right )}}{a + b \coth {\left (x \right )}}\, dx \] Input:

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.05 \[ \int \frac {\cosh ^4(x)}{a+b \coth (x)} \, dx=-\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 )}} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 216, normalized size of antiderivative = 1.47 \[ \int \frac {\cosh ^4(x)}{a+b \coth (x)} \, dx=-\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 )}} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 2.82 (sec) , antiderivative size = 135, normalized size of antiderivative = 0.92 \[ \int \frac {\cosh ^4(x)}{a+b \coth (x)} \, dx=\frac {{\mathrm {e}}^{4\,x}}{64\,a+64\,b}-\frac {{\mathrm {e}}^{-4\,x}}{64\,a-64\,b}-\frac {{\mathrm {e}}^{-2\,x}\,\left (2\,a-b\right )}{16\,{\left (a-b\right )}^2}+\frac {{\mathrm {e}}^{2\,x}\,\left (2\,a+b\right )}{16\,{\left (a+b\right )}^2}-\frac {a^4\,b\,\ln \left (b-a+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6}+\frac {a\,x\,\left (3\,a-b\right )}{8\,{\left (a-b\right )}^3} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 335, normalized size of antiderivative = 2.28 \[ \int \frac {\cosh ^4(x)}{a+b \coth (x)} \, dx=\frac {-2 e^{8 x} a^{3} b^{2}+2 e^{8 x} a^{2} b^{3}-12 e^{6 x} a^{4} b -8 e^{6 x} a^{3} b^{2}+16 e^{6 x} a^{2} b^{3}+24 e^{4 x} a^{5} x -12 e^{2 x} a^{4} b +8 e^{2 x} a^{3} b^{2}+16 e^{2 x} a^{2} b^{3}-e^{8 x} a^{4} b +e^{8 x} a \,b^{4}-64 e^{4 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b -a +b \right ) a^{4} b +64 e^{4 x} a^{4} b x -a^{5}+2 a^{3} b^{2}-b^{5}+2 a^{2} b^{3}+48 e^{4 x} a^{3} b^{2} x -8 e^{4 x} a \,b^{4} x -a^{4} b +e^{8 x} a^{5}-e^{8 x} b^{5}+8 e^{6 x} a^{5}-4 e^{6 x} b^{5}-8 e^{2 x} a^{5}-4 e^{2 x} b^{5}-a \,b^{4}}{64 e^{4 x} \left (a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}\right )} \] Input:

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

Output:

(e**(8*x)*a**5 - e**(8*x)*a**4*b - 2*e**(8*x)*a**3*b**2 + 2*e**(8*x)*a**2* 
b**3 + e**(8*x)*a*b**4 - e**(8*x)*b**5 + 8*e**(6*x)*a**5 - 12*e**(6*x)*a** 
4*b - 8*e**(6*x)*a**3*b**2 + 16*e**(6*x)*a**2*b**3 - 4*e**(6*x)*b**5 - 64* 
e**(4*x)*log(e**(2*x)*a + e**(2*x)*b - a + b)*a**4*b + 24*e**(4*x)*a**5*x 
+ 64*e**(4*x)*a**4*b*x + 48*e**(4*x)*a**3*b**2*x - 8*e**(4*x)*a*b**4*x - 8 
*e**(2*x)*a**5 - 12*e**(2*x)*a**4*b + 8*e**(2*x)*a**3*b**2 + 16*e**(2*x)*a 
**2*b**3 - 4*e**(2*x)*b**5 - a**5 - a**4*b + 2*a**3*b**2 + 2*a**2*b**3 - a 
*b**4 - b**5)/(64*e**(4*x)*(a**6 - 3*a**4*b**2 + 3*a**2*b**4 - b**6))