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

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 69, normalized size = 0.95 \begin {gather*} -\frac {2}{5} \left (-5+\sqrt {5}\right ) \log \left (1+\sqrt {5}-2 \sqrt {1+\sqrt {1+x}}\right )+\frac {2}{5} \left (5+\sqrt {5}\right ) \log \left (-1+\sqrt {5}+2 \sqrt {1+\sqrt {1+x}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {cought exception: maximum recursion depth exceeded while calling a Python object} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

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

[Out]

cought exception: maximum recursion depth exceeded while calling a Python object

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(174\) vs. \(2(53)=106\).
time = 0.10, size = 175, normalized size = 2.40

method result size
derivativedivides \(2 \ln \left (\sqrt {1+x}-\sqrt {1+\sqrt {1+x}}\right )+\frac {4 \sqrt {5}\, \arctanh \left (\frac {\left (2 \sqrt {1+\sqrt {1+x}}-1\right ) \sqrt {5}}{5}\right )}{5}\) \(46\)
default \(\frac {\sqrt {5}\, \arctanh \left (\frac {\left (1+2 \sqrt {1+x}\right ) \sqrt {5}}{5}\right )}{5}+\frac {\sqrt {5}\, \arctanh \left (\frac {\left (2 \sqrt {1+x}-1\right ) \sqrt {5}}{5}\right )}{5}-\ln \left (\sqrt {1+x}+\sqrt {1+\sqrt {1+x}}\right )+\frac {\ln \left (x -\sqrt {1+x}\right )}{2}+\frac {\sqrt {5}\, \arctanh \left (\frac {\left (2 x -1\right ) \sqrt {5}}{5}\right )}{5}+\frac {\ln \left (x^{2}-x -1\right )}{2}+\frac {2 \sqrt {5}\, \arctanh \left (\frac {\left (2 \sqrt {1+\sqrt {1+x}}-1\right ) \sqrt {5}}{5}\right )}{5}+\ln \left (\sqrt {1+x}-\sqrt {1+\sqrt {1+x}}\right )-\frac {\ln \left (x +\sqrt {1+x}\right )}{2}+\frac {2 \arctanh \left (\frac {\left (1+2 \sqrt {1+\sqrt {1+x}}\right ) \sqrt {5}}{5}\right ) \sqrt {5}}{5}\) \(175\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.36, size = 63, normalized size = 0.86 \begin {gather*} -\frac {2}{5} \, \sqrt {5} \log \left (-\frac {\sqrt {5} - 2 \, \sqrt {\sqrt {x + 1} + 1} + 1}{\sqrt {5} + 2 \, \sqrt {\sqrt {x + 1} + 1} - 1}\right ) + 2 \, \log \left (\sqrt {x + 1} - \sqrt {\sqrt {x + 1} + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 112 vs. \(2 (51) = 102\).
time = 0.35, size = 112, normalized size = 1.53 \begin {gather*} \frac {2}{5} \, \sqrt {5} \log \left (\frac {2 \, x^{2} + \sqrt {5} {\left (3 \, x + 1\right )} + {\left (\sqrt {5} {\left (x + 2\right )} + 5 \, x\right )} \sqrt {x + 1} + {\left (\sqrt {5} {\left (x + 2\right )} + {\left (\sqrt {5} {\left (2 \, x - 1\right )} + 5\right )} \sqrt {x + 1} + 5 \, x\right )} \sqrt {\sqrt {x + 1} + 1} + 3 \, x + 3}{x^{2} - x - 1}\right ) + 2 \, \log \left (\sqrt {x + 1} - \sqrt {\sqrt {x + 1} + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.02, size = 92, normalized size = 1.26 \begin {gather*} 4 \left (\frac {\ln \left |\sqrt {x+1}+1-\sqrt {\sqrt {x+1}+1}-1\right |}{2}-\frac {\ln \left (\frac {\left |2 \sqrt {\sqrt {x+1}+1}-1-\sqrt {5}\right |}{\left |2 \sqrt {\sqrt {x+1}+1}-1+\sqrt {5}\right |}\right )}{2 \sqrt {5}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {1}{x-\sqrt {\sqrt {x+1}+1}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________