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.05, antiderivative size = 15, normalized size of antiderivative = 1.00, 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 8

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

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 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.05, size = 18, normalized size = 1.20 \[ \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

________________________________________________________________________________________

fricas [B]  time = 0.54, size = 50, normalized size = 3.33 \[ \frac {2 \, {\left ({\left (\cosh \relax (x)^{2} + 2 \, \cosh \relax (x) \sinh \relax (x) + \sinh \relax (x)^{2} + 1\right )} \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right ) + 1\right )}}{a \cosh \relax (x)^{2} + 2 \, a \cosh \relax (x) \sinh \relax (x) + a \sinh \relax (x)^{2} + a} \]

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)

________________________________________________________________________________________

giac [A]  time = 0.14, size = 22, normalized size = 1.47 \[ \frac {2 \, \arctan \left (e^{x}\right )}{a} + \frac {2}{a {\left (e^{\left (2 \, x\right )} + 1\right )}} \]

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))

________________________________________________________________________________________

maple [A]  time = 0.08, size = 31, normalized size = 2.07 \[ -\frac {2 \tanh \left (\frac {x}{2}\right )}{a \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}+\frac {2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a} \]

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 = 0.43, size = 23, normalized size = 1.53 \[ -\frac {2 \, \arctan \left (e^{\left (-x\right )}\right )}{a} - \frac {2}{a e^{\left (-2 \, x\right )} + a} \]

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)

________________________________________________________________________________________

mupad [B]  time = 0.92, size = 33, normalized size = 2.20 \[ \frac {2}{a\,\left ({\mathrm {e}}^{2\,x}+1\right )}+\frac {2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^x\,\sqrt {a^2}}{a}\right )}{\sqrt {a^2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/(a*(exp(2*x) + 1)) + (2*atan((exp(x)*(a^2)^(1/2))/a))/(a^2)^(1/2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\tanh ^{2}{\relax (x )}}{\cosh {\relax (x )} + 1}\, dx}{a} \]

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

________________________________________________________________________________________