\(\int \frac {(5+x)^2}{\sqrt {2 x+3 x^2+x^3}} \, dx\) [4]

Optimal result
Mathematica [C] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F]
Maxima [F]
Giac [F]
Mupad [B] (verification not implemented)
Reduce [F]

Optimal result

Integrand size = 22, antiderivative size = 153 \[ \int \frac {(5+x)^2}{\sqrt {2 x+3 x^2+x^3}} \, dx=\frac {16 x (2+x)}{\sqrt {2 x+3 x^2+x^3}}+\frac {2}{3} \sqrt {2 x+3 x^2+x^3}-\frac {16 \sqrt {2} \sqrt {x} (1+x) \sqrt {\frac {2+x}{1+x}} E\left (\arctan \left (\sqrt {x}\right )|\frac {1}{2}\right )}{\sqrt {2 x+3 x^2+x^3}}+\frac {73 \sqrt {2} \sqrt {x} (1+x) \sqrt {\frac {2+x}{1+x}} \operatorname {EllipticF}\left (\arctan \left (\sqrt {x}\right ),\frac {1}{2}\right )}{3 \sqrt {2 x+3 x^2+x^3}} \] Output:

16*x*(2+x)/(x^3+3*x^2+2*x)^(1/2)+2/3*(x^3+3*x^2+2*x)^(1/2)-16*2^(1/2)*x^(1 
/2)*(1+x)*((2+x)/(1+x))^(1/2)*EllipticE(x^(1/2)/(1+x)^(1/2),1/2*2^(1/2))/( 
x^3+3*x^2+2*x)^(1/2)+73/3*2^(1/2)*x^(1/2)*(1+x)*((2+x)/(1+x))^(1/2)*Invers 
eJacobiAM(arctan(x^(1/2)),1/2*2^(1/2))/(x^3+3*x^2+2*x)^(1/2)
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 22.31 (sec) , antiderivative size = 142, normalized size of antiderivative = 0.93 \[ \int \frac {(5+x)^2}{\sqrt {2 x+3 x^2+x^3}} \, dx=\frac {2 \left (48+74 x+27 x^2+x^3\right )+48 i \sqrt {2} \sqrt {1+\frac {1}{x}} x^{3/2} \sqrt {\frac {2+x}{x}} E\left (i \text {arcsinh}\left (\frac {\sqrt {2}}{\sqrt {x}}\right )|\frac {1}{2}\right )+25 i \sqrt {2} \sqrt {1+\frac {1}{x}} x^{3/2} \sqrt {\frac {2+x}{x}} \operatorname {EllipticF}\left (i \text {arcsinh}\left (\frac {\sqrt {2}}{\sqrt {x}}\right ),\frac {1}{2}\right )}{3 \sqrt {x \left (2+3 x+x^2\right )}} \] Input:

Integrate[(5 + x)^2/Sqrt[2*x + 3*x^2 + x^3],x]
 

Output:

(2*(48 + 74*x + 27*x^2 + x^3) + (48*I)*Sqrt[2]*Sqrt[1 + x^(-1)]*x^(3/2)*Sq 
rt[(2 + x)/x]*EllipticE[I*ArcSinh[Sqrt[2]/Sqrt[x]], 1/2] + (25*I)*Sqrt[2]* 
Sqrt[1 + x^(-1)]*x^(3/2)*Sqrt[(2 + x)/x]*EllipticF[I*ArcSinh[Sqrt[2]/Sqrt[ 
x]], 1/2])/(3*Sqrt[x*(2 + 3*x + x^2)])
 

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.14, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {2469, 1278, 25, 2004, 1240, 1503, 1412, 1455}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(x+5)^2}{\sqrt {x^3+3 x^2+2 x}} \, dx\)

\(\Big \downarrow \) 2469

\(\displaystyle \frac {\sqrt {x} \sqrt {x^2+3 x+2} \int \frac {(x+5)^2}{\sqrt {x} \sqrt {x^2+3 x+2}}dx}{\sqrt {x^3+3 x^2+2 x}}\)

\(\Big \downarrow \) 1278

