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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 27, antiderivative size = 92 \[ \int \frac {\sqrt {1+\sqrt {1+x}}}{x-\sqrt {1+x}} \, dx=4 \sqrt {1+\sqrt {1+x}}-\frac {2}{5} \left (-5+3 \sqrt {5}\right ) \text {arctanh}\left (\frac {2 \sqrt {1+\sqrt {1+x}}}{-1+\sqrt {5}}\right )-\frac {2}{5} \left (5+3 \sqrt {5}\right ) \text {arctanh}\left (\frac {2 \sqrt {1+\sqrt {1+x}}}{1+\sqrt {5}}\right ) \]

[Out]

4*(1+(1+x)^(1/2))^(1/2)-2/5*(3*5^(1/2)-5)*arctanh(2*(1+(1+x)^(1/2))^(1/2)/(5^(1/2)-1))-2/5*(5+3*5^(1/2))*arcta
nh(2*(1+(1+x)^(1/2))^(1/2)/(5^(1/2)+1))

Rubi [A] (verified)

Time = 0.17 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.24, number of steps used = 6, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {838, 840, 1180, 213} \[ \int \frac {\sqrt {1+\sqrt {1+x}}}{x-\sqrt {1+x}} \, dx=-2 \sqrt {\frac {2}{5} \left (7+3 \sqrt {5}\right )} \text {arctanh}\left (\sqrt {\frac {2}{3+\sqrt {5}}} \sqrt {\sqrt {x+1}+1}\right )-2 \sqrt {\frac {2}{5} \left (7-3 \sqrt {5}\right )} \text {arctanh}\left (\sqrt {\frac {1}{2} \left (3+\sqrt {5}\right )} \sqrt {\sqrt {x+1}+1}\right )+4 \sqrt {\sqrt {x+1}+1} \]

[In]

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

[Out]

4*Sqrt[1 + Sqrt[1 + x]] - 2*Sqrt[(2*(7 + 3*Sqrt[5]))/5]*ArcTanh[Sqrt[2/(3 + Sqrt[5])]*Sqrt[1 + Sqrt[1 + x]]] -
 2*Sqrt[(2*(7 - 3*Sqrt[5]))/5]*ArcTanh[Sqrt[(3 + Sqrt[5])/2]*Sqrt[1 + Sqrt[1 + x]]]

Rule 213

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

Rule 838

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[g*
((d + e*x)^m/(c*m)), x] + Dist[1/c, Int[(d + e*x)^(m - 1)*(Simp[c*d*f - a*e*g + (g*c*d - b*e*g + c*e*f)*x, x]/
(a + b*x + c*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*
e^2, 0] && FractionQ[m] && GtQ[m, 0]

Rule 840

Int[((f_.) + (g_.)*(x_))/(Sqrt[(d_.) + (e_.)*(x_)]*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)), x_Symbol] :> Dist[2,
Subst[Int[(e*f - d*g + g*x^2)/(c*d^2 - b*d*e + a*e^2 - (2*c*d - b*e)*x^2 + c*x^4), x], x, Sqrt[d + e*x]], x] /
; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]

Rule 1180

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

Rubi steps \begin{align*} \text {integral}& = 2 \text {Subst}\left (\int \frac {x \sqrt {1+x}}{-1-x+x^2} \, dx,x,\sqrt {1+x}\right ) \\ & = 4 \sqrt {1+\sqrt {1+x}}+2 \text {Subst}\left (\int \frac {1+2 x}{\sqrt {1+x} \left (-1-x+x^2\right )} \, dx,x,\sqrt {1+x}\right ) \\ & = 4 \sqrt {1+\sqrt {1+x}}+4 \text {Subst}\left (\int \frac {-1+2 x^2}{1-3 x^2+x^4} \, dx,x,\sqrt {1+\sqrt {1+x}}\right ) \\ & = 4 \sqrt {1+\sqrt {1+x}}+\frac {1}{5} \left (4 \left (5-2 \sqrt {5}\right )\right ) \text {Subst}\left (\int \frac {1}{-\frac {3}{2}+\frac {\sqrt {5}}{2}+x^2} \, dx,x,\sqrt {1+\sqrt {1+x}}\right )+\frac {1}{5} \left (4 \left (5+2 \sqrt {5}\right )\right ) \text {Subst}\left (\int \frac {1}{-\frac {3}{2}-\frac {\sqrt {5}}{2}+x^2} \, dx,x,\sqrt {1+\sqrt {1+x}}\right ) \\ & = 4 \sqrt {1+\sqrt {1+x}}-2 \sqrt {\frac {2}{5} \left (7+3 \sqrt {5}\right )} \text {arctanh}\left (\sqrt {\frac {2}{3+\sqrt {5}}} \sqrt {1+\sqrt {1+x}}\right )-\frac {2}{5} \sqrt {70-30 \sqrt {5}} \text {arctanh}\left (\sqrt {\frac {1}{2} \left (3+\sqrt {5}\right )} \sqrt {1+\sqrt {1+x}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.16 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.93 \[ \int \frac {\sqrt {1+\sqrt {1+x}}}{x-\sqrt {1+x}} \, dx=4 \sqrt {1+\sqrt {1+x}}+\left (-2-\frac {6}{\sqrt {5}}\right ) \text {arctanh}\left (\frac {1}{2} \left (-1+\sqrt {5}\right ) \sqrt {1+\sqrt {1+x}}\right )+\left (2-\frac {6}{\sqrt {5}}\right ) \text {arctanh}\left (\frac {1}{2} \left (1+\sqrt {5}\right ) \sqrt {1+\sqrt {1+x}}\right ) \]

[In]

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

[Out]

4*Sqrt[1 + Sqrt[1 + x]] + (-2 - 6/Sqrt[5])*ArcTanh[((-1 + Sqrt[5])*Sqrt[1 + Sqrt[1 + x]])/2] + (2 - 6/Sqrt[5])
*ArcTanh[((1 + Sqrt[5])*Sqrt[1 + Sqrt[1 + x]])/2]

Maple [A] (verified)

Time = 0.18 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.05

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

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 234 vs. \(2 (68) = 136\).

Time = 0.26 (sec) , antiderivative size = 234, normalized size of antiderivative = 2.54 \[ \int \frac {\sqrt {1+\sqrt {1+x}}}{x-\sqrt {1+x}} \, dx=\frac {3}{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 ) + \frac {3}{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 ) + 4 \, \sqrt {\sqrt {x + 1} + 1} - \log \left (\sqrt {x + 1} + \sqrt {\sqrt {x + 1} + 1}\right ) + \log \left (\sqrt {x + 1} - \sqrt {\sqrt {x + 1} + 1}\right ) \]

[In]

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

[Out]

3/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)) + 3/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)) + 4*sqrt(sqrt(x + 1) + 1) - log(sqrt(x + 1) + sqrt(s
qrt(x + 1) + 1)) + log(sqrt(x + 1) - sqrt(sqrt(x + 1) + 1))

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 165 vs. \(2 (76) = 152\).

