\(\int \frac {\sec (x) \tan (x)}{\sqrt {4+\sec ^2(x)}} \, dx\) [728]

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

Optimal result

Integrand size = 15, antiderivative size = 5 \[ \int \frac {\sec (x) \tan (x)}{\sqrt {4+\sec ^2(x)}} \, dx=\text {csch}^{-1}(2 \cos (x)) \]

[Out]

arccsch(2*cos(x))

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 5, 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.200, Rules used = {4424, 342, 221} \[ \int \frac {\sec (x) \tan (x)}{\sqrt {4+\sec ^2(x)}} \, dx=\text {csch}^{-1}(2 \cos (x)) \]

[In]

Int[(Sec[x]*Tan[x])/Sqrt[4 + Sec[x]^2],x]

[Out]

ArcCsch[2*Cos[x]]

Rule 221

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

Rule 342

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Subst[Int[(a + b/x^n)^p/x^(m + 2), x], x, 1/x] /;
FreeQ[{a, b, p}, x] && ILtQ[n, 0] && IntegerQ[m]

Rule 4424

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))], x_Symbol] :> With[{d = FreeFactors[Cos[c*(a + b*x)], x]}, Dist[-(b*
c)^(-1), Subst[Int[SubstFor[1/x, Cos[c*(a + b*x)]/d, u, x], x], x, Cos[c*(a + b*x)]/d], x] /; FunctionOfQ[Cos[
c*(a + b*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && (EqQ[F, Tan] || EqQ[F, tan])

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{\sqrt {4+\frac {1}{x^2}} x^2} \, dx,x,\cos (x)\right ) \\ & = \text {Subst}\left (\int \frac {1}{\sqrt {4+x^2}} \, dx,x,\sec (x)\right ) \\ & = \text {arcsinh}\left (\frac {\sec (x)}{2}\right ) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(38\) vs. \(2(5)=10\).

Time = 0.03 (sec) , antiderivative size = 38, normalized size of antiderivative = 7.60 \[ \int \frac {\sec (x) \tan (x)}{\sqrt {4+\sec ^2(x)}} \, dx=\frac {\text {arctanh}\left (\sqrt {1+4 \cos ^2(x)}\right ) \sqrt {3+2 \cos (2 x)} \sec (x)}{\sqrt {4+\sec ^2(x)}} \]

[In]

Integrate[(Sec[x]*Tan[x])/Sqrt[4 + Sec[x]^2],x]

[Out]

(ArcTanh[Sqrt[1 + 4*Cos[x]^2]]*Sqrt[3 + 2*Cos[2*x]]*Sec[x])/Sqrt[4 + Sec[x]^2]

Maple [A] (verified)

Time = 0.59 (sec) , antiderivative size = 6, normalized size of antiderivative = 1.20

method result size
derivativedivides \(\operatorname {arcsinh}\left (\frac {\sec \left (x \right )}{2}\right )\) \(6\)
default \(\operatorname {arcsinh}\left (\frac {\sec \left (x \right )}{2}\right )\) \(6\)

[In]

int(sec(x)*tan(x)/(4+sec(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

arcsinh(1/2*sec(x))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 27 vs. \(2 (5) = 10\).

Time = 0.26 (sec) , antiderivative size = 27, normalized size of antiderivative = 5.40 \[ \int \frac {\sec (x) \tan (x)}{\sqrt {4+\sec ^2(x)}} \, dx=\log \left (-\frac {\sqrt {\frac {4 \, \cos \left (x\right )^{2} + 1}{\cos \left (x\right )^{2}}} \cos \left (x\right ) + 1}{\cos \left (x\right )}\right ) \]

[In]

integrate(sec(x)*tan(x)/(4+sec(x)^2)^(1/2),x, algorithm="fricas")

[Out]

log(-(sqrt((4*cos(x)^2 + 1)/cos(x)^2)*cos(x) + 1)/cos(x))

Sympy [A] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 5, normalized size of antiderivative = 1.00 \[ \int \frac {\sec (x) \tan (x)}{\sqrt {4+\sec ^2(x)}} \, dx=\operatorname {asinh}{\left (\frac {\sec {\left (x \right )}}{2} \right )} \]

[In]

integrate(sec(x)*tan(x)/(4+sec(x)**2)**(1/2),x)

[Out]

asinh(sec(x)/2)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 33 vs. \(2 (5) = 10\).

Time = 0.21 (sec) , antiderivative size = 33, normalized size of antiderivative = 6.60 \[ \int \frac {\sec (x) \tan (x)}{\sqrt {4+\sec ^2(x)}} \, dx=\frac {1}{2} \, \log \left (\sqrt {\frac {1}{\cos \left (x\right )^{2}} + 4} \cos \left (x\right ) + 1\right ) - \frac {1}{2} \, \log \left (\sqrt {\frac {1}{\cos \left (x\right )^{2}} + 4} \cos \left (x\right ) - 1\right ) \]

[In]

integrate(sec(x)*tan(x)/(4+sec(x)^2)^(1/2),x, algorithm="maxima")

[Out]

1/2*log(sqrt(1/cos(x)^2 + 4)*cos(x) + 1) - 1/2*log(sqrt(1/cos(x)^2 + 4)*cos(x) - 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 36 vs. \(2 (5) = 10\).

Time = 0.28 (sec) , antiderivative size = 36, normalized size of antiderivative = 7.20 \[ \int \frac {\sec (x) \tan (x)}{\sqrt {4+\sec ^2(x)}} \, dx=\frac {\log \left (\sqrt {4 \, \cos \left (x\right )^{2} + 1} + 1\right ) - \log \left (\sqrt {4 \, \cos \left (x\right )^{2} + 1} - 1\right )}{2 \, \mathrm {sgn}\left (\cos \left (x\right )\right )} \]

[In]

integrate(sec(x)*tan(x)/(4+sec(x)^2)^(1/2),x, algorithm="giac")

[Out]

1/2*(log(sqrt(4*cos(x)^2 + 1) + 1) - log(sqrt(4*cos(x)^2 + 1) - 1))/sgn(cos(x))

Mupad [B] (verification not implemented)

Time = 27.00 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.40 \[ \int \frac {\sec (x) \tan (x)}{\sqrt {4+\sec ^2(x)}} \, dx=\mathrm {asinh}\left (\frac {1}{2\,\cos \left (x\right )}\right ) \]

[In]

int(tan(x)/(cos(x)*(1/cos(x)^2 + 4)^(1/2)),x)

[Out]

asinh(1/(2*cos(x)))