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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0116393, antiderivative size = 32, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {1959, 288, 204} \[ \sqrt{-\frac{x}{x+1}} (x+1)-\tan ^{-1}\left (\sqrt{-\frac{x}{x+1}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 1959

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

Rule 288

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^
n)^(p + 1))/(b*n*(p + 1)), x] - Dist[(c^n*(m - n + 1))/(b*n*(p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^(p + 1), x
], x] /; FreeQ[{a, b, c}, x] && IGtQ[n, 0] && LtQ[p, -1] && GtQ[m + 1, n] &&  !ILtQ[(m + n*(p + 1) + 1)/n, 0]
&& IntBinomialQ[a, b, c, n, m, p, 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 \sqrt{-\frac{x}{1+x}} \, dx &=-\left (2 \operatorname{Subst}\left (\int \frac{x^2}{\left (-1-x^2\right )^2} \, dx,x,\sqrt{-\frac{x}{1+x}}\right )\right )\\ &=\sqrt{-\frac{x}{1+x}} (1+x)+\operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,\sqrt{-\frac{x}{1+x}}\right )\\ &=\sqrt{-\frac{x}{1+x}} (1+x)-\tan ^{-1}\left (\sqrt{-\frac{x}{1+x}}\right )\\ \end{align*}

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 46, normalized size = 1.4 \begin{align*}{\frac{1+x}{2}\sqrt{-{\frac{x}{1+x}}} \left ( 2\,\sqrt{{x}^{2}+x}-\ln \left ({\frac{1}{2}}+x+\sqrt{{x}^{2}+x} \right ) \right ){\frac{1}{\sqrt{x \left ( 1+x \right ) }}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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