3.191 \(\int \frac{\tanh ^2(x)}{a+a \cosh (x)} \, dx\)

Optimal. Leaf size=15 \[ \frac{\tan ^{-1}(\sinh (x))}{a}-\frac{\tanh (x)}{a} \]

[Out]

ArcTan[Sinh[x]]/a - Tanh[x]/a

________________________________________________________________________________________

Rubi [A]  time = 0.0488648, antiderivative size = 15, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.308, Rules used = {2706, 3767, 8, 3770} \[ \frac{\tan ^{-1}(\sinh (x))}{a}-\frac{\tanh (x)}{a} \]

Antiderivative was successfully verified.

[In]

Int[Tanh[x]^2/(a + a*Cosh[x]),x]

[Out]

ArcTan[Sinh[x]]/a - Tanh[x]/a

Rule 2706

Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/a, Int[S
ec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x] - Dist[1/(b*g), Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /;
FreeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\tanh ^2(x)}{a+a \cosh (x)} \, dx &=\frac{\int \text{sech}(x) \, dx}{a}-\frac{\int \text{sech}^2(x) \, dx}{a}\\ &=\frac{\tan ^{-1}(\sinh (x))}{a}-\frac{i \operatorname{Subst}(\int 1 \, dx,x,-i \tanh (x))}{a}\\ &=\frac{\tan ^{-1}(\sinh (x))}{a}-\frac{\tanh (x)}{a}\\ \end{align*}

Mathematica [A]  time = 0.045499, size = 18, normalized size = 1.2 \[ \frac{2 \tan ^{-1}\left (\tanh \left (\frac{x}{2}\right )\right )-\tanh (x)}{a} \]

Antiderivative was successfully verified.

[In]

Integrate[Tanh[x]^2/(a + a*Cosh[x]),x]

[Out]

(2*ArcTan[Tanh[x/2]] - Tanh[x])/a

________________________________________________________________________________________

Maple [A]  time = 0.02, size = 31, normalized size = 2.1 \begin{align*} -2\,{\frac{\tanh \left ( x/2 \right ) }{a \left ( \left ( \tanh \left ( x/2 \right ) \right ) ^{2}+1 \right ) }}+2\,{\frac{\arctan \left ( \tanh \left ( x/2 \right ) \right ) }{a}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2/a*tanh(1/2*x)/(tanh(1/2*x)^2+1)+2/a*arctan(tanh(1/2*x))

________________________________________________________________________________________

Maxima [A]  time = 1.54332, size = 31, normalized size = 2.07 \begin{align*} -\frac{2 \, \arctan \left (e^{\left (-x\right )}\right )}{a} - \frac{2}{a e^{\left (-2 \, x\right )} + a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*arctan(e^(-x))/a - 2/(a*e^(-2*x) + a)

________________________________________________________________________________________

Fricas [B]  time = 1.92385, size = 185, normalized size = 12.33 \begin{align*} \frac{2 \,{\left ({\left (\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} + 1\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + 1\right )}}{a \cosh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) \sinh \left (x\right ) + a \sinh \left (x\right )^{2} + a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*((cosh(x)^2 + 2*cosh(x)*sinh(x) + sinh(x)^2 + 1)*arctan(cosh(x) + sinh(x)) + 1)/(a*cosh(x)^2 + 2*a*cosh(x)*s
inh(x) + a*sinh(x)^2 + a)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\tanh ^{2}{\left (x \right )}}{\cosh{\left (x \right )} + 1}\, dx}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.16883, size = 30, normalized size = 2. \begin{align*} \frac{2 \, \arctan \left (e^{x}\right )}{a} + \frac{2}{a{\left (e^{\left (2 \, x\right )} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*arctan(e^x)/a + 2/(a*(e^(2*x) + 1))