\(\int \frac {\sqrt {x+\sqrt {1+x}}}{1+x^2} \, dx\) [14]

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

Optimal result

Integrand size = 21, antiderivative size = 337 \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{1+x^2} \, dx=\frac {1}{2} 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 )-\frac {1}{2} 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 )+\frac {1}{2} 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 )-\frac {1}{2} 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 ) \] Output:

1/2*I*arctanh(1/2*(2-(1-I)^(1/2)-(1+2*(1-I)^(1/2))*(1+x)^(1/2))/(-I+(1-I)^ 
(1/2))^(1/2)/(x+(1+x)^(1/2))^(1/2))*(-I+(1-I)^(1/2))^(1/2)+1/2*I*arctan(1/ 
2*(2+(1-I)^(1/2)-(1-2*(1-I)^(1/2))*(1+x)^(1/2))/(I+(1-I)^(1/2))^(1/2)/(x+( 
1+x)^(1/2))^(1/2))*(I+(1-I)^(1/2))^(1/2)-1/2*I*arctan(1/2*(2+(1+I)^(1/2)-( 
1-2*(1+I)^(1/2))*(1+x)^(1/2))/(-I+(1+I)^(1/2))^(1/2)/(x+(1+x)^(1/2))^(1/2) 
)*(-I+(1+I)^(1/2))^(1/2)-1/2*I*arctanh(1/2*(2-(1+I)^(1/2)-(1+2*(1+I)^(1/2) 
)*(1+x)^(1/2))/(I+(1+I)^(1/2))^(1/2)/(x+(1+x)^(1/2))^(1/2))*(I+(1+I)^(1/2) 
)^(1/2)
 

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.

