3.979 \(\int \frac{1}{\sqrt{\frac{-1-x}{x}}} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0118638, antiderivative size = 29, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {1972, 242, 51, 63, 204} \[ \tan ^{-1}\left (\sqrt{-\frac{x+1}{x}}\right )-x \sqrt{-\frac{x+1}{x}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 1972

Int[(u_)^(p_), x_Symbol] :> Int[ExpandToSum[u, x]^p, x] /; FreeQ[p, x] && BinomialQ[u, x] &&  !BinomialMatchQ[
u, x]

Rule 242

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Subst[Int[(a + b/x^n)^p/x^2, x], x, 1/x] /; FreeQ[{a, b, p},
x] && ILtQ[n, 0]

Rule 51

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^(n + 1
))/((b*c - a*d)*(m + 1)), x] - Dist[(d*(m + n + 2))/((b*c - a*d)*(m + 1)), Int[(a + b*x)^(m + 1)*(c + d*x)^n,
x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[m, -1] &&  !(LtQ[n, -1] && (EqQ[a, 0] || (NeQ[
c, 0] && LtQ[m - n, 0] && IntegerQ[n]))) && IntLinearQ[a, b, c, d, m, n, x]

Rule 63

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 204

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

Rubi steps

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

Mathematica [A]  time = 0.0132626, size = 43, normalized size = 1.48 \[ \frac{\sqrt{x} (x+1)-\sqrt{x+1} \sinh ^{-1}\left (\sqrt{x}\right )}{\sqrt{x} \sqrt{-\frac{x+1}{x}}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(Sqrt[x]*(1 + x) - Sqrt[1 + x]*ArcSinh[Sqrt[x]])/(Sqrt[x]*Sqrt[-((1 + x)/x)])

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 44, normalized size = 1.5 \begin{align*}{\frac{1+x}{2} \left ( 2\,\sqrt{-{x}^{2}-x}+\arcsin \left ( 1+2\,x \right ) \right ){\frac{1}{\sqrt{-{\frac{1+x}{x}}}}}{\frac{1}{\sqrt{-x \left ( 1+x \right ) }}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.61727, size = 47, normalized size = 1.62 \begin{align*} -\frac{\sqrt{-\frac{x + 1}{x}}}{\frac{x + 1}{x} - 1} + \arctan \left (\sqrt{-\frac{x + 1}{x}}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.46477, size = 65, normalized size = 2.24 \begin{align*} -x \sqrt{-\frac{x + 1}{x}} + \arctan \left (\sqrt{-\frac{x + 1}{x}}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.19008, size = 47, normalized size = 1.62 \begin{align*} \frac{1}{4} \, \pi \mathrm{sgn}\left (x\right ) - \frac{\arcsin \left (2 \, x + 1\right )}{2 \, \mathrm{sgn}\left (x\right )} - \frac{\sqrt{-x^{2} - x}}{\mathrm{sgn}\left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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