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

Optimal. Leaf size=78 \[ \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} \]

[Out]

(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(tanh(x))/a^4-b*(a^2-b^2)*ln(a+b*tanh(
x))/a^4

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3597, 908} \begin {gather*} \frac {b \coth ^2(x)}{2 a^2}+\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}+\frac {\left (a^2-b^2\right ) \coth (x)}{a^3}-\frac {\coth ^3(x)}{3 a} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

((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[Tanh[x]])/a^4 - (b*(a
^2 - b^2)*Log[a + b*Tanh[x]])/a^4

Rule 908

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 3597

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]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.21, size = 70, normalized size = 0.90 \begin {gather*} \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} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.75, size = 146, normalized size = 1.87

method result size
risch \(-\frac {2 \left (-3 a b \,{\mathrm e}^{4 x}+3 b^{2} {\mathrm e}^{4 x}+6 a^{2} {\mathrm e}^{2 x}+3 a b \,{\mathrm e}^{2 x}-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 {\left (\tanh ^{3}\left (\frac {x}{2}\right )\right ) a^{2}}{3}-a b \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-3 a^{2} \tanh \left (\frac {x}{2}\right )+4 b^{2} \tanh \left (\frac {x}{2}\right )}{8 a^{3}}-\frac {2 b \left (\frac {a^{2}}{2}-\frac {b^{2}}{2}\right ) \ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 b \tanh \left (\frac {x}{2}\right )+a \right )}{a^{4}}-\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}}\) \(146\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/8/a^3*(1/3*tanh(1/2*x)^3*a^2-a*b*tanh(1/2*x)^2-3*a^2*tanh(1/2*x)+4*b^2*tanh(1/2*x))-2*b/a^4*(1/2*a^2-1/2*b^
2)*ln(a*tanh(1/2*x)^2+2*b*tanh(1/2*x)+a)-1/24/a/tanh(1/2*x)^3-1/8/a^3*(-3*a^2+4*b^2)/tanh(1/2*x)+1/8*b/a^2/tan
h(1/2*x)^2+1/a^4*b*(a^2-b^2)*ln(tanh(1/2*x))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 161 vs. \(2 (74) = 148\).
time = 0.29, size = 161, normalized size = 2.06 \begin {gather*} -\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}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 912 vs. \(2 (74) = 148\).
time = 0.36, size = 912, normalized size = 11.69 \begin {gather*} \frac {6 \, {\left (a^{2} b - a b^{2}\right )} \cosh \left (x\right )^{4} + 24 \, {\left (a^{2} b - a b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + 6 \, {\left (a^{2} b - a b^{2}\right )} \sinh \left (x\right )^{4} + 4 \, a^{3} - 6 \, a b^{2} - 6 \, {\left (2 \, a^{3} + a^{2} b - 2 \, a b^{2}\right )} \cosh \left (x\right )^{2} - 6 \, {\left (2 \, a^{3} + a^{2} b - 2 \, a b^{2} - 6 \, {\left (a^{2} b - a b^{2}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} - 3 \, {\left ({\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{6} + 6 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{5} + {\left (a^{2} b - b^{3}\right )} \sinh \left (x\right )^{6} - 3 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{4} - 3 \, {\left (a^{2} b - b^{3} - 5 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{4} + 4 \, {\left (5 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{3} - 3 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} - a^{2} b + b^{3} + 3 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2} + 3 \, {\left (5 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{4} + a^{2} b - b^{3} - 6 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 6 \, {\left ({\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{5} - 2 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{3} + {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\frac {2 \, {\left (a \cosh \left (x\right ) + b \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + 3 \, {\left ({\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{6} + 6 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{5} + {\left (a^{2} b - b^{3}\right )} \sinh \left (x\right )^{6} - 3 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{4} - 3 \, {\left (a^{2} b - b^{3} - 5 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{4} + 4 \, {\left (5 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{3} - 3 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} - a^{2} b + b^{3} + 3 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2} + 3 \, {\left (5 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{4} + a^{2} b - b^{3} - 6 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 6 \, {\left ({\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{5} - 2 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{3} + {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\frac {2 \, \sinh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + 12 \, {\left (2 \, {\left (a^{2} b - a b^{2}\right )} \cosh \left (x\right )^{3} - {\left (2 \, a^{3} + a^{2} b - 2 \, a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{3 \, {\left (a^{4} \cosh \left (x\right )^{6} + 6 \, a^{4} \cosh \left (x\right ) \sinh \left (x\right )^{5} + a^{4} \sinh \left (x\right )^{6} - 3 \, a^{4} \cosh \left (x\right )^{4} + 3 \, a^{4} \cosh \left (x\right )^{2} + 3 \, {\left (5 \, a^{4} \cosh \left (x\right )^{2} - a^{4}\right )} \sinh \left (x\right )^{4} - a^{4} + 4 \, {\left (5 \, a^{4} \cosh \left (x\right )^{3} - 3 \, a^{4} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} + 3 \, {\left (5 \, a^{4} \cosh \left (x\right )^{4} - 6 \, a^{4} \cosh \left (x\right )^{2} + a^{4}\right )} \sinh \left (x\right )^{2} + 6 \, {\left (a^{4} \cosh \left (x\right )^{5} - 2 \, a^{4} \cosh \left (x\right )^{3} + a^{4} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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)*
sinh(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)*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)*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)*cosh(x))*sinh(x))*log(2*sin
h(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*a^4*cosh(x))*sinh(x)^3 + 3*(5*a^4*cosh(x)^4 - 6*a^4*cosh(x)^2
+ a^4)*sinh(x)^2 + 6*(a^4*cosh(x)^5 - 2*a^4*cosh(x)^3 + a^4*cosh(x))*sinh(x))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\operatorname {csch}^{4}{\left (x \right )}}{a + b \tanh {\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 202 vs. \(2 (74) = 148\).
time = 0.42, size = 202, normalized size = 2.59 \begin {gather*} -\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}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(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 + 1
1*b^3)/(a^4*(e^(2*x) - 1)^3)

________________________________________________________________________________________

Mupad [B]
time = 1.33, size = 123, normalized size = 1.58 \begin {gather*} \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} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(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

________________________________________________________________________________________