\(\int \frac {\coth ^2(x)}{a+b \sinh (x)} \, dx\) [233]

   Optimal result
   Rubi [A] (verified)
   Mathematica [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)

Optimal result

Integrand size = 13, antiderivative size = 56 \[ \int \frac {\coth ^2(x)}{a+b \sinh (x)} \, dx=\frac {b \text {arctanh}(\cosh (x))}{a^2}-\frac {2 \sqrt {a^2+b^2} \text {arctanh}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a^2}-\frac {\coth (x)}{a} \]

[Out]

b*arctanh(cosh(x))/a^2-coth(x)/a-2*arctanh((b-a*tanh(1/2*x))/(a^2+b^2)^(1/2))*(a^2+b^2)^(1/2)/a^2

Rubi [A] (verified)

Time = 0.15 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {2802, 3135, 3080, 3855, 2739, 632, 212} \[ \int \frac {\coth ^2(x)}{a+b \sinh (x)} \, dx=-\frac {2 \sqrt {a^2+b^2} \text {arctanh}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a^2}+\frac {b \text {arctanh}(\cosh (x))}{a^2}-\frac {\coth (x)}{a} \]

[In]

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

[Out]

(b*ArcTanh[Cosh[x]])/a^2 - (2*Sqrt[a^2 + b^2]*ArcTanh[(b - a*Tanh[x/2])/Sqrt[a^2 + b^2]])/a^2 - Coth[x]/a

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

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

Rule 2739

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[2*(e/d), Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 2802

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)/tan[(e_.) + (f_.)*(x_)]^2, x_Symbol] :> Int[(a + b*Sin[e + f*x
])^m*((1 - Sin[e + f*x]^2)/Sin[e + f*x]^2), x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2 - b^2, 0]

Rule 3080

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

