3.519 \(\int \sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} (d+e x+f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}})^n \, dx\)

Optimal. Leaf size=327 \[ -\frac{\left (d^2-a f^2\right )^2 \sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \left (f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}+d+e x\right )^{n-2}}{4 e f (2-n) \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}-\frac{\left (d^2-a f^2\right ) \sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \left (f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}+d+e x\right )^n}{2 e f n \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}+\frac{\sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \left (f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}+d+e x\right )^{n+2}}{4 e f (n+2) \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}} \]

[Out]

-((d^2 - a*f^2)^2*Sqrt[a*g + (2*d*e*g*x)/f^2 + (e^2*g*x^2)/f^2]*(d + e*x + f*Sqrt[a + (2*d*e*x)/f^2 + (e^2*x^2
)/f^2])^(-2 + n))/(4*e*f*(2 - n)*Sqrt[a + (2*d*e*x)/f^2 + (e^2*x^2)/f^2]) - ((d^2 - a*f^2)*Sqrt[a*g + (2*d*e*g
*x)/f^2 + (e^2*g*x^2)/f^2]*(d + e*x + f*Sqrt[a + (2*d*e*x)/f^2 + (e^2*x^2)/f^2])^n)/(2*e*f*n*Sqrt[a + (2*d*e*x
)/f^2 + (e^2*x^2)/f^2]) + (Sqrt[a*g + (2*d*e*g*x)/f^2 + (e^2*g*x^2)/f^2]*(d + e*x + f*Sqrt[a + (2*d*e*x)/f^2 +
 (e^2*x^2)/f^2])^(2 + n))/(4*e*f*(2 + n)*Sqrt[a + (2*d*e*x)/f^2 + (e^2*x^2)/f^2])

________________________________________________________________________________________

Rubi [A]  time = 0.616985, antiderivative size = 327, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 62, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.065, Rules used = {2123, 2121, 12, 270} \[ -\frac{\left (d^2-a f^2\right )^2 \sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \left (f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}+d+e x\right )^{n-2}}{4 e f (2-n) \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}-\frac{\left (d^2-a f^2\right ) \sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \left (f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}+d+e x\right )^n}{2 e f n \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}+\frac{\sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \left (f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}+d+e x\right )^{n+2}}{4 e f (n+2) \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a*g + (2*d*e*g*x)/f^2 + (e^2*g*x^2)/f^2]*(d + e*x + f*Sqrt[a + (2*d*e*x)/f^2 + (e^2*x^2)/f^2])^n,x]

[Out]

-((d^2 - a*f^2)^2*Sqrt[a*g + (2*d*e*g*x)/f^2 + (e^2*g*x^2)/f^2]*(d + e*x + f*Sqrt[a + (2*d*e*x)/f^2 + (e^2*x^2
)/f^2])^(-2 + n))/(4*e*f*(2 - n)*Sqrt[a + (2*d*e*x)/f^2 + (e^2*x^2)/f^2]) - ((d^2 - a*f^2)*Sqrt[a*g + (2*d*e*g
*x)/f^2 + (e^2*g*x^2)/f^2]*(d + e*x + f*Sqrt[a + (2*d*e*x)/f^2 + (e^2*x^2)/f^2])^n)/(2*e*f*n*Sqrt[a + (2*d*e*x
)/f^2 + (e^2*x^2)/f^2]) + (Sqrt[a*g + (2*d*e*g*x)/f^2 + (e^2*g*x^2)/f^2]*(d + e*x + f*Sqrt[a + (2*d*e*x)/f^2 +
 (e^2*x^2)/f^2])^(2 + n))/(4*e*f*(2 + n)*Sqrt[a + (2*d*e*x)/f^2 + (e^2*x^2)/f^2])

Rule 2123

Int[((g_.) + (h_.)*(x_) + (i_.)*(x_)^2)^(m_.)*((d_.) + (e_.)*(x_) + (f_.)*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)
^2])^(n_.), x_Symbol] :> Dist[((i/c)^(m - 1/2)*Sqrt[g + h*x + i*x^2])/Sqrt[a + b*x + c*x^2], Int[(a + b*x + c*
x^2)^m*(d + e*x + f*Sqrt[a + b*x + c*x^2])^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n}, x] && EqQ[e^2 -
c*f^2, 0] && EqQ[c*g - a*i, 0] && EqQ[c*h - b*i, 0] && IGtQ[m + 1/2, 0] &&  !GtQ[i/c, 0]

