Optimal. Leaf size=108 \[ -\frac{a^3 \left (\sqrt{a+x^2}+x\right )^{n-3}}{8 (3-n)}-\frac{3 a^2 \left (\sqrt{a+x^2}+x\right )^{n-1}}{8 (1-n)}+\frac{3 a \left (\sqrt{a+x^2}+x\right )^{n+1}}{8 (n+1)}+\frac{\left (\sqrt{a+x^2}+x\right )^{n+3}}{8 (n+3)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0626827, antiderivative size = 108, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {2122, 270} \[ -\frac{a^3 \left (\sqrt{a+x^2}+x\right )^{n-3}}{8 (3-n)}-\frac{3 a^2 \left (\sqrt{a+x^2}+x\right )^{n-1}}{8 (1-n)}+\frac{3 a \left (\sqrt{a+x^2}+x\right )^{n+1}}{8 (n+1)}+\frac{\left (\sqrt{a+x^2}+x\right )^{n+3}}{8 (n+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2122
Rule 270
Rubi steps
\begin{align*} \int \left (a+x^2\right ) \left (x+\sqrt{a+x^2}\right )^n \, dx &=\frac{1}{8} \operatorname{Subst}\left (\int x^{-4+n} \left (a+x^2\right )^3 \, dx,x,x+\sqrt{a+x^2}\right )\\ &=\frac{1}{8} \operatorname{Subst}\left (\int \left (a^3 x^{-4+n}+3 a^2 x^{-2+n}+3 a x^n+x^{2+n}\right ) \, dx,x,x+\sqrt{a+x^2}\right )\\ &=-\frac{a^3 \left (x+\sqrt{a+x^2}\right )^{-3+n}}{8 (3-n)}-\frac{3 a^2 \left (x+\sqrt{a+x^2}\right )^{-1+n}}{8 (1-n)}+\frac{3 a \left (x+\sqrt{a+x^2}\right )^{1+n}}{8 (1+n)}+\frac{\left (x+\sqrt{a+x^2}\right )^{3+n}}{8 (3+n)}\\ \end{align*}
Mathematica [A] time = 0.12373, size = 92, normalized size = 0.85 \[ \frac{1}{8} \left (\sqrt{a+x^2}+x\right )^{n-3} \left (\frac{3 a^2 \left (\sqrt{a+x^2}+x\right )^2}{n-1}+\frac{a^3}{n-3}+\frac{\left (\sqrt{a+x^2}+x\right )^6}{n+3}+\frac{3 a \left (\sqrt{a+x^2}+x\right )^4}{n+1}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.01, size = 167, normalized size = 1.6 \begin{align*}{\frac{{2}^{n}{x}^{3+n}}{3+n}{\mbox{$_3$F$_2$}(-{\frac{n}{2}},{\frac{1}{2}}-{\frac{n}{2}},-{\frac{3}{2}}-{\frac{n}{2}};\,1-n,-{\frac{1}{2}}-{\frac{n}{2}};\,-{\frac{a}{{x}^{2}}})}}+{\frac{n}{4\,\sqrt{\pi }}{a}^{{\frac{3}{2}}+{\frac{n}{2}}} \left ( 8\,{\frac{\sqrt{\pi }{x}^{1+n}{a}^{-1/2-n/2}}{ \left ( 1+n \right ) n \left ( -2+2\,n \right ) } \left ({\frac{an}{{x}^{2}}}+n-1 \right ) \left ( \sqrt{1+{\frac{a}{{x}^{2}}}}+1 \right ) ^{-1+n}}+4\,{\frac{\sqrt{\pi }{x}^{1+n}{a}^{-1/2-n/2}}{ \left ( 1+n \right ) n}\sqrt{1+{\frac{a}{{x}^{2}}}} \left ( \sqrt{1+{\frac{a}{{x}^{2}}}}+1 \right ) ^{-1+n}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (x^{2} + a\right )}{\left (x + \sqrt{x^{2} + a}\right )}^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.35338, size = 174, normalized size = 1.61 \begin{align*} -\frac{{\left (3 \,{\left (n^{2} - 1\right )} x^{3} + 3 \,{\left (a n^{2} - 3 \, a\right )} x -{\left (a n^{3} +{\left (n^{3} - n\right )} x^{2} - 7 \, a n\right )} \sqrt{x^{2} + a}\right )}{\left (x + \sqrt{x^{2} + a}\right )}^{n}}{n^{4} - 10 \, n^{2} + 9} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (x^{2} + a\right )}{\left (x + \sqrt{x^{2} + a}\right )}^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]