3.8.37 \(\int \frac {\sqrt {-\frac {x}{1+x}}}{x} \, dx\) [737]

Optimal. Leaf size=15 \[ 2 \tan ^{-1}\left (\sqrt {-\frac {x}{1+x}}\right ) \]

[Out]

2*arctan((-x/(1+x))^(1/2))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {1980, 210} \begin {gather*} 2 \text {ArcTan}\left (\sqrt {-\frac {x}{x+1}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[-(x/(1 + x))]/x,x]

[Out]

2*ArcTan[Sqrt[-(x/(1 + x))]]

Rule 210

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

Rule 1980

Int[(x_)^(m_.)*(((e_.)*((a_.) + (b_.)*(x_)))/((c_) + (d_.)*(x_)))^(p_), x_Symbol] :> With[{q = Denominator[p]}
, Dist[q*e*(b*c - a*d), Subst[Int[x^(q*(p + 1) - 1)*(((-a)*e + c*x^q)^m/(b*e - d*x^q)^(m + 2)), x], x, (e*((a
+ b*x)/(c + d*x)))^(1/q)], x]] /; FreeQ[{a, b, c, d, e, m}, x] && FractionQ[p] && IntegerQ[m]

Rubi steps

\begin {align*} \int \frac {\sqrt {-\frac {x}{1+x}}}{x} \, dx &=-\left (2 \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,\sqrt {-\frac {x}{1+x}}\right )\right )\\ &=2 \tan ^{-1}\left (\sqrt {-\frac {x}{1+x}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(37\) vs. \(2(15)=30\).
time = 0.01, size = 37, normalized size = 2.47 \begin {gather*} \frac {2 \sqrt {-\frac {x}{1+x}} \tanh ^{-1}\left (\sqrt {\frac {x}{1+x}}\right )}{\sqrt {\frac {x}{1+x}}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[-(x/(1 + x))]/x,x]

[Out]

(2*Sqrt[-(x/(1 + x))]*ArcTanh[Sqrt[x/(1 + x)]])/Sqrt[x/(1 + x)]

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(32\) vs. \(2(13)=26\).
time = 0.11, size = 33, normalized size = 2.20

method result size
default \(\frac {\sqrt {-\frac {x}{1+x}}\, \left (1+x \right ) \ln \left (x +\frac {1}{2}+\sqrt {x^{2}+x}\right )}{\sqrt {x \left (1+x \right )}}\) \(33\)
trager \(-\RootOf \left (\textit {\_Z}^{2}+1\right ) \ln \left (-2 x \RootOf \left (\textit {\_Z}^{2}+1\right )+2 \sqrt {-\frac {x}{1+x}}\, x -\RootOf \left (\textit {\_Z}^{2}+1\right )+2 \sqrt {-\frac {x}{1+x}}\right )\) \(53\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.48, size = 13, normalized size = 0.87 \begin {gather*} 2 \, \arctan \left (\sqrt {-\frac {x}{x + 1}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*arctan(sqrt(-x/(x + 1)))

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 13, normalized size = 0.87 \begin {gather*} 2 \, \arctan \left (\sqrt {-\frac {x}{x + 1}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*arctan(sqrt(-x/(x + 1)))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {- \frac {x}{x + 1}}}{x}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral(sqrt(-x/(x + 1))/x, x)

________________________________________________________________________________________

Giac [A]
time = 3.94, size = 20, normalized size = 1.33 \begin {gather*} -\frac {1}{2} \, \pi \mathrm {sgn}\left (x + 1\right ) - \arcsin \left (2 \, x + 1\right ) \mathrm {sgn}\left (x + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*pi*sgn(x + 1) - arcsin(2*x + 1)*sgn(x + 1)

________________________________________________________________________________________

Mupad [B]
time = 0.18, size = 13, normalized size = 0.87 \begin {gather*} 2\,\mathrm {atan}\left (\sqrt {-\frac {x}{x+1}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-x/(x + 1))^(1/2)/x,x)

[Out]

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

________________________________________________________________________________________