Rule 2121

Int[((g_.) + (h_.)*(x_) + (i_.)*(x_)^2)^(m_.)*((d_.) + (e_.)*(x_) + (f_.)*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)
^2])^(n_.), x_Symbol] :> Dist[(2*(i/c)^m)/f^(2*m), Subst[Int[(x^n*(d^2*e - (b*d - a*e)*f^2 - (2*d*e - b*f^2)*x
 + e*x^2)^(2*m + 1))/(-2*d*e + b*f^2 + 2*e*x)^(2*(m + 1)), x], x, d + e*x + f*Sqrt[a + b*x + c*x^2]], x] /; Fr
eeQ[{a, b, c, d, e, f, g, h, i, n}, x] && EqQ[e^2 - c*f^2, 0] && EqQ[c*g - a*i, 0] && EqQ[c*h - b*i, 0] && Int
egerQ[2*m] && (IntegerQ[m] || GtQ[i/c, 0])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

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]

Rubi steps

\begin{align*} \int \sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \left (d+e x+f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}\right )^n \, dx &=\frac{\sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \int \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}} \left (d+e x+f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}\right )^n \, dx}{\sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}\\ &=\frac{\left (2 \sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}}\right ) \operatorname{Subst}\left (\int \frac{x^{-3+n} \left (d^2 e-\left (-a e+\frac{2 d^2 e}{f^2}\right ) f^2+e x^2\right )^2}{8 e^3} \, dx,x,d+e x+f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}\right )}{f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}\\ &=\frac{\sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \operatorname{Subst}\left (\int x^{-3+n} \left (d^2 e-\left (-a e+\frac{2 d^2 e}{f^2}\right ) f^2+e x^2\right )^2 \, dx,x,d+e x+f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}\right )}{4 e^3 f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}\\ &=\frac{\sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \operatorname{Subst}\left (\int \left (e^2 \left (d^2-a f^2\right )^2 x^{-3+n}-2 e^2 \left (d^2-a f^2\right ) x^{-1+n}+e^2 x^{1+n}\right ) \, dx,x,d+e x+f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}\right )}{4 e^3 f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}\\ &=-\frac{\left (d^2-a f^2\right )^2 \sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \left (d+e x+f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}\right )^{-2+n}}{4 e f (2-n) \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}-\frac{\left (d^2-a f^2\right ) \sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \left (d+e x+f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}\right )^n}{2 e f n \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}+\frac{\sqrt{a g+\frac{2 d e g x}{f^2}+\frac{e^2 g x^2}{f^2}} \left (d+e x+f \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}\right )^{2+n}}{4 e f (2+n) \sqrt{a+\frac{2 d e x}{f^2}+\frac{e^2 x^2}{f^2}}}\\ \end{align*}

Mathematica [A]  time = 0.247199, size = 175, normalized size = 0.54 \[ \frac{\sqrt{g \left (a+\frac{e x (2 d+e x)}{f^2}\right )} \left (f \sqrt{a+\frac{e x (2 d+e x)}{f^2}}+d+e x\right )^n \left (\frac{\left (d^2-a f^2\right )^2}{(n-2) \left (f \sqrt{a+\frac{e x (2 d+e x)}{f^2}}+d+e x\right )^2}+\frac{2 \left (a f^2-d^2\right )}{n}+\frac{\left (f \sqrt{a+\frac{e x (2 d+e x)}{f^2}}+d+e x\right )^2}{n+2}\right )}{4 e f \sqrt{a+\frac{e x (2 d+e x)}{f^2}}} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a*g + (2*d*e*g*x)/f^2 + (e^2*g*x^2)/f^2]*(d + e*x + f*Sqrt[a + (2*d*e*x)/f^2 + (e^2*x^2)/f^2])^
n,x]

[Out]

(Sqrt[g*(a + (e*x*(2*d + e*x))/f^2)]*(d + e*x + f*Sqrt[a + (e*x*(2*d + e*x))/f^2])^n*((2*(-d^2 + a*f^2))/n + (
d^2 - a*f^2)^2/((-2 + n)*(d + e*x + f*Sqrt[a + (e*x*(2*d + e*x))/f^2])^2) + (d + e*x + f*Sqrt[a + (e*x*(2*d +
e*x))/f^2])^2/(2 + n)))/(4*e*f*Sqrt[a + (e*x*(2*d + e*x))/f^2])

