Optimal. Leaf size=116 \[ -\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)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2147, 276}
\begin {gather*} -\frac {a^3 \left (x-\sqrt {a+x^2}\right )^{n-3}}{8 (3-n)}-\frac {3 a^2 \left (x-\sqrt {a+x^2}\right )^{n-1}}{8 (1-n)}+\frac {3 a \left (x-\sqrt {a+x^2}\right )^{n+1}}{8 (n+1)}+\frac {\left (x-\sqrt {a+x^2}\right )^{n+3}}{8 (n+3)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 276
Rule 2147
Rubi steps
\begin {align*} \int \left (a+x^2\right ) \left (x-\sqrt {a+x^2}\right )^n \, dx &=\frac {1}{8} \text {Subst}\left (\int x^{-4+n} \left (a+x^2\right )^3 \, dx,x,x-\sqrt {a+x^2}\right )\\ &=\frac {1}{8} \text {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.24, size = 100, normalized size = 0.86 \begin {gather*} \frac {1}{8} \left (x-\sqrt {a+x^2}\right )^{-3+n} \left (\frac {a^3}{-3+n}+\frac {3 a^2 \left (x-\sqrt {a+x^2}\right )^2}{-1+n}+\frac {3 a \left (x-\sqrt {a+x^2}\right )^4}{1+n}+\frac {\left (x-\sqrt {a+x^2}\right )^6}{3+n}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.02, size = 0, normalized size = 0.00 \[\int \left (x^{2}+a \right ) \left (x -\sqrt {x^{2}+a}\right )^{n}\, 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*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 79, normalized size = 0.68 \begin {gather*} -\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 {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 \left (a + x^{2}\right ) \left (x - \sqrt {a + x^{2}}\right )^{n}\, dx \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*} \text {could not integrate} \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 {\left (x-\sqrt {x^2+a}\right )}^n\,\left (x^2+a\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________