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

Optimal. Leaf size=65 \[ \frac {1}{5} \left (5-\sqrt {5}\right ) \log \left (2 \sqrt {1-x}-\sqrt {5}+1\right )+\frac {1}{5} \left (5+\sqrt {5}\right ) \log \left (2 \sqrt {1-x}+\sqrt {5}+1\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {632, 31} \[ \frac {1}{5} \left (5-\sqrt {5}\right ) \log \left (2 \sqrt {1-x}-\sqrt {5}+1\right )+\frac {1}{5} \left (5+\sqrt {5}\right ) \log \left (2 \sqrt {1-x}+\sqrt {5}+1\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 632

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[
(c*d - e*(b/2 - q/2))/q, Int[1/(b/2 - q/2 + c*x), x], x] - Dist[(c*d - e*(b/2 + q/2))/q, Int[1/(b/2 + q/2 + c*
x), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] && NiceSqrtQ[b^2 - 4*a*
c]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 62, normalized size = 0.95 \[ \frac {1}{5} \left (\left (5+\sqrt {5}\right ) \log \left (2 \sqrt {1-x}+\sqrt {5}+1\right )-\left (\sqrt {5}-5\right ) \log \left (2 \sqrt {1-x}-\sqrt {5}+1\right )\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 65, normalized size = 1.00 \[ \frac {1}{5} \, \sqrt {5} \log \left (\frac {2 \, x^{2} + \sqrt {5} {\left (x - 2\right )} - {\left (\sqrt {5} {\left (2 \, x + 1\right )} + 5\right )} \sqrt {-x + 1} - 3 \, x - 2}{x^{2} + x - 1}\right ) + \log \left (-x + \sqrt {-x + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/5*sqrt(5)*log((2*x^2 + sqrt(5)*(x - 2) - (sqrt(5)*(2*x + 1) + 5)*sqrt(-x + 1) - 3*x - 2)/(x^2 + x - 1)) + lo
g(-x + sqrt(-x + 1))

________________________________________________________________________________________

giac [A]  time = 0.35, size = 54, normalized size = 0.83 \[ -\frac {1}{5} \, \sqrt {5} \log \left (\frac {{\left | -\sqrt {5} + 2 \, \sqrt {-x + 1} + 1 \right |}}{\sqrt {5} + 2 \, \sqrt {-x + 1} + 1}\right ) + \log \left ({\left | -x + \sqrt {-x + 1} \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/5*sqrt(5)*log(abs(-sqrt(5) + 2*sqrt(-x + 1) + 1)/(sqrt(5) + 2*sqrt(-x + 1) + 1)) + log(abs(-x + sqrt(-x + 1
)))

________________________________________________________________________________________

maple [B]  time = 0.01, size = 101, normalized size = 1.55 \[ \frac {\sqrt {5}\, \arctanh \left (\frac {\left (2 x +1\right ) \sqrt {5}}{5}\right )}{5}+\frac {\sqrt {5}\, \arctanh \left (\frac {\left (2 \sqrt {-x +1}-1\right ) \sqrt {5}}{5}\right )}{5}+\frac {\sqrt {5}\, \arctanh \left (\frac {\left (2 \sqrt {-x +1}+1\right ) \sqrt {5}}{5}\right )}{5}-\frac {\ln \left (-x -\sqrt {-x +1}\right )}{2}+\frac {\ln \left (-x +\sqrt {-x +1}\right )}{2}+\frac {\ln \left (x^{2}+x -1\right )}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.32, size = 51, normalized size = 0.78 \[ -\frac {1}{5} \, \sqrt {5} \log \left (-\frac {\sqrt {5} - 2 \, \sqrt {-x + 1} - 1}{\sqrt {5} + 2 \, \sqrt {-x + 1} + 1}\right ) + \log \left (-x + \sqrt {-x + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/5*sqrt(5)*log(-(sqrt(5) - 2*sqrt(-x + 1) - 1)/(sqrt(5) + 2*sqrt(-x + 1) + 1)) + log(-x + sqrt(-x + 1))

________________________________________________________________________________________

mupad [B]  time = 3.16, size = 79, normalized size = 1.22 \[ \ln \left (2\,\sqrt {1-x}-\left (\frac {\sqrt {5}}{5}+1\right )\,\left (2\,\sqrt {1-x}+1\right )\right )\,\left (\frac {\sqrt {5}}{5}+1\right )-\ln \left (2\,\sqrt {1-x}+\left (\frac {\sqrt {5}}{5}-1\right )\,\left (2\,\sqrt {1-x}+1\right )\right )\,\left (\frac {\sqrt {5}}{5}-1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(2*(1 - x)^(1/2) - (5^(1/2)/5 + 1)*(2*(1 - x)^(1/2) + 1))*(5^(1/2)/5 + 1) - log(2*(1 - x)^(1/2) + (5^(1/2)/
5 - 1)*(2*(1 - x)^(1/2) + 1))*(5^(1/2)/5 - 1)

________________________________________________________________________________________

sympy [A]  time = 2.31, size = 92, normalized size = 1.42 \[ - 4 \left (\begin {cases} - \frac {\sqrt {5} \operatorname {acoth}{\left (\frac {2 \sqrt {5} \left (\sqrt {1 - x} + \frac {1}{2}\right )}{5} \right )}}{10} & \text {for}\: \left (\sqrt {1 - x} + \frac {1}{2}\right )^{2} > \frac {5}{4} \\- \frac {\sqrt {5} \operatorname {atanh}{\left (\frac {2 \sqrt {5} \left (\sqrt {1 - x} + \frac {1}{2}\right )}{5} \right )}}{10} & \text {for}\: \left (\sqrt {1 - x} + \frac {1}{2}\right )^{2} < \frac {5}{4} \end {cases}\right ) + \log {\left (x - \sqrt {1 - x} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-4*Piecewise((-sqrt(5)*acoth(2*sqrt(5)*(sqrt(1 - x) + 1/2)/5)/10, (sqrt(1 - x) + 1/2)**2 > 5/4), (-sqrt(5)*ata
nh(2*sqrt(5)*(sqrt(1 - x) + 1/2)/5)/10, (sqrt(1 - x) + 1/2)**2 < 5/4)) + log(x - sqrt(1 - x))

________________________________________________________________________________________