\(\int \frac {b^2+a x^2}{(-b^2+a x^2) \sqrt {b+\sqrt {b^2+a x^2}}} \, dx\) [3095]

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

Optimal result

Integrand size = 42, antiderivative size = 541 \[ \int \frac {b^2+a x^2}{\left (-b^2+a x^2\right ) \sqrt {b+\sqrt {b^2+a x^2}}} \, dx=\frac {2 x}{\sqrt {b+\sqrt {b^2+a x^2}}}+\frac {2 \sqrt {2} \sqrt {b} \arctan \left (\frac {\sqrt {a} x}{\sqrt {2} \sqrt {b} \sqrt {b+\sqrt {b^2+a x^2}}}-\frac {\sqrt {b+\sqrt {b^2+a x^2}}}{\sqrt {2} \sqrt {b}}\right )}{\sqrt {a}}-\frac {2 \sqrt {1+\sqrt {2}} \sqrt {b} \arctan \left (\frac {\sqrt {a} x}{\sqrt {2 \left (-1+\sqrt {2}\right )} \sqrt {b} \sqrt {b+\sqrt {b^2+a x^2}}}-\frac {\sqrt {b+\sqrt {b^2+a x^2}}}{\sqrt {2 \left (-1+\sqrt {2}\right )} \sqrt {b}}\right )}{\sqrt {a}}-\frac {2 \sqrt {1+\sqrt {2}} \sqrt {b} \arctan \left (\frac {\sqrt {a} x}{\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {b} \sqrt {b+\sqrt {b^2+a x^2}}}-\frac {\sqrt {b+\sqrt {b^2+a x^2}}}{\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {b}}\right )}{\sqrt {a}}+\frac {2 \sqrt {-1+\sqrt {2}} \sqrt {b} \text {arctanh}\left (\frac {\sqrt {a} x}{\sqrt {2 \left (-1+\sqrt {2}\right )} \sqrt {b} \sqrt {b+\sqrt {b^2+a x^2}}}-\frac {\sqrt {b+\sqrt {b^2+a x^2}}}{\sqrt {2 \left (-1+\sqrt {2}\right )} \sqrt {b}}\right )}{\sqrt {a}}-\frac {2 \sqrt {-1+\sqrt {2}} \sqrt {b} \text {arctanh}\left (\frac {\sqrt {a} x}{\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {b} \sqrt {b+\sqrt {b^2+a x^2}}}-\frac {\sqrt {b+\sqrt {b^2+a x^2}}}{\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {b}}\right )}{\sqrt {a}} \]

[Out]

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

Rubi [F]

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

[In]

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

[Out]

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

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

Mathematica [A] (verified)

Time = 0.60 (sec) , antiderivative size = 208, normalized size of antiderivative = 0.38 \[ \int \frac {b^2+a x^2}{\left (-b^2+a x^2\right ) \sqrt {b+\sqrt {b^2+a x^2}}} \, dx=\frac {2 x}{\sqrt {b+\sqrt {b^2+a x^2}}}+\frac {\sqrt {2} \sqrt {b} \arctan \left (\frac {\sqrt {a} x}{\sqrt {2} \sqrt {b} \sqrt {b+\sqrt {b^2+a x^2}}}\right )}{\sqrt {a}}-\frac {2 \sqrt {1+\sqrt {2}} \sqrt {b} \arctan \left (\frac {\sqrt {-1+\sqrt {2}} \sqrt {a} x}{\sqrt {b} \sqrt {b+\sqrt {b^2+a x^2}}}\right )}{\sqrt {a}}-\frac {2 \sqrt {b} \text {arctanh}\left (\frac {\sqrt {1+\sqrt {2}} \sqrt {a} x}{\sqrt {b} \sqrt {b+\sqrt {b^2+a x^2}}}\right )}{\sqrt {1+\sqrt {2}} \sqrt {a}} \]

[In]

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

[Out]

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

Maple [F]

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

[In]

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

[Out]

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

Fricas [F(-1)]

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

[In]

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

[Out]

Timed out

Sympy [F]

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

[In]

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

[Out]

Integral((a*x**2 + b**2)/(sqrt(b + sqrt(a*x**2 + b**2))*(a*x**2 - b**2)), x)

Maxima [F]

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

[In]

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

[Out]

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

Giac [F]

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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