3.1.42 \(\int \frac {\sec (x)}{\sqrt {-1+\sec ^4(x)}} \, dx\) [42]

Optimal. Leaf size=28 \[ -\frac {\tanh ^{-1}\left (\frac {\cos (x) \cot (x) \sqrt {-1+\sec ^4(x)}}{\sqrt {2}}\right )}{\sqrt {2}} \]

[Out]

-1/2*arctanh(1/2*cos(x)*cot(x)*(-1+sec(x)^4)^(1/2)*2^(1/2))*2^(1/2)

________________________________________________________________________________________

Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(59\) vs. \(2(28)=56\).
time = 0.12, antiderivative size = 59, normalized size of antiderivative = 2.11, number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {4233, 6854, 2013, 2033, 212} \begin {gather*} -\frac {\sqrt {1-\cos ^4(x)} \sec ^2(x) \tanh ^{-1}\left (\frac {\sqrt {2} \sin (x)}{\sqrt {2 \sin ^2(x)-\sin ^4(x)}}\right )}{\sqrt {2} \sqrt {\sec ^4(x)-1}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[x]/Sqrt[-1 + Sec[x]^4],x]

[Out]

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

Rule 212

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

Rule 2013

Int[(u_)^(p_), x_Symbol] :> Int[ExpandToSum[u, x]^p, x] /; FreeQ[p, x] && TrinomialQ[u, x] &&  !TrinomialMatch
Q[u, x]

Rule 2033

Int[1/Sqrt[(a_.)*(x_)^2 + (b_.)*(x_)^(n_.)], x_Symbol] :> Dist[2/(2 - n), Subst[Int[1/(1 - a*x^2), x], x, x/Sq
rt[a*x^2 + b*x^n]], x] /; FreeQ[{a, b, n}, x] && NeQ[n, 2]

Rule 4233

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fr
eeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + b/(1 - ff^2*x^2)^(n/2))^p/(1 - ff^2*x^2)^((m + 1)/2), x
], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2] &&  !IntegerQ
[p]

Rule 6854

Int[(u_.)*((a_.) + (b_.)*(v_)^(n_))^(p_), x_Symbol] :> Dist[(a + b*v^n)^FracPart[p]/(v^(n*FracPart[p])*(b + a/
v^n)^FracPart[p]), Int[u*v^(n*p)*(b + a/v^n)^p, x], x] /; FreeQ[{a, b, p}, x] &&  !IntegerQ[p] && ILtQ[n, 0] &
& BinomialQ[v, x] &&  !LinearQ[v, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 45, normalized size = 1.61 \begin {gather*} -\frac {\tanh ^{-1}\left (\frac {1}{2} \sqrt {4-2 \sin ^2(x)}\right ) \sqrt {3+\cos (2 x)} \sec (x) \tan (x)}{2 \sqrt {-1+\sec ^4(x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]/Sqrt[-1 + Sec[x]^4],x]

[Out]

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

________________________________________________________________________________________

Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[Sec[x]/Sqrt[Sec[x]^4 - 1],x]')

[Out]

Exception raised: SystemError >> excessive stack use: stack is 3064 deep

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(90\) vs. \(2(23)=46\).
time = 0.15, size = 91, normalized size = 3.25

method result size
default \(-\frac {\sqrt {8}\, \sqrt {2}\, \left (\arcsinh \left (\frac {\cos \left (x \right )-1}{1+\cos \left (x \right )}\right )-\arctanh \left (\frac {\sqrt {2}\, \sqrt {4}}{4 \sqrt {\frac {1+\cos ^{2}\left (x \right )}{\left (1+\cos \left (x \right )\right )^{2}}}}\right )\right ) \left (\sin ^{3}\left (x \right )\right ) \sqrt {\frac {1+\cos ^{2}\left (x \right )}{\left (1+\cos \left (x \right )\right )^{2}}}}{8 \left (\cos \left (x \right )-1\right ) \cos \left (x \right )^{2} \sqrt {-\frac {2 \left (\cos ^{4}\left (x \right )-1\right )}{\cos \left (x \right )^{4}}}}\) \(91\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/8*8^(1/2)*2^(1/2)*(arcsinh((cos(x)-1)/(1+cos(x)))-arctanh(1/4*2^(1/2)*4^(1/2)/((1+cos(x)^2)/(1+cos(x))^2)^(
1/2)))*sin(x)^3*((1+cos(x)^2)/(1+cos(x))^2)^(1/2)/(cos(x)-1)/cos(x)^2/(-2*(cos(x)^4-1)/cos(x)^4)^(1/2)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate(sec(x)/sqrt(sec(x)^4 - 1), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (23) = 46\).
time = 0.37, size = 54, normalized size = 1.93 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (-\frac {2 \, {\left (2 \, \sqrt {2} \sqrt {-\frac {\cos \left (x\right )^{4} - 1}{\cos \left (x\right )^{4}}} \cos \left (x\right )^{2} - {\left (\cos \left (x\right )^{2} + 3\right )} \sin \left (x\right )\right )}}{{\left (\cos \left (x\right )^{2} - 1\right )} \sin \left (x\right )}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec {\left (x \right )}}{\sqrt {\left (\sec {\left (x \right )} - 1\right ) \left (\sec {\left (x \right )} + 1\right ) \left (\sec ^{2}{\left (x \right )} + 1\right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral(sec(x)/sqrt((sec(x) - 1)*(sec(x) + 1)*(sec(x)**2 + 1)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (23) = 46\).
time = 0.04, size = 116, normalized size = 4.14 \begin {gather*} \frac {2 \left (\frac {\ln \left (-\tan ^{2}\left (\frac {x}{2}\right )+\sqrt {\tan ^{4}\left (\frac {x}{2}\right )+1}\right )}{2}+\frac {\ln \left (\tan ^{2}\left (\frac {x}{2}\right )-\sqrt {\tan ^{4}\left (\frac {x}{2}\right )+1}+1\right )}{2}-\frac {\ln \left (-\tan ^{2}\left (\frac {x}{2}\right )+\sqrt {\tan ^{4}\left (\frac {x}{2}\right )+1}+1\right )}{2}\right )}{2 \sqrt {2} \mathrm {sign}\left (\tan ^{5}\left (\frac {x}{2}\right )+2 \tan ^{3}\left (\frac {x}{2}\right )+\tan \left (\frac {x}{2}\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(-1+sec(x)^4)^(1/2),x)

[Out]

1/4*sqrt(2)*(log(tan(1/2*x)^2 - sqrt(tan(1/2*x)^4 + 1) + 1) - log(-tan(1/2*x)^2 + sqrt(tan(1/2*x)^4 + 1) + 1)
+ log(-tan(1/2*x)^2 + sqrt(tan(1/2*x)^4 + 1)))/sgn(tan(1/2*x)^5 + 2*tan(1/2*x)^3 + tan(1/2*x))

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.04 \begin {gather*} \int \frac {1}{\cos \left (x\right )\,\sqrt {\frac {1}{{\cos \left (x\right )}^4}-1}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________