Time = 0.14 (sec) , antiderivative size = 212, normalized size of antiderivative = 0.63 \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{1+x^2} \, 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 )+2 \log \left (-\sqrt {1+x}+\sqrt {x+\sqrt {1+x}}-\text {$\#$1}\right ) \text {$\#$1}-2 \log \left (-\sqrt {1+x}+\sqrt {x+\sqrt {1+x}}-\text {$\#$1}\right ) \text {$\#$1}^5+\log \left (-\sqrt {1+x}+\sqrt {x+\sqrt {1+x}}-\text {$\#$1}\right ) \text {$\#$1}^6}{-1+10 \text {$\#$1}-18 \text {$\#$1}^2+10 \text {$\#$1}^3+5 \text {$\#$1}^4-3 \text {$\#$1}^5+\text {$\#$1}^7}\&\right ] \] Input:

Integrate[Sqrt[x + Sqrt[1 + x]]/(1 + x^2),x]
 

Output:

RootSum[1 - 8*#1 + 40*#1^2 - 48*#1^3 + 20*#1^4 + 8*#1^5 - 4*#1^6 + #1^8 & 
, (Log[-Sqrt[1 + x] + Sqrt[x + Sqrt[1 + x]] - #1] + 2*Log[-Sqrt[1 + x] + S 
qrt[x + Sqrt[1 + x]] - #1]*#1 - 2*Log[-Sqrt[1 + x] + Sqrt[x + Sqrt[1 + x]] 
 - #1]*#1^5 + Log[-Sqrt[1 + x] + Sqrt[x + Sqrt[1 + x]] - #1]*#1^6)/(-1 + 1 
0*#1 - 18*#1^2 + 10*#1^3 + 5*#1^4 - 3*#1^5 + #1^7) & ]/2
 

Rubi [A] (verified)

Time = 0.84 (sec) , antiderivative size = 339, normalized size of antiderivative = 1.01, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {7267, 7292, 7279, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sqrt {x+\sqrt {x+1}}}{x^2+1} \, dx\)

\(\Big \downarrow \) 7267

\(\displaystyle 2 \int \frac {\sqrt {x+1} \sqrt {x+\sqrt {x+1}}}{x^2+1}d\sqrt {x+1}\)

\(\Big \downarrow \) 7292

\(\displaystyle 2 \int \frac {\sqrt {x+1} \sqrt {x+\sqrt {x+1}}}{(x+1)^2-2 (x+1)+2}d\sqrt {x+1}\)

\(\Big \downarrow \) 7279

\(\displaystyle 2 \int \left (\frac {i \sqrt {x+1} \sqrt {x+\sqrt {x+1}}}{(2+2 i)-2 (x+1)}+\frac {i \sqrt {x+1} \sqrt {x+\sqrt {x+1}}}{2 (x+1)-(2-2 i)}\right )d\sqrt {x+1}\)

\(\Big \downarrow \) 2009

\(\displaystyle 2 \left (\frac {1}{4} i \sqrt {i+\sqrt {1-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 )-\frac {1}{4} i \sqrt {\sqrt {1+i}-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 )+\frac {1}{4} i \sqrt {\sqrt {1-i}-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 )-\frac {1}{4} i \sqrt {i+\sqrt {1+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 )\right )\)

Input:

Int[Sqrt[x + Sqrt[1 + x]]/(1 + x^2),x]
 

Output:

2*((I/4)*Sqrt[I + Sqrt[1 - I]]*ArcTan[(2 + Sqrt[1 - I] - (1 - 2*Sqrt[1 - I 
])*Sqrt[1 + x])/(2*Sqrt[I + Sqrt[1 - I]]*Sqrt[x + Sqrt[1 + x]])] - (I/4)*S 
qrt[-I + Sqrt[1 + I]]*ArcTan[(2 + Sqrt[1 + I] - (1 - 2*Sqrt[1 + I])*Sqrt[1 
 + x])/(2*Sqrt[-I + Sqrt[1 + I]]*Sqrt[x + Sqrt[1 + x]])] + (I/4)*Sqrt[-I + 
 Sqrt[1 - I]]*ArcTanh[(2 - Sqrt[1 - I] - (1 + 2*Sqrt[1 - I])*Sqrt[1 + x])/ 
(2*Sqrt[-I + Sqrt[1 - I]]*Sqrt[x + Sqrt[1 + x]])] - (I/4)*Sqrt[I + Sqrt[1 
+ I]]*ArcTanh[(2 - Sqrt[1 + I] - (1 + 2*Sqrt[1 + I])*Sqrt[1 + x])/(2*Sqrt[ 
I + Sqrt[1 + I]]*Sqrt[x + Sqrt[1 + x]])])
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 7267
Int[u_, x_Symbol] :> With[{lst = SubstForFractionalPowerOfLinear[u, x]}, Si 
mp[lst[[2]]*lst[[4]]   Subst[Int[lst[[1]], x], x, lst[[3]]^(1/lst[[2]])], x 
] /;  !FalseQ[lst] && SubstForFractionalPowerQ[u, lst[[3]], x]]
 

rule 7279
Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[ 
{v = RationalFunctionExpand[u/(a + b*x^n + c*x^(2*n)), x]}, Int[v, x] /; Su 
mQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]
 

rule 7292
Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =! 
= u]
 
Maple [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 0.12 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.31

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 (\textit {\_R}^{6}-2 \textit {\_R}^{5}+2 \textit {\_R} +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}\) \(105\)
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 (\textit {\_R}^{6}-2 \textit {\_R}^{5}+2 \textit {\_R} +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}\) \(105\)

Input:

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

Output:

1/2*sum((_R^6-2*_R^5+2*_R+1)/(_R^7-3*_R^5+5*_R^4+10*_R^3-18*_R^2+10*_R-1)* 
ln((x+(1+x)^(1/2))^(1/2)-(1+x)^(1/2)-_R),_R=RootOf(_Z^8-4*_Z^6+8*_Z^5+20*_ 
Z^4-48*_Z^3+40*_Z^2-8*_Z+1))
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 4535 vs. \(2 (185) = 370\).

Time = 3.09 (sec) , antiderivative size = 4535, normalized size of antiderivative = 13.46 \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{1+x^2} \, dx=\text {Too large to display} \] Input:

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

Output:

Too large to include
 

Sympy [F]

\[ \int \frac {\sqrt {x+\sqrt {1+x}}}{1+x^2} \, dx=\int \frac {\sqrt {x + \sqrt {x + 1}}}{x^{2} + 1}\, dx \] Input:

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

Output:

Integral(sqrt(x + sqrt(x + 1))/(x**2 + 1), x)
 

Maxima [F]

\[ \int \frac {\sqrt {x+\sqrt {1+x}}}{1+x^2} \, dx=\int { \frac {\sqrt {x + \sqrt {x + 1}}}{x^{2} + 1} \,d x } \] Input:

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

Output:

integrate(sqrt(x + sqrt(x + 1))/(x^2 + 1), x)
 

Giac [F(-2)]

Exception generated. \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{1+x^2} \, dx=\text {Exception raised: TypeError} \] Input:

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

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Precision problem choosing root in 
common_EXT, current precision 14Precision problem choosing root in common_ 
EXT, curr
 

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {x+\sqrt {1+x}}}{1+x^2} \, dx=\int \frac {\sqrt {x+\sqrt {x+1}}}{x^2+1} \,d x \] Input:

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

Output:

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

Reduce [F]

\[ \int \frac {\sqrt {x+\sqrt {1+x}}}{1+x^2} \, dx=\int \frac {\sqrt {\sqrt {x +1}+x}}{x^{2}+1}d x \] Input:

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

Output:

int(sqrt(sqrt(x + 1) + x)/(x**2 + 1),x)