\(\int \frac {\text {csch}^4(x)}{a+b \tanh (x)} \, dx\) [87]

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 2.50 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.90 \[ \int \frac {\text {csch}^4(x)}{a+b \tanh (x)} \, dx=\frac {3 a^2 b \text {csch}^2(x)-2 \coth (x) \left (-2 a^3+3 a b^2+a^3 \text {csch}^2(x)\right )+6 b \left (a^2-b^2\right ) (\log (\sinh (x))-\log (a \cosh (x)+b \sinh (x)))}{6 a^4} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.12, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3042, 3999, 25, 522, 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 {\text {csch}^4(x)}{a+b \tanh (x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sin (i x)^4 (a-i b \tan (i x))}dx\)

\(\Big \downarrow \) 3999

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 522

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 522
Int[((e_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_. 
), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*(c + d*x)^n*(a + b*x^2)^p, x], 
x] /; FreeQ[{a, b, c, d, e, m, n}, x] && IGtQ[p, 0]
 

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

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 = 2.56 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.83

method result size
risch \(-\frac {2 \left (-3 \,{\mathrm e}^{4 x} a b +3 b^{2} {\mathrm e}^{4 x}+6 \,{\mathrm e}^{2 x} a^{2}+3 \,{\mathrm e}^{2 x} a b -6 b^{2} {\mathrm e}^{2 x}-2 a^{2}+3 b^{2}\right )}{3 a^{3} \left ({\mathrm e}^{2 x}-1\right )^{3}}-\frac {b \ln \left ({\mathrm e}^{2 x}+\frac {a -b}{a +b}\right )}{a^{2}}+\frac {b^{3} \ln \left ({\mathrm e}^{2 x}+\frac {a -b}{a +b}\right )}{a^{4}}+\frac {b \ln \left ({\mathrm e}^{2 x}-1\right )}{a^{2}}-\frac {b^{3} \ln \left ({\mathrm e}^{2 x}-1\right )}{a^{4}}\) \(143\)
default \(-\frac {\frac {\tanh \left (\frac {x}{2}\right )^{3} a^{2}}{3}-a \tanh \left (\frac {x}{2}\right )^{2} b -3 \tanh \left (\frac {x}{2}\right ) a^{2}+4 b^{2} \tanh \left (\frac {x}{2}\right )}{8 a^{3}}-\frac {1}{24 a \tanh \left (\frac {x}{2}\right )^{3}}-\frac {-3 a^{2}+4 b^{2}}{8 a^{3} \tanh \left (\frac {x}{2}\right )}+\frac {b}{8 a^{2} \tanh \left (\frac {x}{2}\right )^{2}}+\frac {b \left (a^{2}-b^{2}\right ) \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a^{4}}-\frac {2 b \left (\frac {a^{2}}{2}-\frac {b^{2}}{2}\right ) \ln \left (\tanh \left (\frac {x}{2}\right )^{2} a +2 b \tanh \left (\frac {x}{2}\right )+a \right )}{a^{4}}\) \(146\)

Input:

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

Output:

-2/3*(-3*exp(4*x)*a*b+3*b^2*exp(4*x)+6*exp(2*x)*a^2+3*exp(2*x)*a*b-6*b^2*e 
xp(2*x)-2*a^2+3*b^2)/a^3/(exp(2*x)-1)^3-1/a^2*b*ln(exp(2*x)+(a-b)/(a+b))+1 
/a^4*b^3*ln(exp(2*x)+(a-b)/(a+b))+1/a^2*b*ln(exp(2*x)-1)-1/a^4*b^3*ln(exp( 
2*x)-1)
 

Fricas [B] (verification not implemented)

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

Time = 0.10 (sec) , antiderivative size = 912, normalized size of antiderivative = 11.69 \[ \int \frac {\text {csch}^4(x)}{a+b \tanh (x)} \, dx=\text {Too large to display} \] Input:

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

Output:

1/3*(6*(a^2*b - a*b^2)*cosh(x)^4 + 24*(a^2*b - a*b^2)*cosh(x)*sinh(x)^3 + 
6*(a^2*b - a*b^2)*sinh(x)^4 + 4*a^3 - 6*a*b^2 - 6*(2*a^3 + a^2*b - 2*a*b^2 
)*cosh(x)^2 - 6*(2*a^3 + a^2*b - 2*a*b^2 - 6*(a^2*b - a*b^2)*cosh(x)^2)*si 
nh(x)^2 - 3*((a^2*b - b^3)*cosh(x)^6 + 6*(a^2*b - b^3)*cosh(x)*sinh(x)^5 + 
 (a^2*b - b^3)*sinh(x)^6 - 3*(a^2*b - b^3)*cosh(x)^4 - 3*(a^2*b - b^3 - 5* 
(a^2*b - b^3)*cosh(x)^2)*sinh(x)^4 + 4*(5*(a^2*b - b^3)*cosh(x)^3 - 3*(a^2 
*b - b^3)*cosh(x))*sinh(x)^3 - a^2*b + b^3 + 3*(a^2*b - b^3)*cosh(x)^2 + 3 
*(5*(a^2*b - b^3)*cosh(x)^4 + a^2*b - b^3 - 6*(a^2*b - b^3)*cosh(x)^2)*sin 
h(x)^2 + 6*((a^2*b - b^3)*cosh(x)^5 - 2*(a^2*b - b^3)*cosh(x)^3 + (a^2*b - 
 b^3)*cosh(x))*sinh(x))*log(2*(a*cosh(x) + b*sinh(x))/(cosh(x) - sinh(x))) 
 + 3*((a^2*b - b^3)*cosh(x)^6 + 6*(a^2*b - b^3)*cosh(x)*sinh(x)^5 + (a^2*b 
 - b^3)*sinh(x)^6 - 3*(a^2*b - b^3)*cosh(x)^4 - 3*(a^2*b - b^3 - 5*(a^2*b 
- b^3)*cosh(x)^2)*sinh(x)^4 + 4*(5*(a^2*b - b^3)*cosh(x)^3 - 3*(a^2*b - b^ 
3)*cosh(x))*sinh(x)^3 - a^2*b + b^3 + 3*(a^2*b - b^3)*cosh(x)^2 + 3*(5*(a^ 
2*b - b^3)*cosh(x)^4 + a^2*b - b^3 - 6*(a^2*b - b^3)*cosh(x)^2)*sinh(x)^2 
+ 6*((a^2*b - b^3)*cosh(x)^5 - 2*(a^2*b - b^3)*cosh(x)^3 + (a^2*b - b^3)*c 
osh(x))*sinh(x))*log(2*sinh(x)/(cosh(x) - sinh(x))) + 12*(2*(a^2*b - a*b^2 
)*cosh(x)^3 - (2*a^3 + a^2*b - 2*a*b^2)*cosh(x))*sinh(x))/(a^4*cosh(x)^6 + 
 6*a^4*cosh(x)*sinh(x)^5 + a^4*sinh(x)^6 - 3*a^4*cosh(x)^4 + 3*a^4*cosh(x) 
^2 + 3*(5*a^4*cosh(x)^2 - a^4)*sinh(x)^4 - a^4 + 4*(5*a^4*cosh(x)^3 - 3...
 

Sympy [F]

\[ \int \frac {\text {csch}^4(x)}{a+b \tanh (x)} \, dx=\int \frac {\operatorname {csch}^{4}{\left (x \right )}}{a + b \tanh {\left (x \right )}}\, dx \] Input:

integrate(csch(x)**4/(a+b*tanh(x)),x)
 

Output:

Integral(csch(x)**4/(a + b*tanh(x)), x)
 

Maxima [B] (verification not implemented)

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

Time = 0.05 (sec) , antiderivative size = 161, normalized size of antiderivative = 2.06 \[ \int \frac {\text {csch}^4(x)}{a+b \tanh (x)} \, dx=-\frac {2 \, {\left (2 \, a^{2} - 3 \, b^{2} - 3 \, {\left (2 \, a^{2} - a b - 2 \, b^{2}\right )} e^{\left (-2 \, x\right )} - 3 \, {\left (a b + b^{2}\right )} e^{\left (-4 \, x\right )}\right )}}{3 \, {\left (3 \, a^{3} e^{\left (-2 \, x\right )} - 3 \, a^{3} e^{\left (-4 \, x\right )} + a^{3} e^{\left (-6 \, x\right )} - a^{3}\right )}} - \frac {{\left (a^{2} b - b^{3}\right )} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{4}} + \frac {{\left (a^{2} b - b^{3}\right )} \log \left (e^{\left (-x\right )} + 1\right )}{a^{4}} + \frac {{\left (a^{2} b - b^{3}\right )} \log \left (e^{\left (-x\right )} - 1\right )}{a^{4}} \] Input:

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

Output:

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

Giac [B] (verification not implemented)

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

Time = 0.13 (sec) , antiderivative size = 202, normalized size of antiderivative = 2.59 \[ \int \frac {\text {csch}^4(x)}{a+b \tanh (x)} \, dx=-\frac {{\left (a^{3} b + a^{2} b^{2} - a b^{3} - b^{4}\right )} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{5} + a^{4} b} + \frac {{\left (a^{2} b - b^{3}\right )} \log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right )}{a^{4}} - \frac {11 \, a^{2} b e^{\left (6 \, x\right )} - 11 \, b^{3} e^{\left (6 \, x\right )} - 45 \, a^{2} b e^{\left (4 \, x\right )} + 12 \, a b^{2} e^{\left (4 \, x\right )} + 33 \, b^{3} e^{\left (4 \, x\right )} + 24 \, a^{3} e^{\left (2 \, x\right )} + 45 \, a^{2} b e^{\left (2 \, x\right )} - 24 \, a b^{2} e^{\left (2 \, x\right )} - 33 \, b^{3} e^{\left (2 \, x\right )} - 8 \, a^{3} - 11 \, a^{2} b + 12 \, a b^{2} + 11 \, b^{3}}{6 \, a^{4} {\left (e^{\left (2 \, x\right )} - 1\right )}^{3}} \] Input:

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

Output:

-(a^3*b + a^2*b^2 - a*b^3 - b^4)*log(abs(a*e^(2*x) + b*e^(2*x) + a - b))/( 
a^5 + a^4*b) + (a^2*b - b^3)*log(abs(e^(2*x) - 1))/a^4 - 1/6*(11*a^2*b*e^( 
6*x) - 11*b^3*e^(6*x) - 45*a^2*b*e^(4*x) + 12*a*b^2*e^(4*x) + 33*b^3*e^(4* 
x) + 24*a^3*e^(2*x) + 45*a^2*b*e^(2*x) - 24*a*b^2*e^(2*x) - 33*b^3*e^(2*x) 
 - 8*a^3 - 11*a^2*b + 12*a*b^2 + 11*b^3)/(a^4*(e^(2*x) - 1)^3)
 

Mupad [B] (verification not implemented)

Time = 2.32 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.58 \[ \int \frac {\text {csch}^4(x)}{a+b \tanh (x)} \, dx=\frac {2\,b\,\left (a-b\right )}{a^3\,\left ({\mathrm {e}}^{2\,x}-1\right )}-\frac {2\,\left (2\,a-b\right )}{a^2\,\left ({\mathrm {e}}^{4\,x}-2\,{\mathrm {e}}^{2\,x}+1\right )}-\frac {8}{3\,a\,\left (3\,{\mathrm {e}}^{2\,x}-3\,{\mathrm {e}}^{4\,x}+{\mathrm {e}}^{6\,x}-1\right )}-\frac {b\,\ln \left (a-b+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )\,\left (a+b\right )\,\left (a-b\right )}{a^4}+\frac {b\,\ln \left ({\mathrm {e}}^{2\,x}-1\right )\,\left (a+b\right )\,\left (a-b\right )}{a^4} \] Input:

int(1/(sinh(x)^4*(a + b*tanh(x))),x)
 

Output:

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

Reduce [B] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 567, normalized size of antiderivative = 7.27 \[ \int \frac {\text {csch}^4(x)}{a+b \tanh (x)} \, dx=\frac {-9 e^{2 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) a^{2} b -4 a \,b^{2}-2 e^{6 x} a \,b^{2}-9 e^{4 x} \mathrm {log}\left (e^{x}-1\right ) a^{2} b -9 e^{4 x} \mathrm {log}\left (e^{x}+1\right ) a^{2} b +9 e^{2 x} \mathrm {log}\left (e^{x}-1\right ) a^{2} b +9 e^{2 x} \mathrm {log}\left (e^{x}+1\right ) a^{2} b -12 e^{2 x} a^{3}+4 a^{3}+3 \,\mathrm {log}\left (e^{x}-1\right ) b^{3}+3 \,\mathrm {log}\left (e^{x}+1\right ) b^{3}-3 \,\mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) b^{3}-3 e^{6 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) a^{2} b +9 e^{4 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) a^{2} b +2 e^{6 x} a^{2} b +6 e^{2 x} a \,b^{2}+3 e^{6 x} \mathrm {log}\left (e^{x}-1\right ) a^{2} b +3 e^{6 x} \mathrm {log}\left (e^{x}+1\right ) a^{2} b -3 e^{6 x} \mathrm {log}\left (e^{x}-1\right ) b^{3}-3 e^{6 x} \mathrm {log}\left (e^{x}+1\right ) b^{3}+3 e^{6 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) b^{3}+9 e^{4 x} \mathrm {log}\left (e^{x}-1\right ) b^{3}+9 e^{4 x} \mathrm {log}\left (e^{x}+1\right ) b^{3}-9 e^{4 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) b^{3}-9 e^{2 x} \mathrm {log}\left (e^{x}-1\right ) b^{3}-9 e^{2 x} \mathrm {log}\left (e^{x}+1\right ) b^{3}+9 e^{2 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) b^{3}+3 \,\mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) a^{2} b -3 \,\mathrm {log}\left (e^{x}-1\right ) a^{2} b -3 \,\mathrm {log}\left (e^{x}+1\right ) a^{2} b -2 a^{2} b}{3 a^{4} \left (e^{6 x}-3 e^{4 x}+3 e^{2 x}-1\right )} \] Input:

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