\(\displaystyle \frac {\sqrt {x} \sqrt {x^2+3 x+2} \left (\frac {2}{3} \sqrt {x} \sqrt {x^2+3 x+2}-\frac {1}{3} \int -\frac {24 x^2+193 x+365}{\sqrt {x} (x+5) \sqrt {x^2+3 x+2}}dx\right )}{\sqrt {x^3+3 x^2+2 x}}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\sqrt {x} \sqrt {x^2+3 x+2} \left (\frac {1}{3} \int \frac {24 x^2+193 x+365}{\sqrt {x} (x+5) \sqrt {x^2+3 x+2}}dx+\frac {2}{3} \sqrt {x} \sqrt {x^2+3 x+2}\right )}{\sqrt {x^3+3 x^2+2 x}}\)

\(\Big \downarrow \) 2004

\(\displaystyle \frac {\sqrt {x} \sqrt {x^2+3 x+2} \left (\frac {1}{3} \int \frac {24 x+73}{\sqrt {x} \sqrt {x^2+3 x+2}}dx+\frac {2}{3} \sqrt {x} \sqrt {x^2+3 x+2}\right )}{\sqrt {x^3+3 x^2+2 x}}\)

\(\Big \downarrow \) 1240

\(\displaystyle \frac {\sqrt {x} \sqrt {x^2+3 x+2} \left (\frac {2}{3} \int \frac {24 x+73}{\sqrt {x^2+3 x+2}}d\sqrt {x}+\frac {2}{3} \sqrt {x} \sqrt {x^2+3 x+2}\right )}{\sqrt {x^3+3 x^2+2 x}}\)

\(\Big \downarrow \) 1503

\(\displaystyle \frac {\sqrt {x} \sqrt {x^2+3 x+2} \left (\frac {2}{3} \left (73 \int \frac {1}{\sqrt {x^2+3 x+2}}d\sqrt {x}+24 \int \frac {x}{\sqrt {x^2+3 x+2}}d\sqrt {x}\right )+\frac {2}{3} \sqrt {x} \sqrt {x^2+3 x+2}\right )}{\sqrt {x^3+3 x^2+2 x}}\)

\(\Big \downarrow \) 1412

\(\displaystyle \frac {\sqrt {x} \sqrt {x^2+3 x+2} \left (\frac {2}{3} \left (24 \int \frac {x}{\sqrt {x^2+3 x+2}}d\sqrt {x}+\frac {73 (x+1) \sqrt {\frac {x+2}{x+1}} \operatorname {EllipticF}\left (\arctan \left (\sqrt {x}\right ),\frac {1}{2}\right )}{\sqrt {2} \sqrt {x^2+3 x+2}}\right )+\frac {2}{3} \sqrt {x} \sqrt {x^2+3 x+2}\right )}{\sqrt {x^3+3 x^2+2 x}}\)

\(\Big \downarrow \) 1455

\(\displaystyle \frac {\sqrt {x} \sqrt {x^2+3 x+2} \left (\frac {2}{3} \left (\frac {73 (x+1) \sqrt {\frac {x+2}{x+1}} \operatorname {EllipticF}\left (\arctan \left (\sqrt {x}\right ),\frac {1}{2}\right )}{\sqrt {2} \sqrt {x^2+3 x+2}}+24 \left (\frac {\sqrt {x} (x+2)}{\sqrt {x^2+3 x+2}}-\frac {\sqrt {2} (x+1) \sqrt {\frac {x+2}{x+1}} E\left (\arctan \left (\sqrt {x}\right )|\frac {1}{2}\right )}{\sqrt {x^2+3 x+2}}\right )\right )+\frac {2}{3} \sqrt {x} \sqrt {x^2+3 x+2}\right )}{\sqrt {x^3+3 x^2+2 x}}\)

Input:

Int[(5 + x)^2/Sqrt[2*x + 3*x^2 + x^3],x]
 

Output:

(Sqrt[x]*Sqrt[2 + 3*x + x^2]*((2*Sqrt[x]*Sqrt[2 + 3*x + x^2])/3 + (2*(24*( 
(Sqrt[x]*(2 + x))/Sqrt[2 + 3*x + x^2] - (Sqrt[2]*(1 + x)*Sqrt[(2 + x)/(1 + 
 x)]*EllipticE[ArcTan[Sqrt[x]], 1/2])/Sqrt[2 + 3*x + x^2]) + (73*(1 + x)*S 
qrt[(2 + x)/(1 + x)]*EllipticF[ArcTan[Sqrt[x]], 1/2])/(Sqrt[2]*Sqrt[2 + 3* 
x + x^2])))/3))/Sqrt[2*x + 3*x^2 + x^3]
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 1240
Int[((f_) + (g_.)*(x_))/(Sqrt[x_]*Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2]), 
x_Symbol] :> Simp[2   Subst[Int[(f + g*x^2)/Sqrt[a + b*x^2 + c*x^4], x], x, 
 Sqrt[x]], x] /; FreeQ[{a, b, c, f, g}, x]
 

