\(\int \frac {\tanh (x)}{\sqrt {a+b \cosh ^2(x)}} \, dx\) [35]

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

Optimal result

Integrand size = 15, antiderivative size = 26 \[ \int \frac {\tanh (x)}{\sqrt {a+b \cosh ^2(x)}} \, dx=-\frac {\text {arctanh}\left (\frac {\sqrt {a+b \cosh ^2(x)}}{\sqrt {a}}\right )}{\sqrt {a}} \] Output:

-arctanh((a+b*cosh(x)^2)^(1/2)/a^(1/2))/a^(1/2)
                                                                                    
                                                                                    
 

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00 \[ \int \frac {\tanh (x)}{\sqrt {a+b \cosh ^2(x)}} \, dx=-\frac {\text {arctanh}\left (\frac {\sqrt {a+b \cosh ^2(x)}}{\sqrt {a}}\right )}{\sqrt {a}} \] Input:

Integrate[Tanh[x]/Sqrt[a + b*Cosh[x]^2],x]
 

Output:

-(ArcTanh[Sqrt[a + b*Cosh[x]^2]/Sqrt[a]]/Sqrt[a])
 

Rubi [A] (verified)

Time = 0.26 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 26, 3673, 73, 221}

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 \frac {\tanh (x)}{\sqrt {a+b \cosh ^2(x)}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {i}{\tan \left (\frac {\pi }{2}+i x\right ) \sqrt {a+b \sin \left (\frac {\pi }{2}+i x\right )^2}}dx\)

\(\Big \downarrow \) 26

\(\displaystyle i \int \frac {1}{\sqrt {b \sin \left (i x+\frac {\pi }{2}\right )^2+a} \tan \left (i x+\frac {\pi }{2}\right )}dx\)

\(\Big \downarrow \) 3673

\(\displaystyle \frac {1}{2} \int \frac {\text {sech}^2(x)}{\sqrt {b \cosh ^2(x)+a}}d\cosh ^2(x)\)

\(\Big \downarrow \) 73

\(\displaystyle \frac {\int \frac {1}{\frac {\cosh ^4(x)}{b}-\frac {a}{b}}d\sqrt {b \cosh ^2(x)+a}}{b}\)

\(\Big \downarrow \) 221

\(\displaystyle -\frac {\text {arctanh}\left (\frac {\sqrt {a+b \cosh ^2(x)}}{\sqrt {a}}\right )}{\sqrt {a}}\)

Input:

Int[Tanh[x]/Sqrt[a + b*Cosh[x]^2],x]
 

Output:

-(ArcTanh[Sqrt[a + b*Cosh[x]^2]/Sqrt[a]]/Sqrt[a])
 

Defintions of rubi rules used

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

