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

   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 [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 21 \[ \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 = 21, 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.200, Rules used = {272, 65, 213} \[ \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 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[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}{x \sqrt {a^2+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. \(49\) vs. \(2(21)=42\).

Time = 0.04 (sec) , antiderivative size = 49, normalized size of antiderivative = 2.33 \[ \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.22 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.67

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}}}\) \(35\)
pseudoelliptic \(\frac {\ln \left (-a +\sqrt {a^{2}+x^{2}}\right )-\ln \left (a +\sqrt {a^{2}+x^{2}}\right )}{2 a}\) \(35\)

[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 [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 40 vs. \(2 (19) = 38\).

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.51 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.33 \[ \int \frac {1}{x \sqrt {a^2+x^2}} \, dx=- \frac {\operatorname {asinh}{\left (\frac {a}{x} \right )}}{a} \]

[In]

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

[Out]

-asinh(a/x)/a

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.57 \[ \int \frac {1}{x \sqrt {a^2+x^2}} \, dx=-\frac {\operatorname {arsinh}\left (\frac {a}{{\left | x \right |}}\right )}{a} \]

[In]

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

[Out]

-arcsinh(a/abs(x))/a

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.76 \[ \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 + \sqrt {a^{2} + x^{2}}\right )}{2 \, a} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.24 \[ \int \frac {1}{x \sqrt {a^2+x^2}} \, dx=\frac {\mathrm {atan}\left (\frac {\sqrt {a^2+x^2}}{\sqrt {-a^2}}\right )}{\sqrt {-a^2}} \]

[In]

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

[Out]

atan((a^2 + x^2)^(1/2)/(-a^2)^(1/2))/(-a^2)^(1/2)