3.586 \(\int \frac{1}{a^2+b^2 \cosh ^2(x)} \, dx\)

Optimal. Leaf size=31 \[ \frac{\tanh ^{-1}\left (\frac{a \tanh (x)}{\sqrt{a^2+b^2}}\right )}{a \sqrt{a^2+b^2}} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0353816, antiderivative size = 31, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3181, 208} \[ \frac{\tanh ^{-1}\left (\frac{a \tanh (x)}{\sqrt{a^2+b^2}}\right )}{a \sqrt{a^2+b^2}} \]

Antiderivative was successfully verified.

[In]

Int[(a^2 + b^2*Cosh[x]^2)^(-1),x]

[Out]

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

Rule 3181

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[1/(a + (a + b)*ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]

Rule 208

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

Rubi steps

\begin{align*} \int \frac{1}{a^2+b^2 \cosh ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{a^2-\left (a^2+b^2\right ) x^2} \, dx,x,\coth (x)\right )\\ &=\frac{\tanh ^{-1}\left (\frac{a \tanh (x)}{\sqrt{a^2+b^2}}\right )}{a \sqrt{a^2+b^2}}\\ \end{align*}

Mathematica [A]  time = 0.0638357, size = 31, normalized size = 1. \[ \frac{\tanh ^{-1}\left (\frac{a \tanh (x)}{\sqrt{a^2+b^2}}\right )}{a \sqrt{a^2+b^2}} \]

Antiderivative was successfully verified.

[In]

Integrate[(a^2 + b^2*Cosh[x]^2)^(-1),x]

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.047, size = 98, normalized size = 3.2 \begin{align*}{\frac{1}{2\,a}\ln \left ( \sqrt{{a}^{2}+{b}^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+2\,a\tanh \left ( x/2 \right ) +\sqrt{{a}^{2}+{b}^{2}} \right ){\frac{1}{\sqrt{{a}^{2}+{b}^{2}}}}}-{\frac{1}{2\,a}\ln \left ( \sqrt{{a}^{2}+{b}^{2}} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}-2\,a\tanh \left ( x/2 \right ) +\sqrt{{a}^{2}+{b}^{2}} \right ){\frac{1}{\sqrt{{a}^{2}+{b}^{2}}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.14807, size = 743, normalized size = 23.97 \begin{align*} \frac{\sqrt{a^{2} + b^{2}} \log \left (\frac{b^{4} \cosh \left (x\right )^{4} + 4 \, b^{4} \cosh \left (x\right ) \sinh \left (x\right )^{3} + b^{4} \sinh \left (x\right )^{4} + 8 \, a^{4} + 8 \, a^{2} b^{2} + b^{4} + 2 \,{\left (2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2} + 2 \,{\left (3 \, b^{4} \cosh \left (x\right )^{2} + 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )^{2} + 4 \,{\left (b^{4} \cosh \left (x\right )^{3} +{\left (2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) - 4 \,{\left (a b^{2} \cosh \left (x\right )^{2} + 2 \, a b^{2} \cosh \left (x\right ) \sinh \left (x\right ) + a b^{2} \sinh \left (x\right )^{2} + 2 \, a^{3} + a b^{2}\right )} \sqrt{a^{2} + b^{2}}}{b^{2} \cosh \left (x\right )^{4} + 4 \, b^{2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + b^{2} \sinh \left (x\right )^{4} + 2 \,{\left (2 \, a^{2} + b^{2}\right )} \cosh \left (x\right )^{2} + 2 \,{\left (3 \, b^{2} \cosh \left (x\right )^{2} + 2 \, a^{2} + b^{2}\right )} \sinh \left (x\right )^{2} + b^{2} + 4 \,{\left (b^{2} \cosh \left (x\right )^{3} +{\left (2 \, a^{2} + b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}\right )}{2 \,{\left (a^{3} + a b^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*sqrt(a^2 + b^2)*log((b^4*cosh(x)^4 + 4*b^4*cosh(x)*sinh(x)^3 + b^4*sinh(x)^4 + 8*a^4 + 8*a^2*b^2 + b^4 + 2
*(2*a^2*b^2 + b^4)*cosh(x)^2 + 2*(3*b^4*cosh(x)^2 + 2*a^2*b^2 + b^4)*sinh(x)^2 + 4*(b^4*cosh(x)^3 + (2*a^2*b^2
 + b^4)*cosh(x))*sinh(x) - 4*(a*b^2*cosh(x)^2 + 2*a*b^2*cosh(x)*sinh(x) + a*b^2*sinh(x)^2 + 2*a^3 + a*b^2)*sqr
t(a^2 + b^2))/(b^2*cosh(x)^4 + 4*b^2*cosh(x)*sinh(x)^3 + b^2*sinh(x)^4 + 2*(2*a^2 + b^2)*cosh(x)^2 + 2*(3*b^2*
cosh(x)^2 + 2*a^2 + b^2)*sinh(x)^2 + b^2 + 4*(b^2*cosh(x)^3 + (2*a^2 + b^2)*cosh(x))*sinh(x)))/(a^3 + a*b^2)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.10479, size = 107, normalized size = 3.45 \begin{align*} \frac{\log \left (\frac{b^{2} e^{\left (2 \, x\right )} + 2 \, a^{2} + b^{2} - 2 \, \sqrt{a^{2} + b^{2}}{\left | a \right |}}{b^{2} e^{\left (2 \, x\right )} + 2 \, a^{2} + b^{2} + 2 \, \sqrt{a^{2} + b^{2}}{\left | a \right |}}\right )}{2 \, \sqrt{a^{2} + b^{2}}{\left | a \right |}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*log((b^2*e^(2*x) + 2*a^2 + b^2 - 2*sqrt(a^2 + b^2)*abs(a))/(b^2*e^(2*x) + 2*a^2 + b^2 + 2*sqrt(a^2 + b^2)*
abs(a)))/(sqrt(a^2 + b^2)*abs(a))