3.2.50 \(\int \frac {x \text {csch}^2(x)}{(a+b \coth (x))^2} \, dx\) [150]

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

[Out]

-a*x/b/(a^2-b^2)+x/b/(a+b*coth(x))+ln(b*cosh(x)+a*sinh(x))/(a^2-b^2)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {5575, 3565, 3611} \begin {gather*} -\frac {a x}{b \left (a^2-b^2\right )}+\frac {\log (a \sinh (x)+b \cosh (x))}{a^2-b^2}+\frac {x}{b (a+b \coth (x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(x*Csch[x]^2)/(a + b*Coth[x])^2,x]

[Out]

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

Rule 3565

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

Rule 3611

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c/(b*f))
*Log[RemoveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]], 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 5575

Int[Csch[(c_.) + (d_.)*(x_)]^2*(Coth[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.)*((e_.) + (f_.)*(x_))^(m_.), x_Sym
bol] :> Simp[(-(e + f*x)^m)*((a + b*Coth[c + d*x])^(n + 1)/(b*d*(n + 1))), x] + Dist[f*(m/(b*d*(n + 1))), Int[
(e + f*x)^(m - 1)*(a + b*Coth[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && IGtQ[m, 0] && Ne
Q[n, -1]

Rubi steps

\begin {align*} \int \frac {x \text {csch}^2(x)}{(a+b \coth (x))^2} \, dx &=\frac {x}{b (a+b \coth (x))}-\frac {\int \frac {1}{a+b \coth (x)} \, dx}{b}\\ &=-\frac {a x}{b \left (a^2-b^2\right )}+\frac {x}{b (a+b \coth (x))}+\frac {i \int \frac {-i b-i a \coth (x)}{a+b \coth (x)} \, dx}{a^2-b^2}\\ &=-\frac {a x}{b \left (a^2-b^2\right )}+\frac {x}{b (a+b \coth (x))}+\frac {\log (b \cosh (x)+a \sinh (x))}{a^2-b^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.14, size = 49, normalized size = 0.91 \begin {gather*} \frac {a x-b \log (b \cosh (x)+a \sinh (x))}{-a^2 b+b^3}+\frac {x \sinh (x)}{b^2 \cosh (x)+a b \sinh (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(x*Csch[x]^2)/(a + b*Coth[x])^2,x]

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 1.30, size = 73, normalized size = 1.35

method result size
risch \(-\frac {2 x}{a^{2}-b^{2}}-\frac {2 x}{\left ({\mathrm e}^{2 x} a +b \,{\mathrm e}^{2 x}-a +b \right ) \left (a +b \right )}+\frac {\ln \left ({\mathrm e}^{2 x}-\frac {a -b}{a +b}\right )}{a^{2}-b^{2}}\) \(73\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*csch(x)^2/(a+b*coth(x))^2,x,method=_RETURNVERBOSE)

[Out]

-2/(a^2-b^2)*x-2*x/(exp(2*x)*a+b*exp(2*x)-a+b)/(a+b)+1/(a^2-b^2)*ln(exp(2*x)-(a-b)/(a+b))

________________________________________________________________________________________

Maxima [A]
time = 0.41, size = 68, normalized size = 1.26 \begin {gather*} \frac {2 \, x e^{\left (2 \, x\right )}}{a^{2} - 2 \, a b + b^{2} - {\left (a^{2} - b^{2}\right )} e^{\left (2 \, x\right )}} + \frac {\log \left (\frac {{\left (a + b\right )} e^{\left (2 \, x\right )} - a + b}{a + b}\right )}{a^{2} - b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x*e^(2*x)/(a^2 - 2*a*b + b^2 - (a^2 - b^2)*e^(2*x)) + log(((a + b)*e^(2*x) - a + b)/(a + b))/(a^2 - b^2)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 184 vs. \(2 (54) = 108\).
time = 0.42, size = 184, normalized size = 3.41 \begin {gather*} \frac {2 \, {\left (a + b\right )} x \cosh \left (x\right )^{2} + 4 \, {\left (a + b\right )} x \cosh \left (x\right ) \sinh \left (x\right ) + 2 \, {\left (a + b\right )} x \sinh \left (x\right )^{2} - {\left ({\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )^{2} - a + b\right )} \log \left (\frac {2 \, {\left (b \cosh \left (x\right ) + a \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{3} - a^{2} b - a b^{2} + b^{3} - {\left (a^{3} + a^{2} b - a b^{2} - b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{3} + a^{2} b - a b^{2} - b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right ) - {\left (a^{3} + a^{2} b - a b^{2} - b^{3}\right )} \sinh \left (x\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*(a + b)*x*cosh(x)^2 + 4*(a + b)*x*cosh(x)*sinh(x) + 2*(a + b)*x*sinh(x)^2 - ((a + b)*cosh(x)^2 + 2*(a + b)*
cosh(x)*sinh(x) + (a + b)*sinh(x)^2 - a + b)*log(2*(b*cosh(x) + a*sinh(x))/(cosh(x) - sinh(x))))/(a^3 - a^2*b
- a*b^2 + b^3 - (a^3 + a^2*b - a*b^2 - b^3)*cosh(x)^2 - 2*(a^3 + a^2*b - a*b^2 - b^3)*cosh(x)*sinh(x) - (a^3 +
 a^2*b - a*b^2 - b^3)*sinh(x)^2)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*csch(x)**2/(a+b*coth(x))**2,x)

[Out]

Integral(x*csch(x)**2/(a + b*coth(x))**2, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 169 vs. \(2 (54) = 108\).
time = 0.42, size = 169, normalized size = 3.13 \begin {gather*} -\frac {2 \, a x e^{\left (2 \, x\right )} + 2 \, b x e^{\left (2 \, x\right )} - a e^{\left (2 \, x\right )} \log \left (a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} - a + b\right ) - b e^{\left (2 \, x\right )} \log \left (a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} - a + b\right ) + a \log \left (a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} - a + b\right ) - b \log \left (a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} - a + b\right )}{a^{3} e^{\left (2 \, x\right )} + a^{2} b e^{\left (2 \, x\right )} - a b^{2} e^{\left (2 \, x\right )} - b^{3} e^{\left (2 \, x\right )} - a^{3} + a^{2} b + a b^{2} - b^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 1.28, size = 68, normalized size = 1.26 \begin {gather*} \frac {\ln \left (b-a+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{a^2-b^2}-\frac {2\,x}{a^2-b^2}-\frac {2\,x}{\left (a+b\right )\,\left (b-a+{\mathrm {e}}^{2\,x}\,\left (a+b\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x/(sinh(x)^2*(a + b*coth(x))^2),x)

[Out]

log(b - a + a*exp(2*x) + b*exp(2*x))/(a^2 - b^2) - (2*x)/(a^2 - b^2) - (2*x)/((a + b)*(b - a + exp(2*x)*(a + b
)))

________________________________________________________________________________________