Optimal. Leaf size=27 \[ x \sec ^{-1}\left (\frac{x}{a}\right )-a \tanh ^{-1}\left (\sqrt{1-\frac{a^2}{x^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0169255, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 6, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.833, Rules used = {4833, 5214, 266, 63, 208} \[ x \sec ^{-1}\left (\frac{x}{a}\right )-a \tanh ^{-1}\left (\sqrt{1-\frac{a^2}{x^2}}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4833
Rule 5214
Rule 266
Rule 63
Rule 208
Rubi steps
\begin{align*} \int \cos ^{-1}\left (\frac{a}{x}\right ) \, dx &=\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 \operatorname{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{\operatorname{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 \tanh ^{-1}\left (\sqrt{1-\frac{a^2}{x^2}}\right )\\ \end{align*}
Mathematica [B] time = 0.1011, size = 84, normalized size = 3.11 \[ x \cos ^{-1}\left (\frac{a}{x}\right )-\frac{a \sqrt{x^2-a^2} \left (\log \left (\frac{x}{\sqrt{x^2-a^2}}+1\right )-\log \left (1-\frac{x}{\sqrt{x^2-a^2}}\right )\right )}{2 x \sqrt{1-\frac{a^2}{x^2}}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.006, size = 30, normalized size = 1.1 \begin{align*} -a \left ( -{\frac{x}{a}\arccos \left ({\frac{a}{x}} \right ) }+{\it Artanh} \left ({\frac{1}{\sqrt{1-{\frac{{a}^{2}}{{x}^{2}}}}}} \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.45402, size = 61, normalized size = 2.26 \begin{align*} -\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 ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.52093, size = 140, normalized size = 5.19 \begin{align*}{\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 ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 2.27124, size = 29, normalized size = 1.07 \begin{align*} - a \left (\begin{cases} \operatorname{acosh}{\left (\frac{x}{a} \right )} & \text{for}\: \frac{\left |{x^{2}}\right |}{\left |{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 )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.26154, size = 58, normalized size = 2.15 \begin{align*} -\frac{1}{2} \,{\left (\log \left (a^{2}\right ) \mathrm{sgn}\left (x\right ) - \frac{2 \, \log \left ({\left | -x + \sqrt{-a^{2} + x^{2}} \right |}\right )}{\mathrm{sgn}\left (x\right )}\right )} a + x \arccos \left (\frac{a}{x}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]