\(\int \sin ^2(\coth (a+b x)) \, dx\) [218]

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

Optimal result

Integrand size = 9, antiderivative size = 115 \[ \int \sin ^2(\coth (a+b x)) \, dx=\frac {\cos (2) \operatorname {CosIntegral}(2-2 \coth (a+b x))}{4 b}-\frac {\cos (2) \operatorname {CosIntegral}(2+2 \coth (a+b x))}{4 b}-\frac {\log (1-\coth (a+b x))}{4 b}+\frac {\log (1+\coth (a+b x))}{4 b}+\frac {\sin (2) \text {Si}(2-2 \coth (a+b x))}{4 b}-\frac {\sin (2) \text {Si}(2+2 \coth (a+b x))}{4 b} \]

[Out]

1/4*Ci(2-2*coth(b*x+a))*cos(2)/b-1/4*Ci(2+2*coth(b*x+a))*cos(2)/b-1/4*ln(1-coth(b*x+a))/b+1/4*ln(1+coth(b*x+a)
)/b-1/4*Si(-2+2*coth(b*x+a))*sin(2)/b-1/4*Si(2+2*coth(b*x+a))*sin(2)/b

Rubi [A] (verified)

Time = 0.19 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.556, Rules used = {6857, 3393, 3384, 3380, 3383} \[ \int \sin ^2(\coth (a+b x)) \, dx=\frac {\cos (2) \operatorname {CosIntegral}(2-2 \coth (a+b x))}{4 b}-\frac {\cos (2) \operatorname {CosIntegral}(2 \coth (a+b x)+2)}{4 b}+\frac {\sin (2) \text {Si}(2-2 \coth (a+b x))}{4 b}-\frac {\sin (2) \text {Si}(2 \coth (a+b x)+2)}{4 b}-\frac {\log (1-\coth (a+b x))}{4 b}+\frac {\log (\coth (a+b x)+1)}{4 b} \]

[In]

Int[Sin[Coth[a + b*x]]^2,x]

[Out]

(Cos[2]*CosIntegral[2 - 2*Coth[a + b*x]])/(4*b) - (Cos[2]*CosIntegral[2 + 2*Coth[a + b*x]])/(4*b) - Log[1 - Co
th[a + b*x]]/(4*b) + Log[1 + Coth[a + b*x]]/(4*b) + (Sin[2]*SinIntegral[2 - 2*Coth[a + b*x]])/(4*b) - (Sin[2]*
SinIntegral[2 + 2*Coth[a + b*x]])/(4*b)

Rule 3380

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3383

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rule 3384

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[c*(f/d) + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[c*(f/d) + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3393

Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)]^(n_), x_Symbol] :> Int[ExpandTrigReduce[(c + d*x)^m, Sin
[e + f*x]^n, x], x] /; FreeQ[{c, d, e, f, m}, x] && IGtQ[n, 1] && ( !RationalQ[m] || (GeQ[m, -1] && LtQ[m, 1])
)

