Optimal. Leaf size=196 \[ -4 \text {RootSum}\left [\text {$\#$1}^4-8 \text {$\#$1}^3+6 \text {$\#$1}^2-40 \text {$\#$1}+25\& ,\frac {\text {$\#$1}^2 \log \left (-\text {$\#$1}+2 \sqrt {x+1}-2 \sqrt {x+\sqrt {x+1}}+1\right )+2 \text {$\#$1} \log \left (-\text {$\#$1}+2 \sqrt {x+1}-2 \sqrt {x+\sqrt {x+1}}+1\right )+5 \log \left (-\text {$\#$1}+2 \sqrt {x+1}-2 \sqrt {x+\sqrt {x+1}}+1\right )}{\text {$\#$1}^3-6 \text {$\#$1}^2+3 \text {$\#$1}-10}\& \right ]+2 \sqrt {x+\sqrt {x+1}}-3 \log \left (2 \sqrt {x+1}-2 \sqrt {x+\sqrt {x+1}}+1\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.31, antiderivative size = 189, normalized size of antiderivative = 0.96, number of steps used = 10, number of rules used = 7, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {1019, 1076, 621, 206, 1032, 724, 204} \begin {gather*} 2 \sqrt {x+\sqrt {x+1}}+2 \sqrt {\frac {2}{5} \left (\sqrt {5}-2\right )} \tan ^{-1}\left (\frac {-2 \left (2-\sqrt {5}\right ) \sqrt {x+1}+\sqrt {5}+3}{4 \sqrt {\sqrt {5}-1} \sqrt {x+\sqrt {x+1}}}\right )+3 \tanh ^{-1}\left (\frac {2 \sqrt {x+1}+1}{2 \sqrt {x+\sqrt {x+1}}}\right )+2 \sqrt {\frac {2}{5} \left (2+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {-2 \left (2+\sqrt {5}\right ) \sqrt {x+1}-\sqrt {5}+3}{4 \sqrt {1+\sqrt {5}} \sqrt {x+\sqrt {x+1}}}\right ) \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
Rule 204
Rule 206
Rule 621
Rule 724
Rule 1019
Rule 1032
Rule 1076
Rubi steps
\begin {align*} \int \frac {\sqrt {x+\sqrt {1+x}}}{x-\sqrt {1+x}} \, dx &=2 \operatorname {Subst}\left (\int \frac {x \sqrt {-1+x+x^2}}{-1-x+x^2} \, dx,x,\sqrt {1+x}\right )\\ &=2 \sqrt {x+\sqrt {1+x}}-2 \operatorname {Subst}\left (\int \frac {-\frac {1}{2}-\frac {x}{2}-\frac {3 x^2}{2}}{\left (-1-x+x^2\right ) \sqrt {-1+x+x^2}} \, dx,x,\sqrt {1+x}\right )\\ &=2 \sqrt {x+\sqrt {1+x}}-2 \operatorname {Subst}\left (\int \frac {-2-2 x}{\left (-1-x+x^2\right ) \sqrt {-1+x+x^2}} \, dx,x,\sqrt {1+x}\right )+3 \operatorname {Subst}\left (\int \frac {1}{\sqrt {-1+x+x^2}} \, dx,x,\sqrt {1+x}\right )\\ &=2 \sqrt {x+\sqrt {1+x}}+6 \operatorname {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {1+2 \sqrt {1+x}}{\sqrt {x+\sqrt {1+x}}}\right )+\frac {1}{5} \left (4 \left (5-3 \sqrt {5}\right )\right ) \operatorname {Subst}\left (\int \frac {1}{\left (-1+\sqrt {5}+2 x\right ) \sqrt {-1+x+x^2}} \, dx,x,\sqrt {1+x}\right )+\frac {1}{5} \left (4 \left (5+3 \sqrt {5}\right )\right ) \operatorname {Subst}\left (\int \frac {1}{\left (-1-\sqrt {5}+2 x\right ) \sqrt {-1+x+x^2}} \, dx,x,\sqrt {1+x}\right )\\ &=2 \sqrt {x+\sqrt {1+x}}+3 \tanh ^{-1}\left (\frac {1+2 \sqrt {1+x}}{2 \sqrt {x+\sqrt {1+x}}}\right )-\frac {1}{5} \left (8 \left (5-3 \sqrt {5}\right )\right ) \operatorname {Subst}\left (\int \frac {1}{-16-8 \left (-1+\sqrt {5}\right )+4 \left (-1+\sqrt {5}\right )^2-x^2} \, dx,x,\frac {-3-\sqrt {5}-2 \left (-2+\sqrt {5}\right ) \sqrt {1+x}}{\sqrt {x+\sqrt {1+x}}}\right )-\frac {1}{5} \left (8 \left (5+3 \sqrt {5}\right )\right ) \operatorname {Subst}\left (\int \frac {1}{-16-8 \left (-1-\sqrt {5}\right )+4 \left (-1-\sqrt {5}\right )^2-x^2} \, dx,x,\frac {-3+\sqrt {5}-\left (-2+2 \left (-1-\sqrt {5}\right )\right ) \sqrt {1+x}}{\sqrt {x+\sqrt {1+x}}}\right )\\ &=2 \sqrt {x+\sqrt {1+x}}+2 \sqrt {\frac {2}{5} \left (-2+\sqrt {5}\right )} \tan ^{-1}\left (\frac {3+\sqrt {5}-2 \left (2-\sqrt {5}\right ) \sqrt {1+x}}{4 \sqrt {-1+\sqrt {5}} \sqrt {x+\sqrt {1+x}}}\right )+3 \tanh ^{-1}\left (\frac {1+2 \sqrt {1+x}}{2 \sqrt {x+\sqrt {1+x}}}\right )+2 \sqrt {\frac {2}{5} \left (2+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {3-\sqrt {5}-2 \left (2+\sqrt {5}\right ) \sqrt {1+x}}{4 \sqrt {1+\sqrt {5}} \sqrt {x+\sqrt {1+x}}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.39, size = 254, normalized size = 1.30 \begin {gather*} 2 \sqrt {x+\sqrt {x+1}}+\sqrt {\sqrt {5}-1} \tan ^{-1}\left (\frac {2 \left (\sqrt {5}-2\right ) \sqrt {x+1}+\sqrt {5}+3}{4 \sqrt {\sqrt {5}-1} \sqrt {x+\sqrt {x+1}}}\right )-\sqrt {\frac {1}{\sqrt {5}}-\frac {1}{5}} \tan ^{-1}\left (\frac {2 \left (\sqrt {5}-2\right ) \sqrt {x+1}+\sqrt {5}+3}{4 \sqrt {\sqrt {5}-1} \sqrt {x+\sqrt {x+1}}}\right )+3 \tanh ^{-1}\left (\frac {2 \sqrt {x+1}+1}{2 \sqrt {x+\sqrt {x+1}}}\right )+\frac {1}{5} \sqrt {1+\sqrt {5}} \left (5+\sqrt {5}\right ) \tanh ^{-1}\left (\frac {-2 \left (2+\sqrt {5}\right ) \sqrt {x+1}-\sqrt {5}+3}{4 \sqrt {1+\sqrt {5}} \sqrt {x+\sqrt {x+1}}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.24, size = 189, normalized size = 0.96 \begin {gather*} 2 \sqrt {x+\sqrt {1+x}}-3 \log \left (-1-2 \sqrt {1+x}+2 \sqrt {x+\sqrt {1+x}}\right )+4 \text {RootSum}\left [-1+6 \text {$\#$1}-3 \text {$\#$1}^2+2 \text {$\#$1}^3+\text {$\#$1}^4\&,\frac {2 \log \left (-\sqrt {1+x}+\sqrt {x+\sqrt {1+x}}-\text {$\#$1}\right )-2 \log \left (-\sqrt {1+x}+\sqrt {x+\sqrt {1+x}}-\text {$\#$1}\right ) \text {$\#$1}+\log \left (-\sqrt {1+x}+\sqrt {x+\sqrt {1+x}}-\text {$\#$1}\right ) \text {$\#$1}^2}{3-3 \text {$\#$1}+3 \text {$\#$1}^2+2 \text {$\#$1}^3}\&\right ] \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 11.66, size = 422, normalized size = 2.15 \begin {gather*} -\frac {4}{5} \, \sqrt {5} \sqrt {2} \sqrt {\sqrt {5} - 2} \arctan \left (\frac {\sqrt {5} \sqrt {2} {\left (11 \, x^{2} + \sqrt {5} {\left (5 \, x^{2} - 29 \, x - 33\right )} - 4 \, {\left (\sqrt {5} {\left (13 \, x + 11\right )} + 29 \, x + 33\right )} \sqrt {x + 1} - 43 \, x - 55\right )} \sqrt {\sqrt {5} - 1} \sqrt {\sqrt {5} - 2} - 4 \, \sqrt {2} {\left (\sqrt {5} {\left (34 \, x + 33\right )} - {\left (\sqrt {5} {\left (3 \, x + 11\right )} + 7 \, x - 11\right )} \sqrt {x + 1} + 76 \, x + 77\right )} \sqrt {x + \sqrt {x + 1}} \sqrt {\sqrt {5} - 2}}{4 \, {\left (x^{2} - 121 \, x - 121\right )}}\right ) - \frac {1}{5} \, \sqrt {5} \sqrt {2} \sqrt {\sqrt {5} + 2} \log \left (\frac {4 \, {\left (\sqrt {2} {\left (3 \, x^{2} + \sqrt {5} {\left (x^{2} + 3 \, x - 1\right )} + 4 \, {\left (2 \, x + \sqrt {5} - 1\right )} \sqrt {x + 1} + x + 5\right )} \sqrt {\sqrt {5} + 2} + 4 \, {\left ({\left (\sqrt {5} x + x + 2\right )} \sqrt {x + 1} + \sqrt {5} {\left (x + 1\right )} + 3 \, x + 1\right )} \sqrt {x + \sqrt {x + 1}}\right )}}{x^{2} - x - 1}\right ) + \frac {1}{5} \, \sqrt {5} \sqrt {2} \sqrt {\sqrt {5} + 2} \log \left (-\frac {4 \, {\left (\sqrt {2} {\left (3 \, x^{2} + \sqrt {5} {\left (x^{2} + 3 \, x - 1\right )} + 4 \, {\left (2 \, x + \sqrt {5} - 1\right )} \sqrt {x + 1} + x + 5\right )} \sqrt {\sqrt {5} + 2} - 4 \, {\left ({\left (\sqrt {5} x + x + 2\right )} \sqrt {x + 1} + \sqrt {5} {\left (x + 1\right )} + 3 \, x + 1\right )} \sqrt {x + \sqrt {x + 1}}\right )}}{x^{2} - x - 1}\right ) + 2 \, \sqrt {x + \sqrt {x + 1}} + \frac {3}{2} \, \log \left (4 \, \sqrt {x + \sqrt {x + 1}} {\left (2 \, \sqrt {x + 1} + 1\right )} + 8 \, x + 8 \, \sqrt {x + 1} + 5\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 2.18, size = 212, normalized size = 1.08 \begin {gather*} -8 \, \sqrt {\frac {1}{10} \, \sqrt {5} - \frac {1}{5}} {\left (\arctan \relax (2) + \arctan \left (\frac {1}{2} \, \sqrt {\sqrt {5} + 1} {\left (\sqrt {x + \sqrt {x + 1}} - \sqrt {x + 1}\right )} - \frac {1}{2} \, \sqrt {\sqrt {5} - 1}\right )\right )} + 4 \, \sqrt {\frac {1}{10} \, \sqrt {5} + \frac {1}{5}} \log \left ({\left | 4 \, \sqrt {5} \sqrt {10 \, \sqrt {5} + 20} + 20 \, \sqrt {5} + 40 \, \sqrt {x + \sqrt {x + 1}} - 40 \, \sqrt {x + 1} - 20 \, \sqrt {10 \, \sqrt {5} + 20} + 20 \right |}\right ) - 4 \, \sqrt {\frac {1}{10} \, \sqrt {5} + \frac {1}{5}} \log \left ({\left | -4 \, \sqrt {5} \sqrt {10 \, \sqrt {5} + 20} + 20 \, \sqrt {5} + 40 \, \sqrt {x + \sqrt {x + 1}} - 40 \, \sqrt {x + 1} + 20 \, \sqrt {10 \, \sqrt {5} + 20} + 20 \right |}\right ) + 2 \, \sqrt {x + \sqrt {x + 1}} - 3 \, \log \left (-2 \, \sqrt {x + \sqrt {x + 1}} + 2 \, \sqrt {x + 1} + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.16, size = 403, normalized size = 2.06
method | result | size |
derivativedivides | \(\frac {2 \left (\sqrt {5}+1\right ) \sqrt {5}\, \left (\frac {\sqrt {\left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2+\sqrt {5}\right ) \left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )+\sqrt {5}+1}}{2}+\frac {\left (2+\sqrt {5}\right ) \ln \left (\frac {1}{2}+\sqrt {1+x}+\sqrt {\left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2+\sqrt {5}\right ) \left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )+\sqrt {5}+1}\right )}{4}-\frac {\sqrt {\sqrt {5}+1}\, \arctanh \left (\frac {2 \sqrt {5}+2+\left (2+\sqrt {5}\right ) \left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )}{2 \sqrt {\sqrt {5}+1}\, \sqrt {\left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2+\sqrt {5}\right ) \left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )+\sqrt {5}+1}}\right )}{2}\right )}{5}+\frac {2 \left (\sqrt {5}-1\right ) \sqrt {5}\, \left (\frac {\sqrt {\left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2-\sqrt {5}\right ) \left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )-\sqrt {5}+1}}{2}+\frac {\left (2-\sqrt {5}\right ) \ln \left (\frac {1}{2}+\sqrt {1+x}+\sqrt {\left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2-\sqrt {5}\right ) \left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )-\sqrt {5}+1}\right )}{4}+\frac {\left (-\sqrt {5}+1\right ) \arctan \left (\frac {-2 \sqrt {5}+2+\left (2-\sqrt {5}\right ) \left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )}{2 \sqrt {\sqrt {5}-1}\, \sqrt {\left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2-\sqrt {5}\right ) \left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )-\sqrt {5}+1}}\right )}{2 \sqrt {\sqrt {5}-1}}\right )}{5}\) | \(403\) |
default | \(\frac {2 \left (\sqrt {5}+1\right ) \sqrt {5}\, \left (\frac {\sqrt {\left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2+\sqrt {5}\right ) \left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )+\sqrt {5}+1}}{2}+\frac {\left (2+\sqrt {5}\right ) \ln \left (\frac {1}{2}+\sqrt {1+x}+\sqrt {\left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2+\sqrt {5}\right ) \left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )+\sqrt {5}+1}\right )}{4}-\frac {\sqrt {\sqrt {5}+1}\, \arctanh \left (\frac {2 \sqrt {5}+2+\left (2+\sqrt {5}\right ) \left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )}{2 \sqrt {\sqrt {5}+1}\, \sqrt {\left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2+\sqrt {5}\right ) \left (\sqrt {1+x}-\frac {\sqrt {5}}{2}-\frac {1}{2}\right )+\sqrt {5}+1}}\right )}{2}\right )}{5}+\frac {2 \left (\sqrt {5}-1\right ) \sqrt {5}\, \left (\frac {\sqrt {\left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2-\sqrt {5}\right ) \left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )-\sqrt {5}+1}}{2}+\frac {\left (2-\sqrt {5}\right ) \ln \left (\frac {1}{2}+\sqrt {1+x}+\sqrt {\left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2-\sqrt {5}\right ) \left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )-\sqrt {5}+1}\right )}{4}+\frac {\left (-\sqrt {5}+1\right ) \arctan \left (\frac {-2 \sqrt {5}+2+\left (2-\sqrt {5}\right ) \left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )}{2 \sqrt {\sqrt {5}-1}\, \sqrt {\left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )^{2}+\left (2-\sqrt {5}\right ) \left (\sqrt {1+x}+\frac {\sqrt {5}}{2}-\frac {1}{2}\right )-\sqrt {5}+1}}\right )}{2 \sqrt {\sqrt {5}-1}}\right )}{5}\) | \(403\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {x + \sqrt {x + 1}}}{x - \sqrt {x + 1}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\sqrt {x+\sqrt {x+1}}}{x-\sqrt {x+1}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {x + \sqrt {x + 1}}}{x - \sqrt {x + 1}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________