3.7.99 \(\int \frac {1}{x-\sqrt {2+x}} \, dx\) [699]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {646, 31} \begin {gather*} \frac {4}{3} \log \left (2-\sqrt {x+2}\right )+\frac {2}{3} \log \left (\sqrt {x+2}+1\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 31

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

Rule 646

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}{x-\sqrt {2+x}} \, dx &=2 \text {Subst}\left (\int \frac {x}{-2-x+x^2} \, dx,x,\sqrt {2+x}\right )\\ &=\frac {2}{3} \text {Subst}\left (\int \frac {1}{1+x} \, dx,x,\sqrt {2+x}\right )+\frac {4}{3} \text {Subst}\left (\int \frac {1}{-2+x} \, dx,x,\sqrt {2+x}\right )\\ &=\frac {4}{3} \log \left (2-\sqrt {2+x}\right )+\frac {2}{3} \log \left (1+\sqrt {2+x}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 29, normalized size = 0.94 \begin {gather*} \frac {4}{3} \log \left (-2+\sqrt {2+x}\right )+\frac {2}{3} \log \left (1+\sqrt {2+x}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(53\) vs. \(2(23)=46\).
time = 0.08, size = 54, normalized size = 1.74

method result size
derivativedivides \(\frac {2 \ln \left (1+\sqrt {x +2}\right )}{3}+\frac {4 \ln \left (\sqrt {x +2}-2\right )}{3}\) \(22\)
trager \(\frac {\ln \left (6 \sqrt {x +2}\, x^{2}-x^{3}+16 \sqrt {x +2}\, x -15 x^{2}+8 \sqrt {x +2}-24 x -12\right )}{3}\) \(44\)
default \(\frac {\ln \left (1+x \right )}{3}+\frac {2 \ln \left (x -2\right )}{3}+\frac {\ln \left (1+\sqrt {x +2}\right )}{3}-\frac {2 \ln \left (\sqrt {x +2}+2\right )}{3}+\frac {2 \ln \left (\sqrt {x +2}-2\right )}{3}-\frac {\ln \left (-1+\sqrt {x +2}\right )}{3}\) \(54\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 21, normalized size = 0.68 \begin {gather*} \frac {2}{3} \, \log \left (\sqrt {x + 2} + 1\right ) + \frac {4}{3} \, \log \left (\sqrt {x + 2} - 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/3*log(sqrt(x + 2) + 1) + 4/3*log(sqrt(x + 2) - 2)

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 21, normalized size = 0.68 \begin {gather*} \frac {2}{3} \, \log \left (\sqrt {x + 2} + 1\right ) + \frac {4}{3} \, \log \left (\sqrt {x + 2} - 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/3*log(sqrt(x + 2) + 1) + 4/3*log(sqrt(x + 2) - 2)

________________________________________________________________________________________

Sympy [A]
time = 1.07, size = 36, normalized size = 1.16 \begin {gather*} \log {\left (x - \sqrt {x + 2} \right )} + \frac {\log {\left (2 \sqrt {x + 2} - 4 \right )}}{3} - \frac {\log {\left (2 \sqrt {x + 2} + 2 \right )}}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - sqrt(x + 2)) + log(2*sqrt(x + 2) - 4)/3 - log(2*sqrt(x + 2) + 2)/3

________________________________________________________________________________________

Giac [A]
time = 4.56, size = 22, normalized size = 0.71 \begin {gather*} \frac {2}{3} \, \log \left (\sqrt {x + 2} + 1\right ) + \frac {4}{3} \, \log \left ({\left | \sqrt {x + 2} - 2 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 3.08, size = 25, normalized size = 0.81 \begin {gather*} \frac {2\,\ln \left (\frac {2\,\sqrt {x+2}}{3}+\frac {2}{3}\right )}{3}+\frac {4\,\ln \left (\frac {4}{3}-\frac {2\,\sqrt {x+2}}{3}\right )}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*log((2*(x + 2)^(1/2))/3 + 2/3))/3 + (4*log(4/3 - (2*(x + 2)^(1/2))/3))/3

________________________________________________________________________________________