rule 1278
Int[((d_.) + (e_.)*(x_))^(m_)/(Sqrt[(f_.) + (g_.)*(x_)]*Sqrt[(a_.) + (b_.)* 
(x_) + (c_.)*(x_)^2]), x_Symbol] :> Simp[2*e^2*(d + e*x)^(m - 2)*Sqrt[f + g 
*x]*(Sqrt[a + b*x + c*x^2]/(c*g*(2*m - 1))), x] - Simp[1/(c*g*(2*m - 1)) 
Int[((d + e*x)^(m - 3)/(Sqrt[f + g*x]*Sqrt[a + b*x + c*x^2]))*Simp[b*d*e^2* 
f + a*e^2*(d*g + 2*e*f*(m - 2)) - c*d^3*g*(2*m - 1) + e*(e*(2*b*d*g + e*(b* 
f + a*g)*(2*m - 3)) + c*d*(2*e*f - 3*d*g*(2*m - 1)))*x + 2*e^2*(c*e*f - 3*c 
*d*g + b*e*g)*(m - 1)*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && 
 IntegerQ[2*m] && GeQ[m, 2]
 

rule 1412
Int[1/Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4], x_Symbol] :> With[{q = Rt[b 
^2 - 4*a*c, 2]}, Simp[(2*a + (b + q)*x^2)*(Sqrt[(2*a + (b - q)*x^2)/(2*a + 
(b + q)*x^2)]/(2*a*Rt[(b + q)/(2*a), 2]*Sqrt[a + b*x^2 + c*x^4]))*EllipticF 
[ArcTan[Rt[(b + q)/(2*a), 2]*x], 2*(q/(b + q))], x] /; PosQ[(b + q)/a] && 
!(PosQ[(b - q)/a] && SimplerSqrtQ[(b - q)/(2*a), (b + q)/(2*a)])] /; FreeQ[ 
{a, b, c}, x] && GtQ[b^2 - 4*a*c, 0]
 

rule 1455
Int[(x_)^2/Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4], x_Symbol] :> With[{q = 
 Rt[b^2 - 4*a*c, 2]}, Simp[x*((b + q + 2*c*x^2)/(2*c*Sqrt[a + b*x^2 + c*x^4 
])), x] - Simp[Rt[(b + q)/(2*a), 2]*(2*a + (b + q)*x^2)*(Sqrt[(2*a + (b - q 
)*x^2)/(2*a + (b + q)*x^2)]/(2*c*Sqrt[a + b*x^2 + c*x^4]))*EllipticE[ArcTan 
[Rt[(b + q)/(2*a), 2]*x], 2*(q/(b + q))], x] /; PosQ[(b + q)/a] &&  !(PosQ[ 
(b - q)/a] && SimplerSqrtQ[(b - q)/(2*a), (b + q)/(2*a)])] /; FreeQ[{a, b, 
c}, x] && GtQ[b^2 - 4*a*c, 0]
 

rule 1503
Int[((d_) + (e_.)*(x_)^2)/Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4], x_Symbo 
l] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[d   Int[1/Sqrt[a + b*x^2 + c*x^4] 
, x], x] + Simp[e   Int[x^2/Sqrt[a + b*x^2 + c*x^4], x], x] /; PosQ[(b + q) 
/a] || PosQ[(b - q)/a]] /; FreeQ[{a, b, c, d, e}, x] && GtQ[b^2 - 4*a*c, 0]
 

rule 2004
Int[(u_)*((d_) + (e_.)*(x_))^(q_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.) 
, x_Symbol] :> Int[u*(d + e*x)^(p + q)*(a/d + (c/e)*x)^p, x] /; FreeQ[{a, b 
, c, d, e, q}, x] && EqQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[p]
 

