Optimal. Leaf size=209 \[ -\frac {1}{2} \text {RootSum}\left [1-8 \text {$\#$1}+40 \text {$\#$1}^2-48 \text {$\#$1}^3+20 \text {$\#$1}^4+8 \text {$\#$1}^5-4 \text {$\#$1}^6+\text {$\#$1}^8\& ,\frac {-\log \left (\sqrt {1+x}-\sqrt {x+\sqrt {1+x}}+\text {$\#$1}\right )+5 \log \left (\sqrt {1+x}-\sqrt {x+\sqrt {1+x}}+\text {$\#$1}\right ) \text {$\#$1}^2-5 \log \left (\sqrt {1+x}-\sqrt {x+\sqrt {1+x}}+\text {$\#$1}\right ) \text {$\#$1}^4+2 \log \left (\sqrt {1+x}-\sqrt {x+\sqrt {1+x}}+\text {$\#$1}\right ) \text {$\#$1}^5}{-1+10 \text {$\#$1}-18 \text {$\#$1}^2+10 \text {$\#$1}^3+5 \text {$\#$1}^4-3 \text {$\#$1}^5+\text {$\#$1}^7}\& \right ] \]
[Out]
________________________________________________________________________________________
Rubi [C] Result contains complex when optimal does not.
time = 0.67, antiderivative size = 365, normalized size of antiderivative = 1.75, number of steps
used = 20, number of rules used = 8, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {6873, 6860,
1004, 635, 212, 1047, 738, 210} \begin {gather*} -\frac {i \text {ArcTan}\left (\frac {-\left (\left (1-2 \sqrt {1-i}\right ) \sqrt {x+1}\right )+\sqrt {1-i}+2}{2 \sqrt {i+\sqrt {1-i}} \sqrt {x+\sqrt {x+1}}}\right )}{2 \sqrt {\frac {1-i}{i+\sqrt {1-i}}}}+\frac {i \text {ArcTan}\left (\frac {-\left (\left (1-2 \sqrt {1+i}\right ) \sqrt {x+1}\right )+\sqrt {1+i}+2}{2 \sqrt {\sqrt {1+i}-i} \sqrt {x+\sqrt {x+1}}}\right )}{2 \sqrt {-\frac {1+i}{i-\sqrt {1+i}}}}+\frac {i \tanh ^{-1}\left (\frac {-\left (\left (1+2 \sqrt {1-i}\right ) \sqrt {x+1}\right )-\sqrt {1-i}+2}{2 \sqrt {\sqrt {1-i}-i} \sqrt {x+\sqrt {x+1}}}\right )}{2 \sqrt {-\frac {1-i}{i-\sqrt {1-i}}}}-\frac {i \tanh ^{-1}\left (\frac {-\left (\left (1+2 \sqrt {1+i}\right ) \sqrt {x+1}\right )-\sqrt {1+i}+2}{2 \sqrt {i+\sqrt {1+i}} \sqrt {x+\sqrt {x+1}}}\right )}{2 \sqrt {\frac {1+i}{i+\sqrt {1+i}}}} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
Rule 210
Rule 212
Rule 635
Rule 738
Rule 1004
Rule 1047
Rule 6860
Rule 6873
Rubi steps
\begin {align*} \int \frac {\sqrt {x+\sqrt {1+x}}}{\sqrt {1+x} \left (1+x^2\right )} \, dx &=2 \text {Subst}\left (\int \frac {\sqrt {-1+x+x^2}}{1+\left (-1+x^2\right )^2} \, dx,x,\sqrt {1+x}\right )\\ &=2 \text {Subst}\left (\int \frac {\sqrt {-1+x+x^2}}{2-2 x^2+x^4} \, dx,x,\sqrt {1+x}\right )\\ &=2 \text {Subst}\left (\int \left (\frac {i \sqrt {-1+x+x^2}}{(2+2 i)-2 x^2}+\frac {i \sqrt {-1+x+x^2}}{(-2+2 i)+2 x^2}\right ) \, dx,x,\sqrt {1+x}\right )\\ &=2 i \text {Subst}\left (\int \frac {\sqrt {-1+x+x^2}}{(2+2 i)-2 x^2} \, dx,x,\sqrt {1+x}\right )+2 i \text {Subst}\left (\int \frac {\sqrt {-1+x+x^2}}{(-2+2 i)+2 x^2} \, dx,x,\sqrt {1+x}\right )\\ &=i \text {Subst}\left (\int \frac {2 i+2 x}{\left ((2+2 i)-2 x^2\right ) \sqrt {-1+x+x^2}} \, dx,x,\sqrt {1+x}\right )-i \text {Subst}\left (\int \frac {2 i-2 x}{\sqrt {-1+x+x^2} \left ((-2+2 i)+2 x^2\right )} \, dx,x,\sqrt {1+x}\right )\\ &=-\left (\frac {1}{2} \left (i \left (-2-(1-i)^{3/2}\right )\right ) \text {Subst}\left (\int \frac {1}{\left (-2 \sqrt {1-i}+2 x\right ) \sqrt {-1+x+x^2}} \, dx,x,\sqrt {1+x}\right )\right )-\frac {1}{2} \left (i \left (-2+(1-i)^{3/2}\right )\right ) \text {Subst}\left (\int \frac {1}{\left (2 \sqrt {1-i}+2 x\right ) \sqrt {-1+x+x^2}} \, dx,x,\sqrt {1+x}\right )+\frac {1}{2} \left (i \left (2-(1+i)^{3/2}\right )\right ) \text {Subst}\left (\int \frac {1}{\left (-2 \sqrt {1+i}-2 x\right ) \sqrt {-1+x+x^2}} \, dx,x,\sqrt {1+x}\right )+\frac {1}{2} \left (i \left (2+(1+i)^{3/2}\right )\right ) \text {Subst}\left (\int \frac {1}{\left (2 \sqrt {1+i}-2 x\right ) \sqrt {-1+x+x^2}} \, dx,x,\sqrt {1+x}\right )\\ &=\left (i \left (-2-(1-i)^{3/2}\right )\right ) \text {Subst}\left (\int \frac {1}{-16 i+16 \sqrt {1-i}-x^2} \, dx,x,\frac {-4+2 \sqrt {1-i}-\left (-2-4 \sqrt {1-i}\right ) \sqrt {1+x}}{\sqrt {x+\sqrt {1+x}}}\right )+\left (i \left (-2+(1-i)^{3/2}\right )\right ) \text {Subst}\left (\int \frac {1}{-16 i-16 \sqrt {1-i}-x^2} \, dx,x,\frac {-4-2 \sqrt {1-i}-\left (-2+4 \sqrt {1-i}\right ) \sqrt {1+x}}{\sqrt {x+\sqrt {1+x}}}\right )-\left (i \left (2-(1+i)^{3/2}\right )\right ) \text {Subst}\left (\int \frac {1}{16 i-16 \sqrt {1+i}-x^2} \, dx,x,\frac {4+2 \sqrt {1+i}-\left (2-4 \sqrt {1+i}\right ) \sqrt {1+x}}{\sqrt {x+\sqrt {1+x}}}\right )-\left (i \left (2+(1+i)^{3/2}\right )\right ) \text {Subst}\left (\int \frac {1}{16 i+16 \sqrt {1+i}-x^2} \, dx,x,\frac {4-2 \sqrt {1+i}-\left (2+4 \sqrt {1+i}\right ) \sqrt {1+x}}{\sqrt {x+\sqrt {1+x}}}\right )\\ &=-\frac {i \sqrt {i+\sqrt {1-i}} \tan ^{-1}\left (\frac {2+\sqrt {1-i}-\left (1-2 \sqrt {1-i}\right ) \sqrt {1+x}}{2 \sqrt {i+\sqrt {1-i}} \sqrt {x+\sqrt {1+x}}}\right )}{2 \sqrt {1-i}}+\frac {1}{4} (1+i)^{3/2} \sqrt {-i+\sqrt {1+i}} \tan ^{-1}\left (\frac {2+\sqrt {1+i}-\left (1-2 \sqrt {1+i}\right ) \sqrt {1+x}}{2 \sqrt {-i+\sqrt {1+i}} \sqrt {x+\sqrt {1+x}}}\right )-\frac {1}{4} (1-i)^{3/2} \sqrt {-i+\sqrt {1-i}} \tanh ^{-1}\left (\frac {2-\sqrt {1-i}-\left (1+2 \sqrt {1-i}\right ) \sqrt {1+x}}{2 \sqrt {-i+\sqrt {1-i}} \sqrt {x+\sqrt {1+x}}}\right )-\frac {i \sqrt {i+\sqrt {1+i}} \tanh ^{-1}\left (\frac {2-\sqrt {1+i}-\left (1+2 \sqrt {1+i}\right ) \sqrt {1+x}}{2 \sqrt {i+\sqrt {1+i}} \sqrt {x+\sqrt {1+x}}}\right )}{2 \sqrt {1+i}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.18, size = 217, normalized size = 1.04 \begin {gather*} -\frac {1}{2} \text {RootSum}\left [1-8 \text {$\#$1}+40 \text {$\#$1}^2-48 \text {$\#$1}^3+20 \text {$\#$1}^4+8 \text {$\#$1}^5-4 \text {$\#$1}^6+\text {$\#$1}^8\&,\frac {-\log \left (-\sqrt {1+x}+\sqrt {x+\sqrt {1+x}}-\text {$\#$1}\right )+5 \log \left (-\sqrt {1+x}+\sqrt {x+\sqrt {1+x}}-\text {$\#$1}\right ) \text {$\#$1}^2-5 \log \left (-\sqrt {1+x}+\sqrt {x+\sqrt {1+x}}-\text {$\#$1}\right ) \text {$\#$1}^4+2 \log \left (-\sqrt {1+x}+\sqrt {x+\sqrt {1+x}}-\text {$\#$1}\right ) \text {$\#$1}^5}{-1+10 \text {$\#$1}-18 \text {$\#$1}^2+10 \text {$\#$1}^3+5 \text {$\#$1}^4-3 \text {$\#$1}^5+\text {$\#$1}^7}\&\right ] \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
1.
time = 0.11, size = 109, normalized size = 0.52
method | result | size |
derivativedivides | \(-\frac {\left (\munderset {\textit {\_R} =\RootOf \left (\textit {\_Z}^{8}-4 \textit {\_Z}^{6}+8 \textit {\_Z}^{5}+20 \textit {\_Z}^{4}-48 \textit {\_Z}^{3}+40 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )}{\sum }\frac {\left (2 \textit {\_R}^{5}-5 \textit {\_R}^{4}+5 \textit {\_R}^{2}-1\right ) \ln \left (\sqrt {x +\sqrt {1+x}}-\sqrt {1+x}-\textit {\_R} \right )}{\textit {\_R}^{7}-3 \textit {\_R}^{5}+5 \textit {\_R}^{4}+10 \textit {\_R}^{3}-18 \textit {\_R}^{2}+10 \textit {\_R} -1}\right )}{2}\) | \(109\) |
default | \(-\frac {\left (\munderset {\textit {\_R} =\RootOf \left (\textit {\_Z}^{8}-4 \textit {\_Z}^{6}+8 \textit {\_Z}^{5}+20 \textit {\_Z}^{4}-48 \textit {\_Z}^{3}+40 \textit {\_Z}^{2}-8 \textit {\_Z} +1\right )}{\sum }\frac {\left (2 \textit {\_R}^{5}-5 \textit {\_R}^{4}+5 \textit {\_R}^{2}-1\right ) \ln \left (\sqrt {x +\sqrt {1+x}}-\sqrt {1+x}-\textit {\_R} \right )}{\textit {\_R}^{7}-3 \textit {\_R}^{5}+5 \textit {\_R}^{4}+10 \textit {\_R}^{3}-18 \textit {\_R}^{2}+10 \textit {\_R} -1}\right )}{2}\) | \(109\) |
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*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 3 vs. order
1.
time = 6.97, size = 5235, normalized size = 25.05 \begin {gather*} \text {Too large to display} \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}}}{\sqrt {x + 1} \left (x^{2} + 1\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {\sqrt {x+\sqrt {x+1}}}{\left (x^2+1\right )\,\sqrt {x+1}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________