rule 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3673
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.)*tan[(e_.) + (f_.)*(x_)]^ 
(m_.), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x]^2, x]}, Simp[ff^((m 
 + 1)/2)/(2*f)   Subst[Int[x^((m - 1)/2)*((a + b*ff*x)^p/(1 - ff*x)^((m + 1 
)/2)), x], x, Sin[e + f*x]^2/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && Integ 
erQ[(m - 1)/2]
 
Maple [A] (verified)

Time = 0.42 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.19

method result size
default \(-\frac {\ln \left (\frac {2 a +2 \sqrt {a}\, \sqrt {a +b \cosh \left (x \right )^{2}}}{\cosh \left (x \right )}\right )}{\sqrt {a}}\) \(31\)

Input:

int(tanh(x)/(a+b*cosh(x)^2)^(1/2),x,method=_RETURNVERBOSE)
 

Output:

-1/a^(1/2)*ln((2*a+2*a^(1/2)*(a+b*cosh(x)^2)^(1/2))/cosh(x))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 135 vs. \(2 (20) = 40\).

Time = 0.14 (sec) , antiderivative size = 315, normalized size of antiderivative = 12.12 \[ \int \frac {\tanh (x)}{\sqrt {a+b \cosh ^2(x)}} \, dx=\left [\frac {\log \left (\frac {b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, {\left (4 \, a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} + 4 \, a + b\right )} \sinh \left (x\right )^{2} - 4 \, \sqrt {2} \sqrt {a} \sqrt {\frac {b \cosh \left (x\right )^{2} + b \sinh \left (x\right )^{2} + 2 \, a + b}{\cosh \left (x\right )^{2} - 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2}}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )} + 4 \, {\left (b \cosh \left (x\right )^{3} + {\left (4 \, a + b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}{\cosh \left (x\right )^{4} + 4 \, \cosh \left (x\right ) \sinh \left (x\right )^{3} + \sinh \left (x\right )^{4} + 2 \, {\left (3 \, \cosh \left (x\right )^{2} + 1\right )} \sinh \left (x\right )^{2} + 2 \, \cosh \left (x\right )^{2} + 4 \, {\left (\cosh \left (x\right )^{3} + \cosh \left (x\right )\right )} \sinh \left (x\right ) + 1}\right )}{2 \, \sqrt {a}}, \frac {\sqrt {-a} \arctan \left (\frac {2 \, \sqrt {2} \sqrt {-a} \sqrt {\frac {b \cosh \left (x\right )^{2} + b \sinh \left (x\right )^{2} + 2 \, a + b}{\cosh \left (x\right )^{2} - 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2}}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}}{b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, {\left (2 \, a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} + 2 \, a + b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} + {\left (2 \, a + b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}\right )}{a}\right ] \] Input:

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

Output:

[1/2*log((b*cosh(x)^4 + 4*b*cosh(x)*sinh(x)^3 + b*sinh(x)^4 + 2*(4*a + b)* 
cosh(x)^2 + 2*(3*b*cosh(x)^2 + 4*a + b)*sinh(x)^2 - 4*sqrt(2)*sqrt(a)*sqrt 
((b*cosh(x)^2 + b*sinh(x)^2 + 2*a + b)/(cosh(x)^2 - 2*cosh(x)*sinh(x) + si 
nh(x)^2))*(cosh(x) + sinh(x)) + 4*(b*cosh(x)^3 + (4*a + b)*cosh(x))*sinh(x 
) + b)/(cosh(x)^4 + 4*cosh(x)*sinh(x)^3 + sinh(x)^4 + 2*(3*cosh(x)^2 + 1)* 
sinh(x)^2 + 2*cosh(x)^2 + 4*(cosh(x)^3 + cosh(x))*sinh(x) + 1))/sqrt(a), s 
qrt(-a)*arctan(2*sqrt(2)*sqrt(-a)*sqrt((b*cosh(x)^2 + b*sinh(x)^2 + 2*a + 
b)/(cosh(x)^2 - 2*cosh(x)*sinh(x) + sinh(x)^2))*(cosh(x) + sinh(x))/(b*cos 
h(x)^4 + 4*b*cosh(x)*sinh(x)^3 + b*sinh(x)^4 + 2*(2*a + b)*cosh(x)^2 + 2*( 
3*b*cosh(x)^2 + 2*a + b)*sinh(x)^2 + 4*(b*cosh(x)^3 + (2*a + b)*cosh(x))*s 
inh(x) + b))/a]
                                                                                    
                                                                                    
 

Sympy [F]

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

integrate(tanh(x)/(a+b*cosh(x)**2)**(1/2),x)
 

Output:

Integral(tanh(x)/sqrt(a + b*cosh(x)**2), x)
 

Maxima [F]

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

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

Output:

integrate(tanh(x)/sqrt(b*cosh(x)^2 + a), x)
 

Giac [F]

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

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

Output:

integrate(tanh(x)/sqrt(b*cosh(x)^2 + a), x)
 

Mupad [F(-1)]

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

int(tanh(x)/(a + b*cosh(x)^2)^(1/2),x)
 

Output:

int(tanh(x)/(a + b*cosh(x)^2)^(1/2), x)
 

Reduce [F]

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

int(tanh(x)/(a+b*cosh(x)^2)^(1/2),x)
 

Output:

int((sqrt(cosh(x)**2*b + a)*tanh(x))/(cosh(x)**2*b + a),x)