3.3.45 \(\int \cos ^2(\tanh (a+b x)) \, dx\) [245]

Optimal. Leaf size=115 \[ -\frac {\cos (2) \text {CosIntegral}(2-2 \tanh (a+b x))}{4 b}+\frac {\cos (2) \text {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} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.19, antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 5, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.556, Rules used = {6857, 3393, 3384, 3380, 3383} \begin {gather*} -\frac {\cos (2) \text {CosIntegral}(2-2 \tanh (a+b x))}{4 b}+\frac {\cos (2) \text {CosIntegral}(2 \tanh (a+b x)+2)}{4 b}-\frac {\sin (2) \text {Si}(2-2 \tanh (a+b x))}{4 b}+\frac {\sin (2) \text {Si}(2 \tanh (a+b x)+2)}{4 b}-\frac {\log (1-\tanh (a+b x))}{4 b}+\frac {\log (\tanh (a+b x)+1)}{4 b} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-1/4*(Cos[2]*CosIntegral[2 - 2*Tanh[a + b*x]])/b + (Cos[2]*CosIntegral[2 + 2*Tanh[a + b*x]])/(4*b) - Log[1 - T
anh[a + b*x]]/(4*b) + Log[1 + Tanh[a + b*x]]/(4*b) - (Sin[2]*SinIntegral[2 - 2*Tanh[a + b*x]])/(4*b) + (Sin[2]
*SinIntegral[2 + 2*Tanh[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*} \int \cos ^2(\tanh (a+b x)) \, dx &=\frac {\text {Subst}\left (\int \frac {\cos ^2(x)}{1-x^2} \, dx,x,\tanh (a+b x)\right )}{b}\\ &=\frac {\text {Subst}\left (\int \left (-\frac {\cos ^2(x)}{2 (-1+x)}+\frac {\cos ^2(x)}{2 (1+x)}\right ) \, dx,x,\tanh (a+b x)\right )}{b}\\ &=-\frac {\text {Subst}\left (\int \frac {\cos ^2(x)}{-1+x} \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac {\text {Subst}\left (\int \frac {\cos ^2(x)}{1+x} \, dx,x,\tanh (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,\tanh (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,\tanh (a+b x)\right )}{2 b}\\ &=-\frac {\log (1-\tanh (a+b x))}{4 b}+\frac {\log (1+\tanh (a+b x))}{4 b}-\frac {\text {Subst}\left (\int \frac {\cos (2 x)}{-1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}+\frac {\text {Subst}\left (\int \frac {\cos (2 x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}\\ &=-\frac {\log (1-\tanh (a+b x))}{4 b}+\frac {\log (1+\tanh (a+b x))}{4 b}-\frac {\cos (2) \text {Subst}\left (\int \frac {\cos (2-2 x)}{-1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}+\frac {\cos (2) \text {Subst}\left (\int \frac {\cos (2+2 x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}-\frac {\sin (2) \text {Subst}\left (\int \frac {\sin (2-2 x)}{-1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}+\frac {\sin (2) \text {Subst}\left (\int \frac {\sin (2+2 x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{4 b}\\ &=-\frac {\cos (2) \text {Ci}(2-2 \tanh (a+b x))}{4 b}+\frac {\cos (2) \text {Ci}(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}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.13, size = 88, normalized size = 0.77 \begin {gather*} \frac {-\cos (2) \text {CosIntegral}(2-2 \tanh (a+b x))+\cos (2) \text {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} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(-(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]*SinIntegral[2 - 2*Tanh[a + b*x]] + Sin[2]*SinIntegral[2*(1 + Tanh[a + b*x
])])/(4*b)

________________________________________________________________________________________

Maple [A]
time = 1.05, size = 88, normalized size = 0.77

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/b*(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)-1/4*ln(-1+tanh(b*x+a))+1/4*ln(tanh(b*x+a)+1))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(tanh(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)

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 155, normalized size = 1.35 \begin {gather*} \frac {4 \, b x + \cos \left (2\right ) \operatorname {Ci}\left (\frac {4 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) + \cos \left (2\right ) \operatorname {Ci}\left (-\frac {4 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - \cos \left (2\right ) \operatorname {Ci}\left (\frac {4}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - \cos \left (2\right ) \operatorname {Ci}\left (-\frac {4}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) + 2 \, \sin \left (2\right ) \operatorname {Si}\left (\frac {4 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - 2 \, \sin \left (2\right ) \operatorname {Si}\left (\frac {4}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right )}{8 \, b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/8*(4*b*x + cos(2)*cos_integral(4*e^(2*b*x + 2*a)/(e^(2*b*x + 2*a) + 1)) + cos(2)*cos_integral(-4*e^(2*b*x +
2*a)/(e^(2*b*x + 2*a) + 1)) - cos(2)*cos_integral(4/(e^(2*b*x + 2*a) + 1)) - cos(2)*cos_integral(-4/(e^(2*b*x
+ 2*a) + 1)) + 2*sin(2)*sin_integral(4*e^(2*b*x + 2*a)/(e^(2*b*x + 2*a) + 1)) - 2*sin(2)*sin_integral(4/(e^(2*
b*x + 2*a) + 1)))/b

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\cos \left (\mathrm {tanh}\left (a+b\,x\right )\right )}^2 \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________