\(\int \cos (\tanh (a+b x)) \, dx\) [257]

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 = 7, antiderivative size = 77 \[ \int \cos (\tanh (a+b x)) \, dx=-\frac {\cos (1) \operatorname {CosIntegral}(1-\tanh (a+b x))}{2 b}+\frac {\cos (1) \operatorname {CosIntegral}(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} \] Output:

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

Mathematica [A] (verified)

Time = 0.13 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.81 \[ \int \cos (\tanh (a+b x)) \, dx=\frac {-\cos (1) \operatorname {CosIntegral}(1-\tanh (a+b x))+\cos (1) \operatorname {CosIntegral}(1+\tanh (a+b x))-\sin (1) \text {Si}(1-\tanh (a+b x))+\sin (1) \text {Si}(1+\tanh (a+b x))}{2 b} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.59 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.90, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {4853, 3815, 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 \cos (\tanh (a+b x)) \, dx\)

\(\Big \downarrow \) 4853

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

\(\Big \downarrow \) 3815

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 3815
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])
 

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 
]]
 
Maple [A] (verified)

Time = 0.57 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.75

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

Input:

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

Output:

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+t 
anh(b*x+a))*sin(1)-1/2*Ci(-1+tanh(b*x+a))*cos(1))
 

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.10 (sec) , antiderivative size = 216, normalized size of antiderivative = 2.81 \[ \int \cos (\tanh (a+b x)) \, dx=\frac {{\left (\cos \left (1\right )^{2} + 2 i \, \cos \left (1\right ) \sin \left (1\right ) - \sin \left (1\right )^{2} + 1\right )} \operatorname {Ci}\left (\frac {\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )}{\cosh \left (b x + a\right )}\right ) - {\left (\cos \left (1\right )^{2} + 2 i \, \cos \left (1\right ) \sin \left (1\right ) - \sin \left (1\right )^{2} + 1\right )} \operatorname {Ci}\left (\frac {2}{\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 (1\right )^{2} + 2 \, \cos \left (1\right ) \sin \left (1\right ) + i \, \sin \left (1\right )^{2} + i\right )} \operatorname {Si}\left (\frac {\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )}{\cosh \left (b x + a\right )}\right ) + {\left (i \, \cos \left (1\right )^{2} - 2 \, \cos \left (1\right ) \sin \left (1\right ) - i \, \sin \left (1\right )^{2} - i\right )} \operatorname {Si}\left (\frac {2}{\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 )}{4 \, {\left (b \cos \left (1\right ) + i \, b \sin \left (1\right )\right )}} \] Input:

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \cos (\tanh (a+b x)) \, dx=\int \cos \left (\tanh \left (b x +a \right )\right )d x \] Input:

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

Output:

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