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

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

Optimal result

Integrand size = 28, antiderivative size = 134 \[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\frac {4 x}{3 \sqrt {1+\sqrt {1+x^2}}}+\frac {2 x \sqrt {1+x^2}}{3 \sqrt {1+\sqrt {1+x^2}}}+2 \sqrt {-1+\sqrt {2}} \arctan \left (\frac {x}{\sqrt {1+\sqrt {2}} \sqrt {1+\sqrt {1+x^2}}}\right )-2 \sqrt {1+\sqrt {2}} \text {arctanh}\left (\frac {x}{\sqrt {-1+\sqrt {2}} \sqrt {1+\sqrt {1+x^2}}}\right ) \]

[Out]

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

Rubi [F]

\[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx \]

[In]

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

[Out]

(2*x^3)/(3*(1 + Sqrt[1 + x^2])^(3/2)) + (2*x)/Sqrt[1 + Sqrt[1 + x^2]] - Defer[Int][Sqrt[1 + Sqrt[1 + x^2]]/(1
- x), x] - Defer[Int][Sqrt[1 + Sqrt[1 + x^2]]/(1 + x), x]

Rubi steps \begin{align*} \text {integral}& = \int \left (\sqrt {1+\sqrt {1+x^2}}+\frac {2 \sqrt {1+\sqrt {1+x^2}}}{-1+x^2}\right ) \, dx \\ & = 2 \int \frac {\sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx+\int \sqrt {1+\sqrt {1+x^2}} \, dx \\ & = \frac {2 x^3}{3 \left (1+\sqrt {1+x^2}\right )^{3/2}}+\frac {2 x}{\sqrt {1+\sqrt {1+x^2}}}+2 \int \left (-\frac {\sqrt {1+\sqrt {1+x^2}}}{2 (1-x)}-\frac {\sqrt {1+\sqrt {1+x^2}}}{2 (1+x)}\right ) \, dx \\ & = \frac {2 x^3}{3 \left (1+\sqrt {1+x^2}\right )^{3/2}}+\frac {2 x}{\sqrt {1+\sqrt {1+x^2}}}-\int \frac {\sqrt {1+\sqrt {1+x^2}}}{1-x} \, dx-\int \frac {\sqrt {1+\sqrt {1+x^2}}}{1+x} \, dx \\ \end{align*}

Mathematica [A] (verified)

Time = 0.37 (sec) , antiderivative size = 116, normalized size of antiderivative = 0.87 \[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\frac {2 x \left (2+\sqrt {1+x^2}\right )}{3 \sqrt {1+\sqrt {1+x^2}}}+2 \sqrt {-1+\sqrt {2}} \arctan \left (\frac {x}{\sqrt {1+\sqrt {2}} \sqrt {1+\sqrt {1+x^2}}}\right )-2 \sqrt {1+\sqrt {2}} \text {arctanh}\left (\frac {\sqrt {1+\sqrt {2}} x}{\sqrt {1+\sqrt {1+x^2}}}\right ) \]

[In]

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

[Out]

(2*x*(2 + Sqrt[1 + x^2]))/(3*Sqrt[1 + Sqrt[1 + x^2]]) + 2*Sqrt[-1 + Sqrt[2]]*ArcTan[x/(Sqrt[1 + Sqrt[2]]*Sqrt[
1 + Sqrt[1 + x^2]])] - 2*Sqrt[1 + Sqrt[2]]*ArcTanh[(Sqrt[1 + Sqrt[2]]*x)/Sqrt[1 + Sqrt[1 + x^2]]]

Maple [F]

\[\int \frac {\left (x^{2}+1\right ) \sqrt {1+\sqrt {x^{2}+1}}}{x^{2}-1}d x\]

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 536 vs. \(2 (96) = 192\).

Time = 2.61 (sec) , antiderivative size = 536, normalized size of antiderivative = 4.00 \[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\frac {3 \, x \sqrt {-4 \, \sqrt {2} + 4} \log \left (-\frac {2 \, \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} x + 193 \, x\right )} \sqrt {-4 \, \sqrt {2} + 4} - {\left (71 \, x^{3} + \sqrt {2} {\left (61 \, x^{3} + 325 \, x\right )} + 457 \, x\right )} \sqrt {-4 \, \sqrt {2} + 4} + 4 \, {\left (71 \, x^{2} + \sqrt {2} {\left (61 \, x^{2} + 132\right )} - \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} + 193\right )} + 193\right )} \sqrt {\sqrt {x^{2} + 1} + 1}}{x^{3} - x}\right ) - 3 \, x \sqrt {-4 \, \sqrt {2} + 4} \log \left (\frac {2 \, \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} x + 193 \, x\right )} \sqrt {-4 \, \sqrt {2} + 4} - {\left (71 \, x^{3} + \sqrt {2} {\left (61 \, x^{3} + 325 \, x\right )} + 457 \, x\right )} \sqrt {-4 \, \sqrt {2} + 4} - 4 \, {\left (71 \, x^{2} + \sqrt {2} {\left (61 \, x^{2} + 132\right )} - \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} + 193\right )} + 193\right )} \sqrt {\sqrt {x^{2} + 1} + 1}}{x^{3} - x}\right ) - 6 \, x \sqrt {\sqrt {2} + 1} \log \left (-\frac {2 \, {\left ({\left (71 \, x^{3} - \sqrt {2} {\left (61 \, x^{3} + 325 \, x\right )} + 2 \, \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} x - 193 \, x\right )} + 457 \, x\right )} \sqrt {\sqrt {2} + 1} + 2 \, {\left (71 \, x^{2} - \sqrt {2} {\left (61 \, x^{2} + 132\right )} + \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} - 193\right )} + 193\right )} \sqrt {\sqrt {x^{2} + 1} + 1}\right )}}{x^{3} - x}\right ) + 6 \, x \sqrt {\sqrt {2} + 1} \log \left (\frac {2 \, {\left ({\left (71 \, x^{3} - \sqrt {2} {\left (61 \, x^{3} + 325 \, x\right )} + 2 \, \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} x - 193 \, x\right )} + 457 \, x\right )} \sqrt {\sqrt {2} + 1} - 2 \, {\left (71 \, x^{2} - \sqrt {2} {\left (61 \, x^{2} + 132\right )} + \sqrt {x^{2} + 1} {\left (132 \, \sqrt {2} - 193\right )} + 193\right )} \sqrt {\sqrt {x^{2} + 1} + 1}\right )}}{x^{3} - x}\right ) + 8 \, {\left (x^{2} + \sqrt {x^{2} + 1} - 1\right )} \sqrt {\sqrt {x^{2} + 1} + 1}}{12 \, x} \]

