3.246 \(\int \cos (\tanh (a+b x)) \, dx\)

Optimal. Leaf size=77 \[ -\frac {\cos (1) \text {Ci}(1-\tanh (a+b x))}{2 b}+\frac {\cos (1) \text {Ci}(\tanh (a+b x)+1)}{2 b}-\frac {\sin (1) \text {Si}(1-\tanh (a+b x))}{2 b}+\frac {\sin (1) \text {Si}(\tanh (a+b x)+1)}{2 b} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.14, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 4, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {3334, 3303, 3299, 3302} \[ -\frac {\cos (1) \text {CosIntegral}(1-\tanh (a+b x))}{2 b}+\frac {\cos (1) \text {CosIntegral}(\tanh (a+b x)+1)}{2 b}-\frac {\sin (1) \text {Si}(1-\tanh (a+b x))}{2 b}+\frac {\sin (1) \text {Si}(\tanh (a+b x)+1)}{2 b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-(Cos[1]*CosIntegral[1 - Tanh[a + b*x]])/(2*b) + (Cos[1]*CosIntegral[1 + Tanh[a + b*x]])/(2*b) - (Sin[1]*SinIn
tegral[1 - Tanh[a + b*x]])/(2*b) + (Sin[1]*SinIntegral[1 + Tanh[a + b*x]])/(2*b)

Rule 3299

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 3302

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 3303

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 3334

Int[Cos[(c_.) + (d_.)*(x_)]*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[ExpandIntegrand[Cos[c + d*x], (a +
 b*x^n)^p, x], x] /; FreeQ[{a, b, c, d}, x] && ILtQ[p, 0] && IGtQ[n, 0] && (EqQ[n, 2] || EqQ[p, -1])

Rubi steps

\begin {align*} \int \cos (\tanh (a+b x)) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\cos (x)}{1-x^2} \, dx,x,\tanh (a+b x)\right )}{b}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {\cos (x)}{2 (1-x)}+\frac {\cos (x)}{2 (1+x)}\right ) \, dx,x,\tanh (a+b x)\right )}{b}\\ &=\frac {\operatorname {Subst}\left (\int \frac {\cos (x)}{1-x} \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac {\operatorname {Subst}\left (\int \frac {\cos (x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{2 b}\\ &=\frac {\cos (1) \operatorname {Subst}\left (\int \frac {\cos (1-x)}{1-x} \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac {\cos (1) \operatorname {Subst}\left (\int \frac {\cos (1+x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac {\sin (1) \operatorname {Subst}\left (\int \frac {\sin (1-x)}{1-x} \, dx,x,\tanh (a+b x)\right )}{2 b}+\frac {\sin (1) \operatorname {Subst}\left (\int \frac {\sin (1+x)}{1+x} \, dx,x,\tanh (a+b x)\right )}{2 b}\\ &=-\frac {\cos (1) \text {Ci}(1-\tanh (a+b x))}{2 b}+\frac {\cos (1) \text {Ci}(1+\tanh (a+b x))}{2 b}-\frac {\sin (1) \text {Si}(1-\tanh (a+b x))}{2 b}+\frac {\sin (1) \text {Si}(1+\tanh (a+b x))}{2 b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.11, size = 62, normalized size = 0.81 \[ \frac {-\cos (1) \text {Ci}(1-\tanh (a+b x))+\cos (1) \text {Ci}(\tanh (a+b x)+1)-\sin (1) \text {Si}(1-\tanh (a+b x))+\sin (1) \text {Si}(\tanh (a+b x)+1)}{2 b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [B]  time = 0.52, size = 151, normalized size = 1.96 \[ \frac {\cos \relax (1) \operatorname {Ci}\left (\frac {2 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) + \cos \relax (1) \operatorname {Ci}\left (-\frac {2 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - \cos \relax (1) \operatorname {Ci}\left (\frac {2}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - \cos \relax (1) \operatorname {Ci}\left (-\frac {2}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) + 2 \, \sin \relax (1) \operatorname {Si}\left (\frac {2 \, e^{\left (2 \, b x + 2 \, a\right )}}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - 2 \, \sin \relax (1) \operatorname {Si}\left (\frac {2}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right )}{4 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos \left (\tanh \left (b x + a\right )\right )\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.10, size = 58, normalized size = 0.75 \[ \frac {\frac {\Si \left (1+\tanh \left (b x +a \right )\right ) \sin \relax (1)}{2}+\frac {\Ci \left (1+\tanh \left (b x +a \right )\right ) \cos \relax (1)}{2}+\frac {\Si \left (-1+\tanh \left (b x +a \right )\right ) \sin \relax (1)}{2}-\frac {\Ci \left (-1+\tanh \left (b x +a \right )\right ) \cos \relax (1)}{2}}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos \left (\tanh \left (b x + a\right )\right )\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(tanh(b*x+a)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \cos \left (\mathrm {tanh}\left (a+b\,x\right )\right ) \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos {\left (\tanh {\left (a + b x \right )} \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________