\(\int \sin ^2(\tanh (a+b x)) \, dx\) [252]

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.65 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.88, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {4853, 7276, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sin ^2(\tanh (a+b x)) \, dx\)

\(\Big \downarrow \) 4853

\(\displaystyle \frac {\int \frac {\sin ^2(\tanh (a+b x))}{1-\tanh ^2(a+b x)}d\tanh (a+b x)}{b}\)

\(\Big \downarrow \) 7276

\(\displaystyle \frac {\int \left (\frac {\sin ^2(\tanh (a+b x))}{2 (\tanh (a+b x)+1)}-\frac {\sin ^2(\tanh (a+b x))}{2 (\tanh (a+b x)-1)}\right )d\tanh (a+b x)}{b}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {1}{4} \cos (2) \operatorname {CosIntegral}(2-2 \tanh (a+b x))-\frac {1}{4} \cos (2) \operatorname {CosIntegral}(2 \tanh (a+b x)+2)+\frac {1}{4} \sin (2) \text {Si}(2-2 \tanh (a+b x))-\frac {1}{4} \sin (2) \text {Si}(2 \tanh (a+b x)+2)-\frac {1}{4} \log (1-\tanh (a+b x))+\frac {1}{4} \log (\tanh (a+b x)+1)}{b}\)

Input:

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

Output:

((Cos[2]*CosIntegral[2 - 2*Tanh[a + b*x]])/4 - (Cos[2]*CosIntegral[2 + 2*T 
anh[a + b*x]])/4 - Log[1 - Tanh[a + b*x]]/4 + Log[1 + Tanh[a + b*x]]/4 + ( 
Sin[2]*SinIntegral[2 - 2*Tanh[a + b*x]])/4 - (Sin[2]*SinIntegral[2 + 2*Tan 
h[a + b*x]])/4)/b
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 4853
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, Simp[With[{d = FreeFa 
ctors[Tan[v], x]}, d/Coefficient[v, x, 1]   Subst[Int[SubstFor[1/(1 + d^2*x 
^2), Tan[v]/d, u, x], x], x, Tan[v]/d]], x] /;  !FalseQ[v] && FunctionOfQ[N 
onfreeFactors[Tan[v], x], u, x, True] && TryPureTanSubst[ActivateTrig[u], x 
]]
 

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

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

method result size
derivativedivides \(\frac {-\frac {\ln \left (-1+\tanh \left (b x +a \right )\right )}{4}+\frac {\ln \left (1+\tanh \left (b x +a \right )\right )}{4}-\frac {\operatorname {Si}\left (2+2 \tanh \left (b x +a \right )\right ) \sin \left (2\right )}{4}-\frac {\operatorname {Ci}\left (2+2 \tanh \left (b x +a \right )\right ) \cos \left (2\right )}{4}-\frac {\operatorname {Si}\left (-2+2 \tanh \left (b x +a \right )\right ) \sin \left (2\right )}{4}+\frac {\operatorname {Ci}\left (-2+2 \tanh \left (b x +a \right )\right ) \cos \left (2\right )}{4}}{b}\) \(88\)
default \(\frac {-\frac {\ln \left (-1+\tanh \left (b x +a \right )\right )}{4}+\frac {\ln \left (1+\tanh \left (b x +a \right )\right )}{4}-\frac {\operatorname {Si}\left (2+2 \tanh \left (b x +a \right )\right ) \sin \left (2\right )}{4}-\frac {\operatorname {Ci}\left (2+2 \tanh \left (b x +a \right )\right ) \cos \left (2\right )}{4}-\frac {\operatorname {Si}\left (-2+2 \tanh \left (b x +a \right )\right ) \sin \left (2\right )}{4}+\frac {\operatorname {Ci}\left (-2+2 \tanh \left (b x +a \right )\right ) \cos \left (2\right )}{4}}{b}\) \(88\)
risch \(-\frac {{\mathrm e}^{-2 i} \operatorname {expIntegral}_{1}\left (-\frac {4 i}{1+{\mathrm e}^{2 b x +2 a}}\right )}{8 b}+\frac {{\mathrm e}^{-2 i} \operatorname {expIntegral}_{1}\left (\frac {4 i}{1+{\mathrm e}^{2 b x +2 a}}-4 i\right )}{8 b}+\frac {{\mathrm e}^{2 i} \operatorname {expIntegral}_{1}\left (-\frac {4 i}{1+{\mathrm e}^{2 b x +2 a}}+4 i\right )}{8 b}-\frac {{\mathrm e}^{2 i} \operatorname {expIntegral}_{1}\left (\frac {4 i}{1+{\mathrm e}^{2 b x +2 a}}\right )}{8 b}+\frac {x}{2}\) \(115\)

Input:

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

Output:

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

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.11 (sec) , antiderivative size = 230, normalized size of antiderivative = 2.00 \[ \int \sin ^2(\tanh (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 )}}{\cosh \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 )}}{\cosh \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 )}} \] Input:

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

Output:

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))/cosh(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))/cosh(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*sin(2))
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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(\tanh (a+b x)) \, dx=\int { \sin \left (\tanh \left (b x + a\right )\right )^{2} \,d x } \] Input:

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

int(sin(tanh(a + b*x))**2,x)