[In]

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

[Out]

1/12*(3*x*sqrt(-4*sqrt(2) + 4)*log(-(2*sqrt(x^2 + 1)*(132*sqrt(2)*x + 193*x)*sqrt(-4*sqrt(2) + 4) - (71*x^3 +
sqrt(2)*(61*x^3 + 325*x) + 457*x)*sqrt(-4*sqrt(2) + 4) + 4*(71*x^2 + sqrt(2)*(61*x^2 + 132) - sqrt(x^2 + 1)*(1
32*sqrt(2) + 193) + 193)*sqrt(sqrt(x^2 + 1) + 1))/(x^3 - x)) - 3*x*sqrt(-4*sqrt(2) + 4)*log((2*sqrt(x^2 + 1)*(
132*sqrt(2)*x + 193*x)*sqrt(-4*sqrt(2) + 4) - (71*x^3 + sqrt(2)*(61*x^3 + 325*x) + 457*x)*sqrt(-4*sqrt(2) + 4)
 - 4*(71*x^2 + sqrt(2)*(61*x^2 + 132) - sqrt(x^2 + 1)*(132*sqrt(2) + 193) + 193)*sqrt(sqrt(x^2 + 1) + 1))/(x^3
 - x)) - 6*x*sqrt(sqrt(2) + 1)*log(-2*((71*x^3 - sqrt(2)*(61*x^3 + 325*x) + 2*sqrt(x^2 + 1)*(132*sqrt(2)*x - 1
93*x) + 457*x)*sqrt(sqrt(2) + 1) + 2*(71*x^2 - sqrt(2)*(61*x^2 + 132) + sqrt(x^2 + 1)*(132*sqrt(2) - 193) + 19
3)*sqrt(sqrt(x^2 + 1) + 1))/(x^3 - x)) + 6*x*sqrt(sqrt(2) + 1)*log(2*((71*x^3 - sqrt(2)*(61*x^3 + 325*x) + 2*s
qrt(x^2 + 1)*(132*sqrt(2)*x - 193*x) + 457*x)*sqrt(sqrt(2) + 1) - 2*(71*x^2 - sqrt(2)*(61*x^2 + 132) + sqrt(x^
2 + 1)*(132*sqrt(2) - 193) + 193)*sqrt(sqrt(x^2 + 1) + 1))/(x^3 - x)) + 8*(x^2 + sqrt(x^2 + 1) - 1)*sqrt(sqrt(
x^2 + 1) + 1))/x

Sympy [F]

\[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\int \frac {\left (x^{2} + 1\right ) \sqrt {\sqrt {x^{2} + 1} + 1}}{\left (x - 1\right ) \left (x + 1\right )}\, dx \]

[In]

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

[Out]

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

Maxima [F]

\[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\int { \frac {{\left (x^{2} + 1\right )} \sqrt {\sqrt {x^{2} + 1} + 1}}{x^{2} - 1} \,d x } \]

[In]

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

[Out]

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

Giac [F]

\[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\int { \frac {{\left (x^{2} + 1\right )} \sqrt {\sqrt {x^{2} + 1} + 1}}{x^{2} - 1} \,d x } \]

[In]

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

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \frac {\left (1+x^2\right ) \sqrt {1+\sqrt {1+x^2}}}{-1+x^2} \, dx=\int \frac {\left (x^2+1\right )\,\sqrt {\sqrt {x^2+1}+1}}{x^2-1} \,d x \]

[In]

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

[Out]

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