Time = 4.11 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.79 \[ \int \frac {\sqrt {1+\sqrt {1+x}}}{x-\sqrt {1+x}} \, dx=4 \sqrt {\sqrt {x + 1} + 1} + \frac {3 \sqrt {5} \left (- \log {\left (\sqrt {\sqrt {x + 1} + 1} - \frac {1}{2} + \frac {\sqrt {5}}{2} \right )} + \log {\left (\sqrt {\sqrt {x + 1} + 1} - \frac {\sqrt {5}}{2} - \frac {1}{2} \right )}\right )}{5} + \frac {3 \sqrt {5} \left (- \log {\left (\sqrt {\sqrt {x + 1} + 1} + \frac {1}{2} + \frac {\sqrt {5}}{2} \right )} + \log {\left (\sqrt {\sqrt {x + 1} + 1} - \frac {\sqrt {5}}{2} + \frac {1}{2} \right )}\right )}{5} + \log {\left (\sqrt {x + 1} - \sqrt {\sqrt {x + 1} + 1} \right )} - \log {\left (\sqrt {x + 1} + \sqrt {\sqrt {x + 1} + 1} \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.43 \[ \int \frac {\sqrt {1+\sqrt {1+x}}}{x-\sqrt {1+x}} \, dx=\frac {3}{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 ) + \frac {3}{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 ) + 4 \, \sqrt {\sqrt {x + 1} + 1} - \log \left (\sqrt {x + 1} + \sqrt {\sqrt {x + 1} + 1}\right ) + \log \left (\sqrt {x + 1} - \sqrt {\sqrt {x + 1} + 1}\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.54 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.48 \[ \int \frac {\sqrt {1+\sqrt {1+x}}}{x-\sqrt {1+x}} \, dx=\frac {3}{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 ) + \frac {3}{5} \, \sqrt {5} \log \left (\frac {{\left | -\sqrt {5} + 2 \, \sqrt {\sqrt {x + 1} + 1} - 1 \right |}}{{\left | \sqrt {5} + 2 \, \sqrt {\sqrt {x + 1} + 1} - 1 \right |}}\right ) + 4 \, \sqrt {\sqrt {x + 1} + 1} - \log \left (\sqrt {x + 1} + \sqrt {\sqrt {x + 1} + 1}\right ) + \log \left ({\left | \sqrt {x + 1} - \sqrt {\sqrt {x + 1} + 1} \right |}\right ) \]

[In]

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

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {1+\sqrt {1+x}}}{x-\sqrt {1+x}} \, dx=\int \frac {\sqrt {\sqrt {x+1}+1}}{x-\sqrt {x+1}} \,d x \]

[In]

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

[Out]

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