rule 2469
Int[(Fx_.)*((a_.)*(x_)^(r_.) + (b_.)*(x_)^(s_.) + (c_.)*(x_)^(t_.))^(p_), x 
_Symbol] :> Simp[(a*x^r + b*x^s + c*x^t)^p/(x^(p*r)*(a + b*x^(s - r) + c*x^ 
(t - r))^p)   Int[x^(p*r)*(a + b*x^(s - r) + c*x^(t - r))^p*Fx, x], x] /; F 
reeQ[{a, b, c, p, r, s, t}, x] &&  !IntegerQ[p] && PosQ[s - r] && PosQ[t - 
r] &&  !(EqQ[p, 1] && EqQ[Fx, 1])
 
Maple [A] (verified)

Time = 0.43 (sec) , antiderivative size = 132, normalized size of antiderivative = 0.86

method result size
default \(\frac {2 \sqrt {x^{3}+3 x^{2}+2 x}}{3}+\frac {73 \sqrt {2 x +4}\, \sqrt {-1-x}\, \sqrt {-2 x}\, \operatorname {EllipticF}\left (\frac {\sqrt {2 x +4}}{2}, \sqrt {2}\right )}{3 \sqrt {x^{3}+3 x^{2}+2 x}}+\frac {8 \sqrt {2 x +4}\, \sqrt {-1-x}\, \sqrt {-2 x}\, \left (-\operatorname {EllipticE}\left (\frac {\sqrt {2 x +4}}{2}, \sqrt {2}\right )-\operatorname {EllipticF}\left (\frac {\sqrt {2 x +4}}{2}, \sqrt {2}\right )\right )}{\sqrt {x^{3}+3 x^{2}+2 x}}\) \(132\)
elliptic \(\frac {2 \sqrt {x^{3}+3 x^{2}+2 x}}{3}+\frac {73 \sqrt {2 x +4}\, \sqrt {-1-x}\, \sqrt {-2 x}\, \operatorname {EllipticF}\left (\frac {\sqrt {2 x +4}}{2}, \sqrt {2}\right )}{3 \sqrt {x^{3}+3 x^{2}+2 x}}+\frac {8 \sqrt {2 x +4}\, \sqrt {-1-x}\, \sqrt {-2 x}\, \left (-\operatorname {EllipticE}\left (\frac {\sqrt {2 x +4}}{2}, \sqrt {2}\right )-\operatorname {EllipticF}\left (\frac {\sqrt {2 x +4}}{2}, \sqrt {2}\right )\right )}{\sqrt {x^{3}+3 x^{2}+2 x}}\) \(132\)
risch \(\frac {2 x \left (x^{2}+3 x +2\right )}{3 \sqrt {x \left (x^{2}+3 x +2\right )}}+\frac {73 \sqrt {2 x +4}\, \sqrt {-1-x}\, \sqrt {-2 x}\, \operatorname {EllipticF}\left (\frac {\sqrt {2 x +4}}{2}, \sqrt {2}\right )}{3 \sqrt {x^{3}+3 x^{2}+2 x}}+\frac {8 \sqrt {2 x +4}\, \sqrt {-1-x}\, \sqrt {-2 x}\, \left (-\operatorname {EllipticE}\left (\frac {\sqrt {2 x +4}}{2}, \sqrt {2}\right )-\operatorname {EllipticF}\left (\frac {\sqrt {2 x +4}}{2}, \sqrt {2}\right )\right )}{\sqrt {x^{3}+3 x^{2}+2 x}}\) \(139\)

Input:

int((5+x)^2/(x^3+3*x^2+2*x)^(1/2),x,method=_RETURNVERBOSE)
 

Output:

2/3*(x^3+3*x^2+2*x)^(1/2)+73/3*(2*x+4)^(1/2)*(-1-x)^(1/2)*(-2*x)^(1/2)/(x^ 
3+3*x^2+2*x)^(1/2)*EllipticF(1/2*(2*x+4)^(1/2),2^(1/2))+8*(2*x+4)^(1/2)*(- 
1-x)^(1/2)*(-2*x)^(1/2)/(x^3+3*x^2+2*x)^(1/2)*(-EllipticE(1/2*(2*x+4)^(1/2 
),2^(1/2))-EllipticF(1/2*(2*x+4)^(1/2),2^(1/2)))
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.24 \[ \int \frac {(5+x)^2}{\sqrt {2 x+3 x^2+x^3}} \, dx=\frac {2}{3} \, \sqrt {x^{3} + 3 \, x^{2} + 2 \, x} + \frac {98}{3} \, {\rm weierstrassPInverse}\left (4, 0, x + 1\right ) - 16 \, {\rm weierstrassZeta}\left (4, 0, {\rm weierstrassPInverse}\left (4, 0, x + 1\right )\right ) \] Input:

integrate((5+x)^2/(x^3+3*x^2+2*x)^(1/2),x, algorithm="fricas")
 

Output:

2/3*sqrt(x^3 + 3*x^2 + 2*x) + 98/3*weierstrassPInverse(4, 0, x + 1) - 16*w 
eierstrassZeta(4, 0, weierstrassPInverse(4, 0, x + 1))
 

Sympy [F]

\[ \int \frac {(5+x)^2}{\sqrt {2 x+3 x^2+x^3}} \, dx=\int \frac {\left (x + 5\right )^{2}}{\sqrt {x \left (x + 1\right ) \left (x + 2\right )}}\, dx \] Input:

integrate((5+x)**2/(x**3+3*x**2+2*x)**(1/2),x)
 

Output:

Integral((x + 5)**2/sqrt(x*(x + 1)*(x + 2)), x)
 

Maxima [F]

\[ \int \frac {(5+x)^2}{\sqrt {2 x+3 x^2+x^3}} \, dx=\int { \frac {{\left (x + 5\right )}^{2}}{\sqrt {x^{3} + 3 \, x^{2} + 2 \, x}} \,d x } \] Input:

integrate((5+x)^2/(x^3+3*x^2+2*x)^(1/2),x, algorithm="maxima")
 

Output:

integrate((x + 5)^2/sqrt(x^3 + 3*x^2 + 2*x), x)
 

Giac [F]

\[ \int \frac {(5+x)^2}{\sqrt {2 x+3 x^2+x^3}} \, dx=\int { \frac {{\left (x + 5\right )}^{2}}{\sqrt {x^{3} + 3 \, x^{2} + 2 \, x}} \,d x } \] Input:

integrate((5+x)^2/(x^3+3*x^2+2*x)^(1/2),x, algorithm="giac")
 

Output:

integrate((x + 5)^2/sqrt(x^3 + 3*x^2 + 2*x), x)
 

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.58 \[ \int \frac {(5+x)^2}{\sqrt {2 x+3 x^2+x^3}} \, dx=\frac {4\,x+6\,x^2+2\,x^3+48\,\sqrt {-x}\,\mathrm {E}\left (\mathrm {asin}\left (\sqrt {-x-1}\right )\middle |-1\right )\,\sqrt {-x-1}\,\sqrt {x+2}-146\,\sqrt {-x}\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {-x-1}\right )\middle |-1\right )\,\sqrt {-x-1}\,\sqrt {x+2}}{3\,\sqrt {x^3+3\,x^2+2\,x}} \] Input:

int((x + 5)^2/(2*x + 3*x^2 + x^3)^(1/2),x)
 

Output:

(4*x + 6*x^2 + 2*x^3 + 48*(-x)^(1/2)*ellipticE(asin((- x - 1)^(1/2)), -1)* 
(- x - 1)^(1/2)*(x + 2)^(1/2) - 146*(-x)^(1/2)*ellipticF(asin((- x - 1)^(1 
/2)), -1)*(- x - 1)^(1/2)*(x + 2)^(1/2))/(3*(2*x + 3*x^2 + x^3)^(1/2))
 

Reduce [F]

\[ \int \frac {(5+x)^2}{\sqrt {2 x+3 x^2+x^3}} \, dx=\frac {10 \sqrt {x}\, \sqrt {x^{2}+3 x +2}}{3}-4 \left (\int \frac {\sqrt {x}\, \sqrt {x^{2}+3 x +2}\, x}{x^{2}+3 x +2}d x \right )+\frac {65 \left (\int \frac {\sqrt {x}\, \sqrt {x^{2}+3 x +2}}{x^{3}+3 x^{2}+2 x}d x \right )}{3} \] Input:

int((5+x)^2/(x^3+3*x^2+2*x)^(1/2),x)
 

Output:

(10*sqrt(x)*sqrt(x**2 + 3*x + 2) - 12*int((sqrt(x)*sqrt(x**2 + 3*x + 2)*x) 
/(x**2 + 3*x + 2),x) + 65*int((sqrt(x)*sqrt(x**2 + 3*x + 2))/(x**3 + 3*x** 
2 + 2*x),x))/3