3.486 \(\int (a+x^2) (x+\sqrt {a+x^2})^n \, dx\)

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]

-1/8*a^3*(x+(x^2+a)^(1/2))^(-3+n)/(3-n)-3/8*a^2*(x+(x^2+a)^(1/2))^(-1+n)/(1-n)+3/8*a*(x+(x^2+a)^(1/2))^(1+n)/(
1+n)+1/8*(x+(x^2+a)^(1/2))^(3+n)/(3+n)

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 108, normalized size of antiderivative = 1.00, 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]

Int[(a + x^2)*(x + Sqrt[a + x^2])^n,x]

[Out]

-(a^3*(x + Sqrt[a + x^2])^(-3 + n))/(8*(3 - n)) - (3*a^2*(x + Sqrt[a + x^2])^(-1 + n))/(8*(1 - n)) + (3*a*(x +
 Sqrt[a + x^2])^(1 + n))/(8*(1 + n)) + (x + Sqrt[a + x^2])^(3 + n)/(8*(3 + n))

Rule 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rule 2122

Int[((g_) + (i_.)*(x_)^2)^(m_.)*((d_.) + (e_.)*(x_) + (f_.)*Sqrt[(a_) + (c_.)*(x_)^2])^(n_.), x_Symbol] :> Dis
t[(1*(i/c)^m)/(2^(2*m + 1)*e*f^(2*m)), Subst[Int[(x^n*(d^2 + a*f^2 - 2*d*x + x^2)^(2*m + 1))/(-d + x)^(2*(m +
1)), x], x, d + e*x + f*Sqrt[a + c*x^2]], x] /; FreeQ[{a, c, d, e, f, g, i, n}, x] && EqQ[e^2 - c*f^2, 0] && E
qQ[c*g - a*i, 0] && IntegerQ[2*m] && (IntegerQ[m] || GtQ[i/c, 0])

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.14, size = 92, normalized size = 0.85 \[ \frac {1}{8} \left (\sqrt {a+x^2}+x\right )^{n-3} \left (\frac {a^3}{n-3}+\frac {3 a^2 \left (\sqrt {a+x^2}+x\right )^2}{n-1}+\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]

Integrate[(a + x^2)*(x + Sqrt[a + x^2])^n,x]

[Out]

((x + Sqrt[a + x^2])^(-3 + n)*(a^3/(-3 + n) + (3*a^2*(x + Sqrt[a + x^2])^2)/(-1 + n) + (3*a*(x + Sqrt[a + x^2]
)^4)/(1 + n) + (x + Sqrt[a + x^2])^6/(3 + n)))/8

________________________________________________________________________________________

fricas [A]  time = 0.47, size = 78, normalized size = 0.72 \[ -\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} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+a)*(x+(x^2+a)^(1/2))^n,x, algorithm="fricas")

[Out]

-(3*(n^2 - 1)*x^3 + 3*(a*n^2 - 3*a)*x - (a*n^3 + (n^3 - n)*x^2 - 7*a*n)*sqrt(x^2 + a))*(x + sqrt(x^2 + a))^n/(
n^4 - 10*n^2 + 9)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (x^{2} + a\right )} {\left (x + \sqrt {x^{2} + a}\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+a)*(x+(x^2+a)^(1/2))^n,x, algorithm="giac")

[Out]

integrate((x^2 + a)*(x + sqrt(x^2 + a))^n, x)

________________________________________________________________________________________

maple [C]  time = 0.02, size = 167, normalized size = 1.55 \[ \frac {2^{n} x^{n +3} \hypergeom \left (\left [-\frac {n}{2}, -\frac {n}{2}+\frac {1}{2}, -\frac {n}{2}-\frac {3}{2}\right ], \left [-n +1, -\frac {n}{2}-\frac {1}{2}\right ], -\frac {a}{x^{2}}\right )}{n +3}+\frac {\left (\frac {8 \sqrt {\pi }\, \left (n +\frac {a n}{x^{2}}-1\right ) a^{-\frac {n}{2}-\frac {1}{2}} x^{n +1} \left (\sqrt {\frac {a}{x^{2}}+1}+1\right )^{n -1}}{\left (n +1\right ) \left (2 n -2\right ) n}+\frac {4 \sqrt {\pi }\, \sqrt {\frac {a}{x^{2}}+1}\, a^{-\frac {n}{2}-\frac {1}{2}} x^{n +1} \left (\sqrt {\frac {a}{x^{2}}+1}+1\right )^{n -1}}{\left (n +1\right ) n}\right ) n \,a^{\frac {n}{2}+\frac {3}{2}}}{4 \sqrt {\pi }} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2+a)*(x+(x^2+a)^(1/2))^n,x)

[Out]

2^n/(n+3)*x^(n+3)*hypergeom([-1/2*n,-1/2*n+1/2,-1/2*n-3/2],[-n+1,-1/2*n-1/2],-a/x^2)+1/4*a^(3/2+1/2*n)/Pi^(1/2
)*n*(8*Pi^(1/2)/(n+1)*(n+a*n/x^2-1)/(2*n-2)/n*a^(-1/2*n-1/2)*x^(n+1)*((a/x^2+1)^(1/2)+1)^(n-1)+4*Pi^(1/2)/(n+1
)*(a/x^2+1)^(1/2)/n*a^(-1/2*n-1/2)*x^(n+1)*((a/x^2+1)^(1/2)+1)^(n-1))

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (x^{2} + a\right )} {\left (x + \sqrt {x^{2} + a}\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+a)*(x+(x^2+a)^(1/2))^n,x, algorithm="maxima")

[Out]

integrate((x^2 + a)*(x + sqrt(x^2 + a))^n, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \left (x^2+a\right )\,{\left (x+\sqrt {x^2+a}\right )}^n \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + x^2)*(x + (a + x^2)^(1/2))^n,x)

[Out]

int((a + x^2)*(x + (a + x^2)^(1/2))^n, x)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2+a)*(x+(x**2+a)**(1/2))**n,x)

[Out]

Timed out

________________________________________________________________________________________