Integrand size = 28, antiderivative size = 365 \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{\sqrt {1+x} \left (1+x^2\right )} \, dx=-\frac {i \arctan \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 {\frac {1-i}{i+\sqrt {1-i}}}}+\frac {i \arctan \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 {-\frac {1+i}{i-\sqrt {1+i}}}}+\frac {i \text {arctanh}\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 {-\frac {1-i}{i-\sqrt {1-i}}}}-\frac {i \text {arctanh}\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 {\frac {1+i}{i+\sqrt {1+i}}}} \]
[Out]
Time = 0.65 (sec) , antiderivative size = 365, normalized size of antiderivative = 1.00, number of steps used = 20, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {6873, 6860, 1004, 635, 212, 1047, 738, 210} \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{\sqrt {1+x} \left (1+x^2\right )} \, dx=-\frac {i \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 \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 \text {arctanh}\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 \text {arctanh}\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}}}} \]
[In]
[Out]
Rule 210
Rule 212
Rule 635
Rule 738
Rule 1004
Rule 1047
Rule 6860
Rule 6873
Rubi steps \begin{align*} \text {integral}& = 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}} \arctan \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}} \arctan \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}} \text {arctanh}\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}} \text {arctanh}\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*}
Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
Time = 0.26 (sec) , antiderivative size = 217, normalized size of antiderivative = 0.59 \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{\sqrt {1+x} \left (1+x^2\right )} \, dx=-\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 ] \]
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.16 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.30
method | result | size |
derivativedivides | \(-\frac {\left (\munderset {\textit {\_R} =\operatorname {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} =\operatorname {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\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 5235 vs. \(2 (201) = 402\).
Time = 5.92 (sec) , antiderivative size = 5235, normalized size of antiderivative = 14.34 \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{\sqrt {1+x} \left (1+x^2\right )} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \frac {\sqrt {x+\sqrt {1+x}}}{\sqrt {1+x} \left (1+x^2\right )} \, dx=\int \frac {\sqrt {x + \sqrt {x + 1}}}{\sqrt {x + 1} \left (x^{2} + 1\right )}\, dx \]
[In]
[Out]
\[ \int \frac {\sqrt {x+\sqrt {1+x}}}{\sqrt {1+x} \left (1+x^2\right )} \, dx=\int { \frac {\sqrt {x + \sqrt {x + 1}}}{{\left (x^{2} + 1\right )} \sqrt {x + 1}} \,d x } \]
[In]
[Out]
Exception generated. \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{\sqrt {1+x} \left (1+x^2\right )} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
Timed out. \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{\sqrt {1+x} \left (1+x^2\right )} \, dx=\int \frac {\sqrt {x+\sqrt {x+1}}}{\left (x^2+1\right )\,\sqrt {x+1}} \,d x \]
[In]
[Out]