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

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (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 = 17, antiderivative size = 23 \[ \int \frac {1}{x \sqrt {a^2-x^2}} \, dx=-\frac {\text {arctanh}\left (\frac {\sqrt {a^2-x^2}}{a}\right )}{a} \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {272, 65, 212} \[ \int \frac {1}{x \sqrt {a^2-x^2}} \, dx=-\frac {\text {arctanh}\left (\frac {\sqrt {a^2-x^2}}{a}\right )}{a} \]

[In]

Int[1/(x*Sqrt[a^2 - x^2]),x]

[Out]

-(ArcTanh[Sqrt[a^2 - x^2]/a]/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 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]]

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(53\) vs. \(2(23)=46\).

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

[In]

Integrate[1/(x*Sqrt[a^2 - x^2]),x]

[Out]

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

Maple [A] (verified)

Time = 0.21 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.61

method result size
default \(-\frac {\ln \left (\frac {2 a^{2}+2 \sqrt {a^{2}}\, \sqrt {a^{2}-x^{2}}}{x}\right )}{\sqrt {a^{2}}}\) \(37\)
pseudoelliptic \(\frac {\ln \left (-a +\sqrt {a^{2}-x^{2}}\right )-\ln \left (a +\sqrt {a^{2}-x^{2}}\right )}{2 a}\) \(39\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

log(-(a - sqrt(a^2 - x^2))/x)/a

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

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

[In]

integrate(1/x/(a**2-x**2)**(1/2),x)

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (21) = 42\).

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

int(1/(x*(a^2 - x^2)^(1/2)),x)

[Out]

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