Optimal. Leaf size=176 \[ -\frac {a^5 \left (x-\sqrt {a+x^2}\right )^{n-5}}{32 (5-n)}-\frac {5 a^4 \left (x-\sqrt {a+x^2}\right )^{n-3}}{32 (3-n)}-\frac {5 a^3 \left (x-\sqrt {a+x^2}\right )^{n-1}}{16 (1-n)}+\frac {5 a^2 \left (x-\sqrt {a+x^2}\right )^{n+1}}{16 (n+1)}+\frac {5 a \left (x-\sqrt {a+x^2}\right )^{n+3}}{32 (n+3)}+\frac {\left (x-\sqrt {a+x^2}\right )^{n+5}}{32 (n+5)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 176, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {2122, 270} \[ -\frac {a^5 \left (x-\sqrt {a+x^2}\right )^{n-5}}{32 (5-n)}-\frac {5 a^4 \left (x-\sqrt {a+x^2}\right )^{n-3}}{32 (3-n)}-\frac {5 a^3 \left (x-\sqrt {a+x^2}\right )^{n-1}}{16 (1-n)}+\frac {5 a^2 \left (x-\sqrt {a+x^2}\right )^{n+1}}{16 (n+1)}+\frac {5 a \left (x-\sqrt {a+x^2}\right )^{n+3}}{32 (n+3)}+\frac {\left (x-\sqrt {a+x^2}\right )^{n+5}}{32 (n+5)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 270
Rule 2122
Rubi steps
\begin {align*} \int \left (a+x^2\right )^2 \left (x-\sqrt {a+x^2}\right )^n \, dx &=\frac {1}{32} \operatorname {Subst}\left (\int x^{-6+n} \left (a+x^2\right )^5 \, dx,x,x-\sqrt {a+x^2}\right )\\ &=\frac {1}{32} \operatorname {Subst}\left (\int \left (a^5 x^{-6+n}+5 a^4 x^{-4+n}+10 a^3 x^{-2+n}+10 a^2 x^n+5 a x^{2+n}+x^{4+n}\right ) \, dx,x,x-\sqrt {a+x^2}\right )\\ &=-\frac {a^5 \left (x-\sqrt {a+x^2}\right )^{-5+n}}{32 (5-n)}-\frac {5 a^4 \left (x-\sqrt {a+x^2}\right )^{-3+n}}{32 (3-n)}-\frac {5 a^3 \left (x-\sqrt {a+x^2}\right )^{-1+n}}{16 (1-n)}+\frac {5 a^2 \left (x-\sqrt {a+x^2}\right )^{1+n}}{16 (1+n)}+\frac {5 a \left (x-\sqrt {a+x^2}\right )^{3+n}}{32 (3+n)}+\frac {\left (x-\sqrt {a+x^2}\right )^{5+n}}{32 (5+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.39, size = 150, normalized size = 0.85 \[ \frac {1}{32} \left (x-\sqrt {a+x^2}\right )^{n-5} \left (\frac {a^5}{n-5}+\frac {5 a^4 \left (x-\sqrt {a+x^2}\right )^2}{n-3}+\frac {10 a^3 \left (x-\sqrt {a+x^2}\right )^4}{n-1}+\frac {10 a^2 \left (x-\sqrt {a+x^2}\right )^6}{n+1}+\frac {\left (x-\sqrt {a+x^2}\right )^{10}}{n+5}+\frac {5 a \left (x-\sqrt {a+x^2}\right )^8}{n+3}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.50, size = 159, normalized size = 0.90 \[ -\frac {{\left (5 \, {\left (n^{4} - 10 \, n^{2} + 9\right )} x^{5} + 10 \, {\left (a n^{4} - 16 \, a n^{2} + 15 \, a\right )} x^{3} + 5 \, {\left (a^{2} n^{4} - 22 \, a^{2} n^{2} + 45 \, a^{2}\right )} x + {\left (a^{2} n^{5} - 30 \, a^{2} n^{3} + {\left (n^{5} - 10 \, n^{3} + 9 \, n\right )} x^{4} + 149 \, a^{2} n + 2 \, {\left (a n^{5} - 20 \, a n^{3} + 19 \, a n\right )} x^{2}\right )} \sqrt {x^{2} + a}\right )} {\left (x - \sqrt {x^{2} + a}\right )}^{n}}{n^{6} - 35 \, n^{4} + 259 \, n^{2} - 225} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (x^{2} + a\right )}^{2} {\left (x - \sqrt {x^{2} + a}\right )}^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 0.06, size = 0, normalized size = 0.00 \[ \int \left (x^{2}+a \right )^{2} \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 \[ \int {\left (x^{2} + a\right )}^{2} {\left (x - \sqrt {x^{2} + a}\right )}^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int {\left (x-\sqrt {x^2+a}\right )}^n\,{\left (x^2+a\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + x^{2}\right )^{2} \left (x - \sqrt {a + x^{2}}\right )^{n}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________