________________________________________________________________________________________

Maple [F]  time = 0.075, size = 0, normalized size = 0. \begin{align*} \int \sqrt{ag+2\,{\frac{degx}{{f}^{2}}}+{\frac{{e}^{2}g{x}^{2}}{{f}^{2}}}} \left ( d+ex+f\sqrt{a+2\,{\frac{dex}{{f}^{2}}}+{\frac{{e}^{2}{x}^{2}}{{f}^{2}}}} \right ) ^{n}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*g+2*d*e*g*x/f^2+e^2*g*x^2/f^2)^(1/2)*(d+e*x+f*(a+2*d*e*x/f^2+e^2*x^2/f^2)^(1/2))^n,x)

[Out]

int((a*g+2*d*e*g*x/f^2+e^2*g*x^2/f^2)^(1/2)*(d+e*x+f*(a+2*d*e*x/f^2+e^2*x^2/f^2)^(1/2))^n,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{\frac{e^{2} g x^{2}}{f^{2}} + a g + \frac{2 \, d e g x}{f^{2}}}{\left (e x + \sqrt{\frac{e^{2} x^{2}}{f^{2}} + a + \frac{2 \, d e x}{f^{2}}} f + d\right )}^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate(sqrt(e^2*g*x^2/f^2 + a*g + 2*d*e*g*x/f^2)*(e*x + sqrt(e^2*x^2/f^2 + a + 2*d*e*x/f^2)*f + d)^n, x)

________________________________________________________________________________________

Fricas [A]  time = 1.17777, size = 486, normalized size = 1.49 \begin{align*} -\frac{{\left (2 \, e^{3} n x^{3} + 6 \, d e^{2} n x^{2} + 2 \, a d f^{2} n + 2 \,{\left (a e f^{2} + 2 \, d^{2} e\right )} n x -{\left (e^{2} f n^{2} x^{2} + a f^{3} n^{2} + 2 \, d e f n^{2} x - 2 \, a f^{3} + 2 \, d^{2} f\right )} \sqrt{\frac{e^{2} x^{2} + a f^{2} + 2 \, d e x}{f^{2}}}\right )}{\left (e x + f \sqrt{\frac{e^{2} x^{2} + a f^{2} + 2 \, d e x}{f^{2}}} + d\right )}^{n} \sqrt{\frac{e^{2} g x^{2} + a f^{2} g + 2 \, d e g x}{f^{2}}}}{a e f^{2} n^{3} - 4 \, a e f^{2} n +{\left (e^{3} n^{3} - 4 \, e^{3} n\right )} x^{2} + 2 \,{\left (d e^{2} n^{3} - 4 \, d e^{2} n\right )} x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(2*e^3*n*x^3 + 6*d*e^2*n*x^2 + 2*a*d*f^2*n + 2*(a*e*f^2 + 2*d^2*e)*n*x - (e^2*f*n^2*x^2 + a*f^3*n^2 + 2*d*e*f
*n^2*x - 2*a*f^3 + 2*d^2*f)*sqrt((e^2*x^2 + a*f^2 + 2*d*e*x)/f^2))*(e*x + f*sqrt((e^2*x^2 + a*f^2 + 2*d*e*x)/f
^2) + d)^n*sqrt((e^2*g*x^2 + a*f^2*g + 2*d*e*g*x)/f^2)/(a*e*f^2*n^3 - 4*a*e*f^2*n + (e^3*n^3 - 4*e^3*n)*x^2 +
2*(d*e^2*n^3 - 4*d*e^2*n)*x)

________________________________________________________________________________________

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]

integrate((a*g+2*d*e*g*x/f**2+e**2*g*x**2/f**2)**(1/2)*(d+e*x+f*(a+2*d*e*x/f**2+e**2*x**2/f**2)**(1/2))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{\frac{e^{2} g x^{2}}{f^{2}} + a g + \frac{2 \, d e g x}{f^{2}}}{\left (e x + \sqrt{\frac{e^{2} x^{2}}{f^{2}} + a + \frac{2 \, d e x}{f^{2}}} f + d\right )}^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate(sqrt(e^2*g*x^2/f^2 + a*g + 2*d*e*g*x/f^2)*(e*x + sqrt(e^2*x^2/f^2 + a + 2*d*e*x/f^2)*f + d)^n, x)