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

Optimal. Leaf size=118 \[ \frac {16}{3} \sqrt {1+\sqrt {1+x}}+\frac {4}{3} \sqrt {1+x} \sqrt {1+\sqrt {1+x}}-\frac {4}{5} \left (-5+2 \sqrt {5}\right ) \tanh ^{-1}\left (\frac {2 \sqrt {1+\sqrt {1+x}}}{-1+\sqrt {5}}\right )-\frac {4}{5} \left (5+2 \sqrt {5}\right ) \tanh ^{-1}\left (\frac {2 \sqrt {1+\sqrt {1+x}}}{1+\sqrt {5}}\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.32, antiderivative size = 131, normalized size of antiderivative = 1.11, number of steps used = 7, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {911, 1301, 1180, 213} \begin {gather*} \frac {4}{3} \left (\sqrt {x+1}+1\right )^{3/2}+4 \sqrt {\sqrt {x+1}+1}-4 \sqrt {\frac {1}{5} \left (9+4 \sqrt {5}\right )} \tanh ^{-1}\left (\sqrt {\frac {2}{3+\sqrt {5}}} \sqrt {\sqrt {x+1}+1}\right )+4 \sqrt {\frac {1}{5} \left (9-4 \sqrt {5}\right )} \tanh ^{-1}\left (\sqrt {\frac {1}{2} \left (3+\sqrt {5}\right )} \sqrt {\sqrt {x+1}+1}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

4*Sqrt[1 + Sqrt[1 + x]] + (4*(1 + Sqrt[1 + x])^(3/2))/3 - 4*Sqrt[(9 + 4*Sqrt[5])/5]*ArcTanh[Sqrt[2/(3 + Sqrt[5
])]*Sqrt[1 + Sqrt[1 + x]]] + 4*Sqrt[(9 - 4*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 911

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :
> With[{q = Denominator[m]}, Dist[q/e, Subst[Int[x^(q*(m + 1) - 1)*((e*f - d*g)/e + g*(x^q/e))^n*((c*d^2 - b*d
*e + a*e^2)/e^2 - (2*c*d - b*e)*(x^q/e^2) + c*(x^(2*q)/e^2))^p, x], x, (d + e*x)^(1/q)], x]] /; FreeQ[{a, b, c
, d, e, f, g}, x] && NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegersQ[n,
 p] && FractionQ[m]

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]

Rule 1301

Int[(((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^2)^(q_.))/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> Int[Ex
pandIntegrand[(f*x)^m*((d + e*x^2)^q/(a + b*x^2 + c*x^4)), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b^
2 - 4*a*c, 0] && IntegerQ[q] && IntegerQ[m]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.17, size = 100, normalized size = 0.85 \begin {gather*} \frac {4}{15} \left (5 \sqrt {1+\sqrt {1+x}} \left (4+\sqrt {1+x}\right )-3 \left (5+2 \sqrt {5}\right ) \tanh ^{-1}\left (\frac {1}{2} \left (-1+\sqrt {5}\right ) \sqrt {1+\sqrt {1+x}}\right )+\left (15-6 \sqrt {5}\right ) \tanh ^{-1}\left (\frac {1}{2} \left (1+\sqrt {5}\right ) \sqrt {1+\sqrt {1+x}}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 110, normalized size = 0.93

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.47, size = 145, normalized size = 1.23 \begin {gather*} \frac {4}{3} \, {\left (\sqrt {x + 1} + 1\right )}^{\frac {3}{2}} + \frac {4}{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 {4}{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} - 2 \, \log \left (\sqrt {x + 1} + \sqrt {\sqrt {x + 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/2)*(1+(1+x)^(1/2))^(1/2)/(x-(1+x)^(1/2)),x, algorithm="maxima")

[Out]

4/3*(sqrt(x + 1) + 1)^(3/2) + 4/5*sqrt(5)*log(-(sqrt(5) - 2*sqrt(sqrt(x + 1) + 1) + 1)/(sqrt(5) + 2*sqrt(sqrt(
x + 1) + 1) - 1)) + 4/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) - 2*log(sqrt(x + 1) + sqrt(sqrt(x + 1) + 1)) + 2*log(sqrt(x + 1) - sqrt(sqrt
(x + 1) + 1))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 243 vs. \(2 (84) = 168\).
time = 0.36, size = 243, normalized size = 2.06 \begin {gather*} \frac {4}{3} \, {\left (\sqrt {x + 1} + 4\right )} \sqrt {\sqrt {x + 1} + 1} + \frac {4}{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 {4}{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 ) + 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/2)*(1+(1+x)^(1/2))^(1/2)/(x-(1+x)^(1/2)),x, algorithm="fricas")

[Out]

4/3*(sqrt(x + 1) + 4)*sqrt(sqrt(x + 1) + 1) + 4/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/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*lo
g(sqrt(x + 1) + sqrt(sqrt(x + 1) + 1)) + 2*log(sqrt(x + 1) - sqrt(sqrt(x + 1) + 1))

________________________________________________________________________________________

Sympy [A]
time = 7.58, size = 279, normalized size = 2.36 \begin {gather*} \frac {4 \left (\sqrt {x + 1} + 1\right )^{\frac {3}{2}}}{3} + 4 \sqrt {\sqrt {x + 1} + 1} + 16 \left (\begin {cases} - \frac {\sqrt {5} \operatorname {acoth}{\left (\frac {2 \sqrt {5} \left (\sqrt {\sqrt {x + 1} + 1} - \frac {1}{2}\right )}{5} \right )}}{10} & \text {for}\: \left (\sqrt {\sqrt {x + 1} + 1} - \frac {1}{2}\right )^{2} > \frac {5}{4} \\- \frac {\sqrt {5} \operatorname {atanh}{\left (\frac {2 \sqrt {5} \left (\sqrt {\sqrt {x + 1} + 1} - \frac {1}{2}\right )}{5} \right )}}{10} & \text {for}\: \left (\sqrt {\sqrt {x + 1} + 1} - \frac {1}{2}\right )^{2} < \frac {5}{4} \end {cases}\right ) + 16 \left (\begin {cases} - \frac {\sqrt {5} \operatorname {acoth}{\left (\frac {2 \sqrt {5} \left (\sqrt {\sqrt {x + 1} + 1} + \frac {1}{2}\right )}{5} \right )}}{10} & \text {for}\: \left (\sqrt {\sqrt {x + 1} + 1} + \frac {1}{2}\right )^{2} > \frac {5}{4} \\- \frac {\sqrt {5} \operatorname {atanh}{\left (\frac {2 \sqrt {5} \left (\sqrt {\sqrt {x + 1} + 1} + \frac {1}{2}\right )}{5} \right )}}{10} & \text {for}\: \left (\sqrt {\sqrt {x + 1} + 1} + \frac {1}{2}\right )^{2} < \frac {5}{4} \end {cases}\right ) + 2 \log {\left (\sqrt {x + 1} - \sqrt {\sqrt {x + 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/2)*(1+(1+x)**(1/2))**(1/2)/(x-(1+x)**(1/2)),x)

[Out]

4*(sqrt(x + 1) + 1)**(3/2)/3 + 4*sqrt(sqrt(x + 1) + 1) + 16*Piecewise((-sqrt(5)*acoth(2*sqrt(5)*(sqrt(sqrt(x +
 1) + 1) - 1/2)/5)/10, (sqrt(sqrt(x + 1) + 1) - 1/2)**2 > 5/4), (-sqrt(5)*atanh(2*sqrt(5)*(sqrt(sqrt(x + 1) +
1) - 1/2)/5)/10, (sqrt(sqrt(x + 1) + 1) - 1/2)**2 < 5/4)) + 16*Piecewise((-sqrt(5)*acoth(2*sqrt(5)*(sqrt(sqrt(
x + 1) + 1) + 1/2)/5)/10, (sqrt(sqrt(x + 1) + 1) + 1/2)**2 > 5/4), (-sqrt(5)*atanh(2*sqrt(5)*(sqrt(sqrt(x + 1)
 + 1) + 1/2)/5)/10, (sqrt(sqrt(x + 1) + 1) + 1/2)**2 < 5/4)) + 2*log(sqrt(x + 1) - sqrt(sqrt(x + 1) + 1)) - 2*
log(sqrt(x + 1) + sqrt(sqrt(x + 1) + 1))

________________________________________________________________________________________

Giac [A]
time = 0.55, size = 149, normalized size = 1.26 \begin {gather*} \frac {4}{3} \, {\left (\sqrt {x + 1} + 1\right )}^{\frac {3}{2}} + \frac {4}{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 {4}{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} - 2 \, \log \left (\sqrt {x + 1} + \sqrt {\sqrt {x + 1} + 1}\right ) + 2 \, \log \left ({\left | \sqrt {x + 1} - \sqrt {\sqrt {x + 1} + 1} \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4/3*(sqrt(x + 1) + 1)^(3/2) + 4/5*sqrt(5)*log(-(sqrt(5) - 2*sqrt(sqrt(x + 1) + 1) - 1)/(sqrt(5) + 2*sqrt(sqrt(
x + 1) + 1) + 1)) + 4/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) - 2*log(sqrt(x + 1) + sqrt(sqrt(x + 1) + 1)) + 2*log(abs(sqrt(x + 1) -
 sqrt(sqrt(x + 1) + 1)))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________