\(\int \frac {\sec ^{-1}(\frac {a}{x})}{x^2} \, dx\) [14]

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

Optimal result

Integrand size = 10, antiderivative size = 31 \[ \int \frac {\sec ^{-1}\left (\frac {a}{x}\right )}{x^2} \, dx=-\frac {\arccos \left (\frac {x}{a}\right )}{x}+\frac {\text {arctanh}\left (\sqrt {1-\frac {x^2}{a^2}}\right )}{a} \]

[Out]

-arccos(x/a)/x+arctanh((1-x^2/a^2)^(1/2))/a

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {5372, 4724, 272, 65, 214} \[ \int \frac {\sec ^{-1}\left (\frac {a}{x}\right )}{x^2} \, dx=\frac {\text {arctanh}\left (\sqrt {1-\frac {x^2}{a^2}}\right )}{a}-\frac {\arccos \left (\frac {x}{a}\right )}{x} \]

[In]

Int[ArcSec[a/x]/x^2,x]

[Out]

-(ArcCos[x/a]/x) + ArcTanh[Sqrt[1 - x^2/a^2]]/a

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 214

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

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 4724

Int[((a_.) + ArcCos[(c_.)*(x_)]*(b_.))^(n_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*ArcCo
s[c*x])^n/(d*(m + 1))), x] + Dist[b*c*(n/(d*(m + 1))), Int[(d*x)^(m + 1)*((a + b*ArcCos[c*x])^(n - 1)/Sqrt[1 -
 c^2*x^2]), x], x] /; FreeQ[{a, b, c, d, m}, x] && IGtQ[n, 0] && NeQ[m, -1]

Rule 5372

Int[ArcSec[(c_.)/((a_.) + (b_.)*(x_)^(n_.))]^(m_.)*(u_.), x_Symbol] :> Int[u*ArcCos[a/c + b*(x^n/c)]^m, x] /;
FreeQ[{a, b, c, n, m}, x]

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(93\) vs. \(2(31)=62\).

Time = 0.09 (sec) , antiderivative size = 93, normalized size of antiderivative = 3.00 \[ \int \frac {\sec ^{-1}\left (\frac {a}{x}\right )}{x^2} \, dx=-\frac {\sec ^{-1}\left (\frac {a}{x}\right )}{x}+\frac {\sqrt {-1+\frac {a^2}{x^2}} x \left (-\log \left (1-\frac {a}{\sqrt {-1+\frac {a^2}{x^2}} x}\right )+\log \left (1+\frac {a}{\sqrt {-1+\frac {a^2}{x^2}} x}\right )\right )}{2 a^2 \sqrt {1-\frac {x^2}{a^2}}} \]

[In]

Integrate[ArcSec[a/x]/x^2,x]

[Out]

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

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.97

method result size
parts \(-\frac {\operatorname {arcsec}\left (\frac {a}{x}\right )}{x}+\frac {\operatorname {arctanh}\left (\frac {1}{\sqrt {1-\frac {x^{2}}{a^{2}}}}\right )}{a}\) \(30\)
derivativedivides \(-\frac {\frac {a \,\operatorname {arcsec}\left (\frac {a}{x}\right )}{x}-\ln \left (\frac {a}{x}+\frac {a \sqrt {1-\frac {x^{2}}{a^{2}}}}{x}\right )}{a}\) \(44\)
default \(-\frac {\frac {a \,\operatorname {arcsec}\left (\frac {a}{x}\right )}{x}-\ln \left (\frac {a}{x}+\frac {a \sqrt {1-\frac {x^{2}}{a^{2}}}}{x}\right )}{a}\) \(44\)

[In]

int(arcsec(a/x)/x^2,x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 107 vs. \(2 (29) = 58\).

Time = 0.27 (sec) , antiderivative size = 107, normalized size of antiderivative = 3.45 \[ \int \frac {\sec ^{-1}\left (\frac {a}{x}\right )}{x^2} \, dx=-\frac {2 \, a x \arctan \left (-\frac {x^{2} \sqrt {\frac {a^{2} - x^{2}}{x^{2}}}}{a^{2} - x^{2}}\right ) - 2 \, {\left (a x - a\right )} \operatorname {arcsec}\left (\frac {a}{x}\right ) - x \log \left (x \sqrt {\frac {a^{2} - x^{2}}{x^{2}}} + a\right ) + x \log \left (x \sqrt {\frac {a^{2} - x^{2}}{x^{2}}} - a\right )}{2 \, a x} \]

[In]

integrate(arcsec(a/x)/x^2,x, algorithm="fricas")

[Out]

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

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 1.07 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.94 \[ \int \frac {\sec ^{-1}\left (\frac {a}{x}\right )}{x^2} \, dx=- \frac {\operatorname {asec}{\left (\frac {a}{x} \right )}}{x} - \frac {\begin {cases} - \operatorname {acosh}{\left (\frac {a}{x} \right )} & \text {for}\: \left |{\frac {a^{2}}{x^{2}}}\right | > 1 \\i \operatorname {asin}{\left (\frac {a}{x} \right )} & \text {otherwise} \end {cases}}{a} \]

[In]

integrate(asec(a/x)/x**2,x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.68 \[ \int \frac {\sec ^{-1}\left (\frac {a}{x}\right )}{x^2} \, dx=-\frac {\frac {2 \, a \operatorname {arcsec}\left (\frac {a}{x}\right )}{x} - \log \left (\sqrt {-\frac {x^{2}}{a^{2}} + 1} + 1\right ) + \log \left (-\sqrt {-\frac {x^{2}}{a^{2}} + 1} + 1\right )}{2 \, a} \]

[In]

integrate(arcsec(a/x)/x^2,x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 61 vs. \(2 (29) = 58\).

Time = 0.27 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.97 \[ \int \frac {\sec ^{-1}\left (\frac {a}{x}\right )}{x^2} \, dx=\frac {a {\left (\frac {\log \left ({\left | a + \sqrt {a^{2} - x^{2}} \right |}\right )}{a} - \frac {\log \left ({\left | -a + \sqrt {a^{2} - x^{2}} \right |}\right )}{a}\right )}}{2 \, {\left | a \right |}} - \frac {\arccos \left (\frac {x}{a}\right )}{x} \]

[In]

integrate(arcsec(a/x)/x^2,x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.71 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.94 \[ \int \frac {\sec ^{-1}\left (\frac {a}{x}\right )}{x^2} \, dx=\frac {\mathrm {atanh}\left (\frac {1}{\sqrt {1-\frac {x^2}{a^2}}}\right )}{a}-\frac {\mathrm {acos}\left (\frac {x}{a}\right )}{x} \]

[In]

int(acos(x/a)/x^2,x)

[Out]

atanh(1/(1 - x^2/a^2)^(1/2))/a - acos(x/a)/x