Optimal. Leaf size=130 \[ \text {RootSum}\left [\text {$\#$1}^8 a-2 \text {$\#$1}^4 a-4 \text {$\#$1}^4+a\& ,\frac {\text {$\#$1}^4 \log \left (\sqrt {\sqrt {x^2+1}+x}-\text {$\#$1}\right )+\log \left (\sqrt {\sqrt {x^2+1}+x}-\text {$\#$1}\right )}{\text {$\#$1}^7 a-\text {$\#$1}^3 a-2 \text {$\#$1}^3}\& \right ]+\sqrt {\sqrt {x^2+1}+x}-\frac {1}{3 \left (\sqrt {x^2+1}+x\right )^{3/2}} \]
________________________________________________________________________________________
Rubi [B] time = 0.84, antiderivative size = 263, normalized size of antiderivative = 2.02, number of steps used = 23, number of rules used = 10, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {6725, 2117, 14, 2119, 1628, 828, 826, 1166, 208, 205} \begin {gather*} -\frac {2 \tan ^{-1}\left (\frac {\sqrt [4]{a} \sqrt {\sqrt {x^2+1}+x}}{\sqrt {1-\sqrt {a+1}}}\right )}{\sqrt [4]{a} \sqrt {1-\sqrt {a+1}}}-\frac {2 \tan ^{-1}\left (\frac {\sqrt [4]{a} \sqrt {\sqrt {x^2+1}+x}}{\sqrt {\sqrt {a+1}+1}}\right )}{\sqrt [4]{a} \sqrt {\sqrt {a+1}+1}}-\frac {2 \tanh ^{-1}\left (\frac {\sqrt [4]{a} \sqrt {\sqrt {x^2+1}+x}}{\sqrt {1-\sqrt {a+1}}}\right )}{\sqrt [4]{a} \sqrt {1-\sqrt {a+1}}}-\frac {2 \tanh ^{-1}\left (\frac {\sqrt [4]{a} \sqrt {\sqrt {x^2+1}+x}}{\sqrt {\sqrt {a+1}+1}}\right )}{\sqrt [4]{a} \sqrt {\sqrt {a+1}+1}}+\sqrt {\sqrt {x^2+1}+x}-\frac {1}{3 \left (\sqrt {x^2+1}+x\right )^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 205
Rule 208
Rule 826
Rule 828
Rule 1166
Rule 1628
Rule 2117
Rule 2119
Rule 6725
Rubi steps
\begin {align*} \int \frac {1+a x^2}{\left (-1+a x^2\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx &=\int \left (\frac {1}{\sqrt {x+\sqrt {1+x^2}}}+\frac {2}{\left (-1+a x^2\right ) \sqrt {x+\sqrt {1+x^2}}}\right ) \, dx\\ &=2 \int \frac {1}{\left (-1+a x^2\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx+\int \frac {1}{\sqrt {x+\sqrt {1+x^2}}} \, dx\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {1+x^2}{x^{5/2}} \, dx,x,x+\sqrt {1+x^2}\right )+2 \int \left (-\frac {1}{2 \left (1-\sqrt {a} x\right ) \sqrt {x+\sqrt {1+x^2}}}-\frac {1}{2 \left (1+\sqrt {a} x\right ) \sqrt {x+\sqrt {1+x^2}}}\right ) \, dx\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \left (\frac {1}{x^{5/2}}+\frac {1}{\sqrt {x}}\right ) \, dx,x,x+\sqrt {1+x^2}\right )-\int \frac {1}{\left (1-\sqrt {a} x\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx-\int \frac {1}{\left (1+\sqrt {a} x\right ) \sqrt {x+\sqrt {1+x^2}}} \, dx\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-\operatorname {Subst}\left (\int \frac {1+x^2}{x^{3/2} \left (\sqrt {a}+2 x-\sqrt {a} x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )-\operatorname {Subst}\left (\int \frac {1+x^2}{x^{3/2} \left (-\sqrt {a}+2 x+\sqrt {a} x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-\operatorname {Subst}\left (\int \left (-\frac {1}{\sqrt {a} x^{3/2}}+\frac {2 \left (\sqrt {a}+x\right )}{\sqrt {a} x^{3/2} \left (\sqrt {a}+2 x-\sqrt {a} x^2\right )}\right ) \, dx,x,x+\sqrt {1+x^2}\right )-\operatorname {Subst}\left (\int \left (\frac {1}{\sqrt {a} x^{3/2}}+\frac {2 \left (\sqrt {a}-x\right )}{\sqrt {a} x^{3/2} \left (-\sqrt {a}+2 x+\sqrt {a} x^2\right )}\right ) \, dx,x,x+\sqrt {1+x^2}\right )\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-\frac {2 \operatorname {Subst}\left (\int \frac {\sqrt {a}+x}{x^{3/2} \left (\sqrt {a}+2 x-\sqrt {a} x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )}{\sqrt {a}}-\frac {2 \operatorname {Subst}\left (\int \frac {\sqrt {a}-x}{x^{3/2} \left (-\sqrt {a}+2 x+\sqrt {a} x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )}{\sqrt {a}}\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-\frac {2 \operatorname {Subst}\left (\int \frac {-\sqrt {a}+a x}{\sqrt {x} \left (\sqrt {a}+2 x-\sqrt {a} x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )}{a}+\frac {2 \operatorname {Subst}\left (\int \frac {-\sqrt {a}-a x}{\sqrt {x} \left (-\sqrt {a}+2 x+\sqrt {a} x^2\right )} \, dx,x,x+\sqrt {1+x^2}\right )}{a}\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-\frac {4 \operatorname {Subst}\left (\int \frac {-\sqrt {a}+a x^2}{\sqrt {a}+2 x^2-\sqrt {a} x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )}{a}+\frac {4 \operatorname {Subst}\left (\int \frac {-\sqrt {a}-a x^2}{-\sqrt {a}+2 x^2+\sqrt {a} x^4} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )}{a}\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-2 \operatorname {Subst}\left (\int \frac {1}{1-\sqrt {1+a}-\sqrt {a} x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-2 \operatorname {Subst}\left (\int \frac {1}{1+\sqrt {1+a}-\sqrt {a} x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-2 \operatorname {Subst}\left (\int \frac {1}{1-\sqrt {1+a}+\sqrt {a} x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )-2 \operatorname {Subst}\left (\int \frac {1}{1+\sqrt {1+a}+\sqrt {a} x^2} \, dx,x,\sqrt {x+\sqrt {1+x^2}}\right )\\ &=-\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}-\frac {2 \tan ^{-1}\left (\frac {\sqrt [4]{a} \sqrt {x+\sqrt {1+x^2}}}{\sqrt {1-\sqrt {1+a}}}\right )}{\sqrt [4]{a} \sqrt {1-\sqrt {1+a}}}-\frac {2 \tan ^{-1}\left (\frac {\sqrt [4]{a} \sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {1+a}}}\right )}{\sqrt [4]{a} \sqrt {1+\sqrt {1+a}}}-\frac {2 \tanh ^{-1}\left (\frac {\sqrt [4]{a} \sqrt {x+\sqrt {1+x^2}}}{\sqrt {1-\sqrt {1+a}}}\right )}{\sqrt [4]{a} \sqrt {1-\sqrt {1+a}}}-\frac {2 \tanh ^{-1}\left (\frac {\sqrt [4]{a} \sqrt {x+\sqrt {1+x^2}}}{\sqrt {1+\sqrt {1+a}}}\right )}{\sqrt [4]{a} \sqrt {1+\sqrt {1+a}}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.24, size = 128, normalized size = 0.98 \begin {gather*} -\text {RootSum}\left [\text {$\#$1}^8 a-2 \text {$\#$1}^4 a-4 \text {$\#$1}^4+a\&,\frac {\text {$\#$1}^4 \log \left (\frac {1}{\sqrt {\sqrt {x^2+1}+x}}-\text {$\#$1}\right )+\log \left (\frac {1}{\sqrt {\sqrt {x^2+1}+x}}-\text {$\#$1}\right )}{\text {$\#$1}^5 a-\text {$\#$1} a-2 \text {$\#$1}}\&\right ]+\sqrt {\sqrt {x^2+1}+x}-\frac {1}{3 \left (\sqrt {x^2+1}+x\right )^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.15, size = 130, normalized size = 1.00 \begin {gather*} -\frac {1}{3 \left (x+\sqrt {1+x^2}\right )^{3/2}}+\sqrt {x+\sqrt {1+x^2}}+\text {RootSum}\left [a-4 \text {$\#$1}^4-2 a \text {$\#$1}^4+a \text {$\#$1}^8\&,\frac {\log \left (\sqrt {x+\sqrt {1+x^2}}-\text {$\#$1}\right )+\log \left (\sqrt {x+\sqrt {1+x^2}}-\text {$\#$1}\right ) \text {$\#$1}^4}{-2 \text {$\#$1}^3-a \text {$\#$1}^3+a \text {$\#$1}^7}\&\right ] \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: NotImplementedError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {a x^{2} + 1}{{\left (a x^{2} - 1\right )} \sqrt {x + \sqrt {x^{2} + 1}}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 0.03, size = 0, normalized size = 0.00 \[\int \frac {a \,x^{2}+1}{\left (a \,x^{2}-1\right ) \sqrt {x +\sqrt {x^{2}+1}}}\, dx\]
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*} \int \frac {a x^{2} + 1}{{\left (a x^{2} - 1\right )} \sqrt {x + \sqrt {x^{2} + 1}}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {a\,x^2+1}{\sqrt {x+\sqrt {x^2+1}}\,\left (a\,x^2-1\right )} \,d x \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 {a x^{2} + 1}{\sqrt {x + \sqrt {x^{2} + 1}} \left (a x^{2} - 1\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________