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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {1412, 799, 794, 222} \begin {gather*} -\text {ArcSin}\left (\sqrt {x}\right )-\sqrt {1-x} \left (2-\sqrt {x}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-((2 - Sqrt[x])*Sqrt[1 - x]) - ArcSin[Sqrt[x]]

Rule 222

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[Rt[-b, 2]*(x/Sqrt[a])]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 794

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((e*f + d*g)*(2*p
+ 3) + 2*e*g*(p + 1)*x)*((a + c*x^2)^(p + 1)/(2*c*(p + 1)*(2*p + 3))), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(c*
(2*p + 3)), Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] &&  !LeQ[p, -1]

Rule 799

Int[(x_)*((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Dist[d^m*e^m, Int[x*((a + c*x^2)^(m
 + p)/(a*e + c*d*x)^m), x], x] /; FreeQ[{a, c, d, e, p}, x] && EqQ[c*d^2 + a*e^2, 0] &&  !IntegerQ[p] && ILtQ[
m, 0] && EqQ[m, -1] &&  !ILtQ[p - 1/2, 0]

Rule 1412

Int[((a_) + (c_.)*(x_)^(n2_.))^(p_.)*((d_) + (e_.)*(x_)^(n_))^(q_.), x_Symbol] :> With[{g = Denominator[n]}, D
ist[g, Subst[Int[x^(g - 1)*(d + e*x^(g*n))^q*(a + c*x^(2*g*n))^p, x], x, x^(1/g)], x]] /; FreeQ[{a, c, d, e, p
, q}, x] && EqQ[n2, 2*n] && FractionQ[n]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 40, normalized size = 1.38 \begin {gather*} \left (-2+\sqrt {x}\right ) \sqrt {1-x}+2 \tan ^{-1}\left (\frac {\sqrt {1-x}}{1+\sqrt {x}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(47\) vs. \(2(23)=46\).
time = 0.24, size = 48, normalized size = 1.66

method result size
default \(-\frac {\sqrt {1-x}\, \sqrt {x}\, \left (-2 \sqrt {-x \left (-1+x \right )}+\arcsin \left (2 x -1\right )\right )}{2 \sqrt {-x \left (-1+x \right )}}-2 \sqrt {1-x}\) \(48\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 1.38, size = 32, normalized size = 1.10 \begin {gather*} i \sqrt {x} \sqrt {x - 1} - 2 i \sqrt {x - 1} + i \operatorname {asinh}{\left (\sqrt {x - 1} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

I*sqrt(x)*sqrt(x - 1) - 2*I*sqrt(x - 1) + I*asinh(sqrt(x - 1))

________________________________________________________________________________________

Giac [A]
time = 3.14, size = 29, normalized size = 1.00 \begin {gather*} \sqrt {x} \sqrt {-x + 1} - 2 \, \sqrt {-x + 1} + \arcsin \left (\sqrt {-x + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

sqrt(x)*sqrt(-x + 1) - 2*sqrt(-x + 1) + arcsin(sqrt(-x + 1))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________