Rule 3135

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (C_.)*s
in[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(A*b^2 + a^2*C))*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1)*((c
+ d*Sin[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*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[a*(m + 1)*(b*c - a*d)*(A + C) + d*(A*b^2 + a^2*C
)*(m + n + 2) - (c*(A*b^2 + a^2*C) + b*(m + 1)*(b*c - a*d)*(A + C))*Sin[e + f*x] - d*(A*b^2 + a^2*C)*(m + n +
3)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2,
0] && NeQ[c^2 - d^2, 0] && LtQ[m, -1] && ((EqQ[a, 0] && IntegerQ[m] &&  !IntegerQ[n]) ||  !(IntegerQ[2*n] && L
tQ[n, -1] && ((IntegerQ[n] &&  !IntegerQ[m]) || EqQ[a, 0])))

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\text {csch}^2(x) \left (1+\sinh ^2(x)\right )}{a+b \sinh (x)} \, dx \\ & = -\frac {\coth (x)}{a}+\frac {i \int \frac {\text {csch}(x) (i b-i a \sinh (x))}{a+b \sinh (x)} \, dx}{a} \\ & = -\frac {\coth (x)}{a}-\frac {b \int \text {csch}(x) \, dx}{a^2}+\frac {\left (a^2+b^2\right ) \int \frac {1}{a+b \sinh (x)} \, dx}{a^2} \\ & = \frac {b \text {arctanh}(\cosh (x))}{a^2}-\frac {\coth (x)}{a}+\frac {\left (2 \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x-a x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{a^2} \\ & = \frac {b \text {arctanh}(\cosh (x))}{a^2}-\frac {\coth (x)}{a}-\frac {\left (4 \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,2 b-2 a \tanh \left (\frac {x}{2}\right )\right )}{a^2} \\ & = \frac {b \text {arctanh}(\cosh (x))}{a^2}-\frac {2 \sqrt {a^2+b^2} \text {arctanh}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a^2}-\frac {\coth (x)}{a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.24 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.59 \[ \int \frac {\coth ^2(x)}{a+b \sinh (x)} \, dx=-\frac {4 \sqrt {-a^2-b^2} \arctan \left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )+a \coth \left (\frac {x}{2}\right )-2 b \log \left (\cosh \left (\frac {x}{2}\right )\right )+2 b \log \left (\sinh \left (\frac {x}{2}\right )\right )+a \tanh \left (\frac {x}{2}\right )}{2 a^2} \]

[In]

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

[Out]

-1/2*(4*Sqrt[-a^2 - b^2]*ArcTan[(b - a*Tanh[x/2])/Sqrt[-a^2 - b^2]] + a*Coth[x/2] - 2*b*Log[Cosh[x/2]] + 2*b*L
og[Sinh[x/2]] + a*Tanh[x/2])/a^2

Maple [A] (verified)

Time = 0.68 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.45

method result size
default \(-\frac {\tanh \left (\frac {x}{2}\right )}{2 a}-\frac {\left (-4 a^{2}-4 b^{2}\right ) \operatorname {arctanh}\left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{2 a^{2} \sqrt {a^{2}+b^{2}}}-\frac {1}{2 a \tanh \left (\frac {x}{2}\right )}-\frac {b \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a^{2}}\) \(81\)
risch \(-\frac {2}{a \left ({\mathrm e}^{2 x}-1\right )}+\frac {b \ln \left ({\mathrm e}^{x}+1\right )}{a^{2}}-\frac {b \ln \left ({\mathrm e}^{x}-1\right )}{a^{2}}+\frac {\sqrt {a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{x}-\frac {-a +\sqrt {a^{2}+b^{2}}}{b}\right )}{a^{2}}-\frac {\sqrt {a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{x}+\frac {a +\sqrt {a^{2}+b^{2}}}{b}\right )}{a^{2}}\) \(104\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 228 vs. \(2 (52) = 104\).

Time = 0.30 (sec) , antiderivative size = 228, normalized size of antiderivative = 4.07 \[ \int \frac {\coth ^2(x)}{a+b \sinh (x)} \, dx=\frac {\sqrt {a^{2} + b^{2}} {\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} - 1\right )} \log \left (\frac {b^{2} \cosh \left (x\right )^{2} + b^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{b \cosh \left (x\right )^{2} + b \sinh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) + 2 \, {\left (b \cosh \left (x\right ) + a\right )} \sinh \left (x\right ) - b}\right ) + {\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} - b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - {\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} - b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right ) - 2 \, a}{a^{2} \cosh \left (x\right )^{2} + 2 \, a^{2} \cosh \left (x\right ) \sinh \left (x\right ) + a^{2} \sinh \left (x\right )^{2} - a^{2}} \]

[In]

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

[Out]

(sqrt(a^2 + b^2)*(cosh(x)^2 + 2*cosh(x)*sinh(x) + sinh(x)^2 - 1)*log((b^2*cosh(x)^2 + b^2*sinh(x)^2 + 2*a*b*co
sh(x) + 2*a^2 + b^2 + 2*(b^2*cosh(x) + a*b)*sinh(x) - 2*sqrt(a^2 + b^2)*(b*cosh(x) + b*sinh(x) + a))/(b*cosh(x
)^2 + b*sinh(x)^2 + 2*a*cosh(x) + 2*(b*cosh(x) + a)*sinh(x) - b)) + (b*cosh(x)^2 + 2*b*cosh(x)*sinh(x) + b*sin
h(x)^2 - b)*log(cosh(x) + sinh(x) + 1) - (b*cosh(x)^2 + 2*b*cosh(x)*sinh(x) + b*sinh(x)^2 - b)*log(cosh(x) + s
inh(x) - 1) - 2*a)/(a^2*cosh(x)^2 + 2*a^2*cosh(x)*sinh(x) + a^2*sinh(x)^2 - a^2)

Sympy [F]

\[ \int \frac {\coth ^2(x)}{a+b \sinh (x)} \, dx=\int \frac {\coth ^{2}{\left (x \right )}}{a + b \sinh {\left (x \right )}}\, dx \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.73 \[ \int \frac {\coth ^2(x)}{a+b \sinh (x)} \, dx=\frac {b \log \left (e^{\left (-x\right )} + 1\right )}{a^{2}} - \frac {b \log \left (e^{\left (-x\right )} - 1\right )}{a^{2}} + \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {b e^{\left (-x\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-x\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{a^{2}} + \frac {2}{a e^{\left (-2 \, x\right )} - a} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.70 \[ \int \frac {\coth ^2(x)}{a+b \sinh (x)} \, dx=\frac {b \log \left (e^{x} + 1\right )}{a^{2}} - \frac {b \log \left ({\left | e^{x} - 1 \right |}\right )}{a^{2}} + \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {{\left | 2 \, b e^{x} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{x} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{a^{2}} - \frac {2}{a {\left (e^{\left (2 \, x\right )} - 1\right )}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 1.56 (sec) , antiderivative size = 304, normalized size of antiderivative = 5.43 \[ \int \frac {\coth ^2(x)}{a+b \sinh (x)} \, dx=\frac {2}{a-a\,{\mathrm {e}}^{2\,x}}-\frac {b\,\ln \left (32\,a^2+32\,b^2-32\,a^2\,{\mathrm {e}}^x-32\,b^2\,{\mathrm {e}}^x\right )}{a^2}+\frac {b\,\ln \left (32\,a^2+32\,b^2+32\,a^2\,{\mathrm {e}}^x+32\,b^2\,{\mathrm {e}}^x\right )}{a^2}+\frac {\ln \left (128\,a^4\,{\mathrm {e}}^x-64\,a\,b^3-64\,a^3\,b-32\,b^3\,\sqrt {a^2+b^2}+32\,b^4\,{\mathrm {e}}^x+128\,a^3\,{\mathrm {e}}^x\,\sqrt {a^2+b^2}+160\,a^2\,b^2\,{\mathrm {e}}^x-64\,a^2\,b\,\sqrt {a^2+b^2}+96\,a\,b^2\,{\mathrm {e}}^x\,\sqrt {a^2+b^2}\right )\,\sqrt {a^2+b^2}}{a^2}-\frac {\ln \left (32\,b^3\,\sqrt {a^2+b^2}-64\,a\,b^3-64\,a^3\,b+128\,a^4\,{\mathrm {e}}^x+32\,b^4\,{\mathrm {e}}^x-128\,a^3\,{\mathrm {e}}^x\,\sqrt {a^2+b^2}+160\,a^2\,b^2\,{\mathrm {e}}^x+64\,a^2\,b\,\sqrt {a^2+b^2}-96\,a\,b^2\,{\mathrm {e}}^x\,\sqrt {a^2+b^2}\right )\,\sqrt {a^2+b^2}}{a^2} \]

[In]

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

[Out]

2/(a - a*exp(2*x)) - (b*log(32*a^2 + 32*b^2 - 32*a^2*exp(x) - 32*b^2*exp(x)))/a^2 + (b*log(32*a^2 + 32*b^2 + 3
2*a^2*exp(x) + 32*b^2*exp(x)))/a^2 + (log(128*a^4*exp(x) - 64*a*b^3 - 64*a^3*b - 32*b^3*(a^2 + b^2)^(1/2) + 32
*b^4*exp(x) + 128*a^3*exp(x)*(a^2 + b^2)^(1/2) + 160*a^2*b^2*exp(x) - 64*a^2*b*(a^2 + b^2)^(1/2) + 96*a*b^2*ex
p(x)*(a^2 + b^2)^(1/2))*(a^2 + b^2)^(1/2))/a^2 - (log(32*b^3*(a^2 + b^2)^(1/2) - 64*a*b^3 - 64*a^3*b + 128*a^4
*exp(x) + 32*b^4*exp(x) - 128*a^3*exp(x)*(a^2 + b^2)^(1/2) + 160*a^2*b^2*exp(x) + 64*a^2*b*(a^2 + b^2)^(1/2) -
 96*a*b^2*exp(x)*(a^2 + b^2)^(1/2))*(a^2 + b^2)^(1/2))/a^2