3.1.83 \(\int \sec ^{-1}(x) \, dx\) [83]

Optimal. Leaf size=19 \[ x \sec ^{-1}(x)-\tanh ^{-1}\left (\sqrt {1-\frac {1}{x^2}}\right ) \]

[Out]

x*arcsec(x)-arctanh((1-1/x^2)^(1/2))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 2.000, Rules used = {5322, 272, 65, 212} \begin {gather*} x \sec ^{-1}(x)-\tanh ^{-1}\left (\sqrt {1-\frac {1}{x^2}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[ArcSec[x],x]

[Out]

x*ArcSec[x] - ArcTanh[Sqrt[1 - x^(-2)]]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

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 272

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

Rule 5322

Int[ArcSec[(c_.)*(x_)], x_Symbol] :> Simp[x*ArcSec[c*x], x] - Dist[1/c, Int[1/(x*Sqrt[1 - 1/(c^2*x^2)]), x], x
] /; FreeQ[c, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(64\) vs. \(2(19)=38\).
time = 0.05, size = 64, normalized size = 3.37 \begin {gather*} x \sec ^{-1}(x)-\frac {\sqrt {-1+x^2} \left (-\log \left (1-\frac {x}{\sqrt {-1+x^2}}\right )+\log \left (1+\frac {x}{\sqrt {-1+x^2}}\right )\right )}{2 \sqrt {1-\frac {1}{x^2}} x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[ArcSec[x],x]

[Out]

x*ArcSec[x] - (Sqrt[-1 + x^2]*(-Log[1 - x/Sqrt[-1 + x^2]] + Log[1 + x/Sqrt[-1 + x^2]]))/(2*Sqrt[1 - x^(-2)]*x)

________________________________________________________________________________________

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

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[ArcSec[x],x]')

[Out]

cought exception:

________________________________________________________________________________________

Maple [A]
time = 0.01, size = 22, normalized size = 1.16

method result size
lookup \(x \,\mathrm {arcsec}\left (x \right )-\ln \left (x +x \sqrt {1-\frac {1}{x^{2}}}\right )\) \(22\)
default \(x \,\mathrm {arcsec}\left (x \right )-\ln \left (x +x \sqrt {1-\frac {1}{x^{2}}}\right )\) \(22\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(arcsec(x),x,method=_RETURNVERBOSE)

[Out]

x*arcsec(x)-ln(x+x*(1-1/x^2)^(1/2))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 35 vs. \(2 (17) = 34\).
time = 0.25, size = 35, normalized size = 1.84 \begin {gather*} x \operatorname {arcsec}\left (x\right ) - \frac {1}{2} \, \log \left (\sqrt {-\frac {1}{x^{2}} + 1} + 1\right ) + \frac {1}{2} \, \log \left (-\sqrt {-\frac {1}{x^{2}} + 1} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arcsec(x),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 33, normalized size = 1.74 \begin {gather*} {\left (x - 2\right )} \operatorname {arcsec}\left (x\right ) + 4 \, \arctan \left (-x + \sqrt {x^{2} - 1}\right ) + \log \left (-x + \sqrt {x^{2} - 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arcsec(x),x, algorithm="fricas")

[Out]

(x - 2)*arcsec(x) + 4*arctan(-x + sqrt(x^2 - 1)) + log(-x + sqrt(x^2 - 1))

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 1.16, size = 17, normalized size = 0.89 \begin {gather*} x \operatorname {asec}{\left (x \right )} - \begin {cases} \operatorname {acosh}{\left (x \right )} & \text {for}\: \left |{x^{2}}\right | > 1 \\- i \operatorname {asin}{\left (x \right )} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(asec(x),x)

[Out]

x*asec(x) - Piecewise((acosh(x), Abs(x**2) > 1), (-I*asin(x), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 37 vs. \(2 (17) = 34\).
time = 0.00, size = 42, normalized size = 2.21 \begin {gather*} \frac {\ln \left (-\sqrt {-\left (\frac 1{x}\right )^{2}+1}+1\right )}{2}-\frac {\ln \left (\sqrt {-\left (\frac 1{x}\right )^{2}+1}+1\right )}{2}+x \arccos \left (\frac 1{x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arcsec(x),x)

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.61, size = 21, normalized size = 1.11 \begin {gather*} x\,\mathrm {acos}\left (\frac {1}{x}\right )-\ln \left (x+\sqrt {x^2-1}\right )\,\mathrm {sign}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(acos(1/x),x)

[Out]

x*acos(1/x) - log(x + (x^2 - 1)^(1/2))*sign(x)

________________________________________________________________________________________