Rule 6857

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\sin ^2(x)}{1-x^2} \, dx,x,\coth (a+b x)\right )}{b} \\ & = \frac {\text {Subst}\left (\int \left (-\frac {\sin ^2(x)}{2 (-1+x)}+\frac {\sin ^2(x)}{2 (1+x)}\right ) \, dx,x,\coth (a+b x)\right )}{b} \\ & = -\frac {\text {Subst}\left (\int \frac {\sin ^2(x)}{-1+x} \, dx,x,\coth (a+b x)\right )}{2 b}+\frac {\text {Subst}\left (\int \frac {\sin ^2(x)}{1+x} \, dx,x,\coth (a+b x)\right )}{2 b} \\ & = -\frac {\text {Subst}\left (\int \left (\frac {1}{2 (-1+x)}-\frac {\cos (2 x)}{2 (-1+x)}\right ) \, dx,x,\coth (a+b x)\right )}{2 b}+\frac {\text {Subst}\left (\int \left (\frac {1}{2 (1+x)}-\frac {\cos (2 x)}{2 (1+x)}\right ) \, dx,x,\coth (a+b x)\right )}{2 b} \\ & = -\frac {\log (1-\coth (a+b x))}{4 b}+\frac {\log (1+\coth (a+b x))}{4 b}+\frac {\text {Subst}\left (\int \frac {\cos (2 x)}{-1+x} \, dx,x,\coth (a+b x)\right )}{4 b}-\frac {\text {Subst}\left (\int \frac {\cos (2 x)}{1+x} \, dx,x,\coth (a+b x)\right )}{4 b} \\ & = -\frac {\log (1-\coth (a+b x))}{4 b}+\frac {\log (1+\coth (a+b x))}{4 b}+\frac {\cos (2) \text {Subst}\left (\int \frac {\cos (2-2 x)}{-1+x} \, dx,x,\coth (a+b x)\right )}{4 b}-\frac {\cos (2) \text {Subst}\left (\int \frac {\cos (2+2 x)}{1+x} \, dx,x,\coth (a+b x)\right )}{4 b}+\frac {\sin (2) \text {Subst}\left (\int \frac {\sin (2-2 x)}{-1+x} \, dx,x,\coth (a+b x)\right )}{4 b}-\frac {\sin (2) \text {Subst}\left (\int \frac {\sin (2+2 x)}{1+x} \, dx,x,\coth (a+b x)\right )}{4 b} \\ & = \frac {\cos (2) \operatorname {CosIntegral}(2-2 \coth (a+b x))}{4 b}-\frac {\cos (2) \operatorname {CosIntegral}(2+2 \coth (a+b x))}{4 b}-\frac {\log (1-\coth (a+b x))}{4 b}+\frac {\log (1+\coth (a+b x))}{4 b}+\frac {\sin (2) \text {Si}(2-2 \coth (a+b x))}{4 b}-\frac {\sin (2) \text {Si}(2+2 \coth (a+b x))}{4 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.50 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.77 \[ \int \sin ^2(\coth (a+b x)) \, dx=\frac {\cos (2) \operatorname {CosIntegral}(2-2 \coth (a+b x))-\cos (2) \operatorname {CosIntegral}(2 (1+\coth (a+b x)))-\log (1-\coth (a+b x))+\log (1+\coth (a+b x))+\sin (2) \text {Si}(2-2 \coth (a+b x))-\sin (2) \text {Si}(2 (1+\coth (a+b x)))}{4 b} \]

[In]

Integrate[Sin[Coth[a + b*x]]^2,x]

[Out]

(Cos[2]*CosIntegral[2 - 2*Coth[a + b*x]] - Cos[2]*CosIntegral[2*(1 + Coth[a + b*x])] - Log[1 - Coth[a + b*x]]
+ Log[1 + Coth[a + b*x]] + Sin[2]*SinIntegral[2 - 2*Coth[a + b*x]] - Sin[2]*SinIntegral[2*(1 + Coth[a + b*x])]
)/(4*b)

Maple [A] (verified)

Time = 1.26 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.77

method result size
derivativedivides \(\frac {-\frac {\ln \left (\coth \left (b x +a \right )-1\right )}{4}+\frac {\ln \left (\coth \left (b x +a \right )+1\right )}{4}-\frac {\operatorname {Si}\left (-2+2 \coth \left (b x +a \right )\right ) \sin \left (2\right )}{4}+\frac {\operatorname {Ci}\left (-2+2 \coth \left (b x +a \right )\right ) \cos \left (2\right )}{4}-\frac {\operatorname {Si}\left (2+2 \coth \left (b x +a \right )\right ) \sin \left (2\right )}{4}-\frac {\operatorname {Ci}\left (2+2 \coth \left (b x +a \right )\right ) \cos \left (2\right )}{4}}{b}\) \(88\)
default \(\frac {-\frac {\ln \left (\coth \left (b x +a \right )-1\right )}{4}+\frac {\ln \left (\coth \left (b x +a \right )+1\right )}{4}-\frac {\operatorname {Si}\left (-2+2 \coth \left (b x +a \right )\right ) \sin \left (2\right )}{4}+\frac {\operatorname {Ci}\left (-2+2 \coth \left (b x +a \right )\right ) \cos \left (2\right )}{4}-\frac {\operatorname {Si}\left (2+2 \coth \left (b x +a \right )\right ) \sin \left (2\right )}{4}-\frac {\operatorname {Ci}\left (2+2 \coth \left (b x +a \right )\right ) \cos \left (2\right )}{4}}{b}\) \(88\)
risch \(\frac {{\mathrm e}^{2 i} \operatorname {Ei}_{1}\left (\frac {4 i {\mathrm e}^{-a}}{{\mathrm e}^{2 b x +a}-{\mathrm e}^{-a}}+4 i\right )}{8 b}-\frac {i \operatorname {csgn}\left (\frac {{\mathrm e}^{-a}}{-{\mathrm e}^{2 b x +a}+{\mathrm e}^{-a}}\right ) \pi \,{\mathrm e}^{-2 i}}{8 b}-\frac {i \operatorname {Si}\left (\frac {4 \,{\mathrm e}^{-a}}{{\mathrm e}^{2 b x +a}-{\mathrm e}^{-a}}\right ) {\mathrm e}^{-2 i}}{4 b}-\frac {{\mathrm e}^{-2 i} \operatorname {Ei}_{1}\left (-\frac {4 i {\mathrm e}^{-a}}{{\mathrm e}^{2 b x +a}-{\mathrm e}^{-a}}\right )}{8 b}+\frac {{\mathrm e}^{-2 i} \operatorname {Ei}_{1}\left (-\frac {4 i {\mathrm e}^{-a}}{{\mathrm e}^{2 b x +a}-{\mathrm e}^{-a}}-4 i\right )}{8 b}-\frac {{\mathrm e}^{2 i} \operatorname {Ei}_{1}\left (-\frac {4 i {\mathrm e}^{-a}}{{\mathrm e}^{2 b x +a}-{\mathrm e}^{-a}}\right )}{8 b}+\frac {\ln \left ({\mathrm e}^{b x}\right )}{2 b}\) \(214\)

[In]

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

[Out]

1/b*(-1/4*ln(coth(b*x+a)-1)+1/4*ln(coth(b*x+a)+1)-1/4*Si(-2+2*coth(b*x+a))*sin(2)+1/4*Ci(-2+2*coth(b*x+a))*cos
(2)-1/4*Si(2+2*coth(b*x+a))*sin(2)-1/4*Ci(2+2*coth(b*x+a))*cos(2))

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.27 (sec) , antiderivative size = 230, normalized size of antiderivative = 2.00 \[ \int \sin ^2(\coth (a+b x)) \, dx=\frac {4 \, b x \cos \left (2\right ) + 4 i \, b x \sin \left (2\right ) - {\left (\cos \left (2\right )^{2} + 2 i \, \cos \left (2\right ) \sin \left (2\right ) - \sin \left (2\right )^{2} + 1\right )} \operatorname {Ci}\left (\frac {2 \, {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}}{\sinh \left (b x + a\right )}\right ) + {\left (\cos \left (2\right )^{2} + 2 i \, \cos \left (2\right ) \sin \left (2\right ) - \sin \left (2\right )^{2} + 1\right )} \operatorname {Ci}\left (\frac {4}{\cosh \left (b x + a\right )^{2} + 2 \, \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + \sinh \left (b x + a\right )^{2} - 1}\right ) + {\left (i \, \cos \left (2\right )^{2} - 2 \, \cos \left (2\right ) \sin \left (2\right ) - i \, \sin \left (2\right )^{2} - i\right )} \operatorname {Si}\left (\frac {2 \, {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}}{\sinh \left (b x + a\right )}\right ) + {\left (i \, \cos \left (2\right )^{2} - 2 \, \cos \left (2\right ) \sin \left (2\right ) - i \, \sin \left (2\right )^{2} - i\right )} \operatorname {Si}\left (\frac {4}{\cosh \left (b x + a\right )^{2} + 2 \, \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + \sinh \left (b x + a\right )^{2} - 1}\right )}{8 \, {\left (b \cos \left (2\right ) + i \, b \sin \left (2\right )\right )}} \]

[In]

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

[Out]

1/8*(4*b*x*cos(2) + 4*I*b*x*sin(2) - (cos(2)^2 + 2*I*cos(2)*sin(2) - sin(2)^2 + 1)*cos_integral(2*(cosh(b*x +
a) + sinh(b*x + a))/sinh(b*x + a)) + (cos(2)^2 + 2*I*cos(2)*sin(2) - sin(2)^2 + 1)*cos_integral(4/(cosh(b*x +
a)^2 + 2*cosh(b*x + a)*sinh(b*x + a) + sinh(b*x + a)^2 - 1)) + (I*cos(2)^2 - 2*cos(2)*sin(2) - I*sin(2)^2 - I)
*sin_integral(2*(cosh(b*x + a) + sinh(b*x + a))/sinh(b*x + a)) + (I*cos(2)^2 - 2*cos(2)*sin(2) - I*sin(2)^2 -
I)*sin_integral(4/(cosh(b*x + a)^2 + 2*cosh(b*x + a)*sinh(b*x + a) + sinh(b*x + a)^2 - 1)))/(b*cos(2) + I*b*si
n(2))

Sympy [F]

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

[In]

integrate(sin(coth(b*x+a))**2,x)

[Out]

Integral(sin(coth(a + b*x))**2, x)

Maxima [F]

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

[In]

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

[Out]

1/2*x - 1/2*integrate(cos(2*(e^(2*b*x + 2*a) + 1)/(e^(2*b*x + 2*a) - 1)), x)

Giac [F]

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

[In]

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

[Out]

integrate(sin(coth(b*x + a))^2, x)

Mupad [F(-1)]

Timed out. \[ \int \sin ^2(\coth (a+b x)) \, dx=\int {\sin \left (\mathrm {coth}\left (a+b\,x\right )\right )}^2 \,d x \]

[In]

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

[Out]

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