Optimal. Leaf size=81 \[ \frac {a^2 \left (x-\sqrt {a+x^2}\right )^{-2+n}}{4 (2-n)}-\frac {a \left (x-\sqrt {a+x^2}\right )^n}{2 n}-\frac {\left (x-\sqrt {a+x^2}\right )^{2+n}}{4 (2+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {2147, 276}
\begin {gather*} \frac {a^2 \left (x-\sqrt {a+x^2}\right )^{n-2}}{4 (2-n)}-\frac {a \left (x-\sqrt {a+x^2}\right )^n}{2 n}-\frac {\left (x-\sqrt {a+x^2}\right )^{n+2}}{4 (n+2)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 276
Rule 2147
Rubi steps
\begin {align*} \int \sqrt {a+x^2} \left (x-\sqrt {a+x^2}\right )^n \, dx &=-\left (\frac {1}{4} \text {Subst}\left (\int x^{-3+n} \left (a+x^2\right )^2 \, dx,x,x-\sqrt {a+x^2}\right )\right )\\ &=-\left (\frac {1}{4} \text {Subst}\left (\int \left (a^2 x^{-3+n}+2 a x^{-1+n}+x^{1+n}\right ) \, dx,x,x-\sqrt {a+x^2}\right )\right )\\ &=\frac {a^2 \left (x-\sqrt {a+x^2}\right )^{-2+n}}{4 (2-n)}-\frac {a \left (x-\sqrt {a+x^2}\right )^n}{2 n}-\frac {\left (x-\sqrt {a+x^2}\right )^{2+n}}{4 (2+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.19, size = 73, normalized size = 0.90 \begin {gather*} \frac {1}{4} \left (x-\sqrt {a+x^2}\right )^n \left (-\frac {2 a}{n}-\frac {a^2}{(-2+n) \left (x-\sqrt {a+x^2}\right )^2}-\frac {\left (x-\sqrt {a+x^2}\right )^2}{2+n}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.04, size = 0, normalized size = 0.00 \[\int \sqrt {x^{2}+a}\, \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.38, size = 51, normalized size = 0.63 \begin {gather*} -\frac {{\left (n^{2} x^{2} + a n^{2} + 2 \, \sqrt {x^{2} + a} n x - 2 \, a\right )} {\left (x - \sqrt {x^{2} + a}\right )}^{n}}{n^{3} - 4 \, n} \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 \sqrt {a + x^{2}} \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\,\sqrt {x^2+a} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________