Output:

(3*e**(6*x)*log(e**x - 1)*a**2*b - 3*e**(6*x)*log(e**x - 1)*b**3 + 3*e**(6 
*x)*log(e**x + 1)*a**2*b - 3*e**(6*x)*log(e**x + 1)*b**3 - 3*e**(6*x)*log( 
e**(2*x)*a + e**(2*x)*b + a - b)*a**2*b + 3*e**(6*x)*log(e**(2*x)*a + e**( 
2*x)*b + a - b)*b**3 + 2*e**(6*x)*a**2*b - 2*e**(6*x)*a*b**2 - 9*e**(4*x)* 
log(e**x - 1)*a**2*b + 9*e**(4*x)*log(e**x - 1)*b**3 - 9*e**(4*x)*log(e**x 
 + 1)*a**2*b + 9*e**(4*x)*log(e**x + 1)*b**3 + 9*e**(4*x)*log(e**(2*x)*a + 
 e**(2*x)*b + a - b)*a**2*b - 9*e**(4*x)*log(e**(2*x)*a + e**(2*x)*b + a - 
 b)*b**3 + 9*e**(2*x)*log(e**x - 1)*a**2*b - 9*e**(2*x)*log(e**x - 1)*b**3 
 + 9*e**(2*x)*log(e**x + 1)*a**2*b - 9*e**(2*x)*log(e**x + 1)*b**3 - 9*e** 
(2*x)*log(e**(2*x)*a + e**(2*x)*b + a - b)*a**2*b + 9*e**(2*x)*log(e**(2*x 
)*a + e**(2*x)*b + a - b)*b**3 - 12*e**(2*x)*a**3 + 6*e**(2*x)*a*b**2 - 3* 
log(e**x - 1)*a**2*b + 3*log(e**x - 1)*b**3 - 3*log(e**x + 1)*a**2*b + 3*l 
og(e**x + 1)*b**3 + 3*log(e**(2*x)*a + e**(2*x)*b + a - b)*a**2*b - 3*log( 
e**(2*x)*a + e**(2*x)*b + a - b)*b**3 + 4*a**3 - 2*a**2*b - 4*a*b**2)/(3*a 
**4*(e**(6*x) - 3*e**(4*x) + 3*e**(2*x) - 1))