3.141 \(\int \frac{\tanh ^3(x)}{a+b \coth (x)} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.325755, antiderivative size = 76, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {3569, 3649, 3652, 3530, 3475} \[ -\frac{b x}{a^2-b^2}+\frac{\left (a^2+b^2\right ) \log (\cosh (x))}{a^3}+\frac{b^4 \log (a \sinh (x)+b \cosh (x))}{a^3 \left (a^2-b^2\right )}+\frac{b \tanh (x)}{a^2}-\frac{\tanh ^2(x)}{2 a} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3569

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 + 1)*(c + d*Tan[e + f*x])^(n + 1))/(f*(m + 1)*(a^2 + b^2)*(b*c - a*d)), x] + D
ist[1/((m + 1)*(a^2 + b^2)*(b*c - a*d)), Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[a*(b*c -
 a*d)*(m + 1) - b^2*d*(m + n + 2) - b*(b*c - a*d)*(m + 1)*Tan[e + f*x] - b^2*d*(m + n + 2)*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] && I
ntegerQ[2*m] && LtQ[m, -1] && (LtQ[n, 0] || IntegerQ[m]) &&  !(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] &&
NeQ[a, 0])))

Rule 3649

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*t
an[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[((A*b^2 - a*(b*B - a*C))*(a + b*T
an[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^(n + 1))/(f*(m + 1)*(b*c - a*d)*(a^2 + b^2)), x] + Dist[1/((m + 1)*(
b*c - a*d)*(a^2 + b^2)), Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[A*(a*(b*c - a*d)*(m + 1)
 - b^2*d*(m + n + 2)) + (b*B - a*C)*(b*c*(m + 1) + a*d*(n + 1)) - (m + 1)*(b*c - a*d)*(A*b - a*B - b*C)*Tan[e
+ f*x] - d*(A*b^2 - a*(b*B - a*C))*(m + n + 2)*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] && LtQ[m, -1] &&  !(ILtQ[n, -1] && ( !I
ntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))

Rule 3652

Int[((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.)
 + (f_.)*(x_)])), x_Symbol] :> Simp[((a*(A*c - c*C) - b*(A*d - C*d))*x)/((a^2 + b^2)*(c^2 + d^2)), x] + (Dist[
(A*b^2 + a^2*C)/((b*c - a*d)*(a^2 + b^2)), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x] - Dist[(c^2*C
 + A*d^2)/((b*c - a*d)*(c^2 + d^2)), Int[(d - c*Tan[e + f*x])/(c + d*Tan[e + f*x]), x], x]) /; FreeQ[{a, b, c,
 d, e, f, A, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

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

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.053, size = 167, normalized size = 2.2 \begin{align*} -32\,{\frac{\ln \left ( \tanh \left ( x/2 \right ) +1 \right ) }{32\,a-32\,b}}-32\,{\frac{\ln \left ( \tanh \left ( x/2 \right ) -1 \right ) }{32\,a+32\,b}}+2\,{\frac{ \left ( \tanh \left ( x/2 \right ) \right ) ^{3}b}{{a}^{2} \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}-2\,{\frac{ \left ( \tanh \left ( x/2 \right ) \right ) ^{2}}{a \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+2\,{\frac{\tanh \left ( x/2 \right ) b}{{a}^{2} \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) ^{2}}}+{\frac{1}{a}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) }+{\frac{{b}^{2}}{{a}^{3}}\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) }+{\frac{{b}^{4}}{ \left ( a+b \right ) \left ( a-b \right ){a}^{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(tanh(x)^3/(a+b*coth(x)),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.73305, size = 127, normalized size = 1.67 \begin{align*} \frac{b^{4} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} + a + b\right )}{a^{5} - a^{3} b^{2}} + \frac{2 \,{\left ({\left (a + b\right )} e^{\left (-2 \, x\right )} + b\right )}}{2 \, a^{2} e^{\left (-2 \, x\right )} + a^{2} e^{\left (-4 \, x\right )} + a^{2}} + \frac{x}{a + b} + \frac{{\left (a^{2} + b^{2}\right )} \log \left (e^{\left (-2 \, x\right )} + 1\right )}{a^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 3.24519, size = 1539, normalized size = 20.25 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(x)**3/(a+b*coth(x)),x)

[Out]

Integral(tanh(x)**3/(a + b*coth(x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.17562, size = 131, normalized size = 1.72 \begin{align*} \frac{b^{4} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} - a + b \right |}\right )}{a^{5} - a^{3} b^{2}} - \frac{x}{a - b} + \frac{{\left (a^{2} + b^{2}\right )} \log \left (e^{\left (2 \, x\right )} + 1\right )}{a^{3}} - \frac{2 \,{\left (a b -{\left (a^{2} - a b\right )} e^{\left (2 \, x\right )}\right )}}{a^{3}{\left (e^{\left (2 \, x\right )} + 1\right )}^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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