\(\int \arccos (\frac {a}{x}) \, dx\) [55]

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 27, 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.833, Rules used = {4917, 5322, 272, 65, 214} \[ \int \arccos \left (\frac {a}{x}\right ) \, dx=x \sec ^{-1}\left (\frac {x}{a}\right )-a \text {arctanh}\left (\sqrt {1-\frac {a^2}{x^2}}\right ) \]

[In]

Int[ArcCos[a/x],x]

[Out]

x*ArcSec[x/a] - a*ArcTanh[Sqrt[1 - a^2/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 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 4917

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

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*} \text {integral}& = \int \sec ^{-1}\left (\frac {x}{a}\right ) \, dx \\ & = x \sec ^{-1}\left (\frac {x}{a}\right )-a \int \frac {1}{\sqrt {1-\frac {a^2}{x^2}} x} \, dx \\ & = x \sec ^{-1}\left (\frac {x}{a}\right )+\frac {1}{2} a \text {Subst}\left (\int \frac {1}{x \sqrt {1-a^2 x}} \, dx,x,\frac {1}{x^2}\right ) \\ & = x \sec ^{-1}\left (\frac {x}{a}\right )-\frac {\text {Subst}\left (\int \frac {1}{\frac {1}{a^2}-\frac {x^2}{a^2}} \, dx,x,\sqrt {1-\frac {a^2}{x^2}}\right )}{a} \\ & = x \sec ^{-1}\left (\frac {x}{a}\right )-a \text {arctanh}\left (\sqrt {1-\frac {a^2}{x^2}}\right ) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(84\) vs. \(2(27)=54\).

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

[In]

Integrate[ArcCos[a/x],x]

[Out]

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

Maple [A] (verified)

Time = 0.29 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.11

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

[In]

int(arccos(a/x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (25) = 50\).

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

[In]

integrate(arccos(a/x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

integrate(acos(a/x),x)

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

integrate(arccos(a/x),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (25) = 50\).

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

[In]

integrate(arccos(a/x),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.61 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.04 \[ \int \arccos \left (\frac {a}{x}\right ) \, dx=x\,\mathrm {acos}\left (\frac {a}{x}\right )-a\,\mathrm {sign}\left (x\right )\,\ln \left (x+\sqrt {x^2-a^2}\right ) \]

[In]

int(acos(a/x),x)

[Out]

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