\(\int \sqrt {a \text {sech}^2(x)} \, dx\) [34]

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

Optimal result

Integrand size = 10, antiderivative size = 25 \[ \int \sqrt {a \text {sech}^2(x)} \, dx=\sqrt {a} \arctan \left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a \text {sech}^2(x)}}\right ) \]

[Out]

arctan(a^(1/2)*tanh(x)/(a*sech(x)^2)^(1/2))*a^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {4207, 223, 209} \[ \int \sqrt {a \text {sech}^2(x)} \, dx=\sqrt {a} \arctan \left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a \text {sech}^2(x)}}\right ) \]

[In]

Int[Sqrt[a*Sech[x]^2],x]

[Out]

Sqrt[a]*ArcTan[(Sqrt[a]*Tanh[x])/Sqrt[a*Sech[x]^2]]

Rule 209

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

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 4207

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

Rubi steps \begin{align*} \text {integral}& = a \text {Subst}\left (\int \frac {1}{\sqrt {a-a x^2}} \, dx,x,\tanh (x)\right ) \\ & = a \text {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,\frac {\tanh (x)}{\sqrt {a \text {sech}^2(x)}}\right ) \\ & = \sqrt {a} \arctan \left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a \text {sech}^2(x)}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.64 \[ \int \sqrt {a \text {sech}^2(x)} \, dx=\arctan (\sinh (x)) \cosh (x) \sqrt {a \text {sech}^2(x)} \]

[In]

Integrate[Sqrt[a*Sech[x]^2],x]

[Out]

ArcTan[Sinh[x]]*Cosh[x]*Sqrt[a*Sech[x]^2]

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.18 (sec) , antiderivative size = 72, normalized size of antiderivative = 2.88

method result size
risch \(i \sqrt {\frac {{\mathrm e}^{2 x} a}{\left (1+{\mathrm e}^{2 x}\right )^{2}}}\, {\mathrm e}^{-x} \left (1+{\mathrm e}^{2 x}\right ) \ln \left ({\mathrm e}^{x}+i\right )-i \sqrt {\frac {{\mathrm e}^{2 x} a}{\left (1+{\mathrm e}^{2 x}\right )^{2}}}\, {\mathrm e}^{-x} \left (1+{\mathrm e}^{2 x}\right ) \ln \left ({\mathrm e}^{x}-i\right )\) \(72\)

[In]

int((sech(x)^2*a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

I*(exp(2*x)*a/(1+exp(2*x))^2)^(1/2)*exp(-x)*(1+exp(2*x))*ln(exp(x)+I)-I*(exp(2*x)*a/(1+exp(2*x))^2)^(1/2)*exp(
-x)*(1+exp(2*x))*ln(exp(x)-I)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 145, normalized size of antiderivative = 5.80 \[ \int \sqrt {a \text {sech}^2(x)} \, dx=\left [\sqrt {-a} \log \left (\frac {2 \, a \cosh \left (x\right ) e^{x} \sinh \left (x\right ) + a e^{x} \sinh \left (x\right )^{2} + 2 \, {\left (\cosh \left (x\right ) e^{\left (2 \, x\right )} + {\left (e^{\left (2 \, x\right )} + 1\right )} \sinh \left (x\right ) + \cosh \left (x\right )\right )} \sqrt {-a} \sqrt {\frac {a}{e^{\left (4 \, x\right )} + 2 \, e^{\left (2 \, x\right )} + 1}} e^{x} + {\left (a \cosh \left (x\right )^{2} - a\right )} e^{x}}{2 \, \cosh \left (x\right ) e^{x} \sinh \left (x\right ) + e^{x} \sinh \left (x\right )^{2} + {\left (\cosh \left (x\right )^{2} + 1\right )} e^{x}}\right ), 2 \, \sqrt {\frac {a}{e^{\left (4 \, x\right )} + 2 \, e^{\left (2 \, x\right )} + 1}} {\left (e^{\left (2 \, x\right )} + 1\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )\right ] \]

[In]

integrate((a*sech(x)^2)^(1/2),x, algorithm="fricas")

[Out]

[sqrt(-a)*log((2*a*cosh(x)*e^x*sinh(x) + a*e^x*sinh(x)^2 + 2*(cosh(x)*e^(2*x) + (e^(2*x) + 1)*sinh(x) + cosh(x
))*sqrt(-a)*sqrt(a/(e^(4*x) + 2*e^(2*x) + 1))*e^x + (a*cosh(x)^2 - a)*e^x)/(2*cosh(x)*e^x*sinh(x) + e^x*sinh(x
)^2 + (cosh(x)^2 + 1)*e^x)), 2*sqrt(a/(e^(4*x) + 2*e^(2*x) + 1))*(e^(2*x) + 1)*arctan(cosh(x) + sinh(x))]

Sympy [F]

\[ \int \sqrt {a \text {sech}^2(x)} \, dx=\int \sqrt {a \operatorname {sech}^{2}{\left (x \right )}}\, dx \]

[In]

integrate((a*sech(x)**2)**(1/2),x)

[Out]

Integral(sqrt(a*sech(x)**2), x)

Maxima [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.32 \[ \int \sqrt {a \text {sech}^2(x)} \, dx=2 \, \sqrt {a} \arctan \left (e^{x}\right ) \]

[In]

integrate((a*sech(x)^2)^(1/2),x, algorithm="maxima")

[Out]

2*sqrt(a)*arctan(e^x)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.32 \[ \int \sqrt {a \text {sech}^2(x)} \, dx=2 \, \sqrt {a} \arctan \left (e^{x}\right ) \]

[In]

integrate((a*sech(x)^2)^(1/2),x, algorithm="giac")

[Out]

2*sqrt(a)*arctan(e^x)

Mupad [F(-1)]

Timed out. \[ \int \sqrt {a \text {sech}^2(x)} \, dx=\int \sqrt {\frac {a}{{\mathrm {cosh}\left (x\right )}^2}} \,d x \]

[In]

int((a/cosh(x)^2)^(1/2),x)

[Out]

int((a/cosh(x)^2)^(1/2), x)