\(\int \frac {x^2 (A+B x)}{\sqrt {a+b x+c x^2}} \, dx\) [145]

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

Optimal result

Integrand size = 23, antiderivative size = 143 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x+c x^2}} \, dx=\frac {B x^2 \sqrt {a+b x+c x^2}}{3 c}+\frac {\left (15 b^2 B-18 A b c-16 a B c-2 c (5 b B-6 A c) x\right ) \sqrt {a+b x+c x^2}}{24 c^3}-\frac {\left (5 b^3 B-6 A b^2 c-12 a b B c+8 a A c^2\right ) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{16 c^{7/2}} \] Output:

1/3*B*x^2*(c*x^2+b*x+a)^(1/2)/c+1/24*(15*B*b^2-18*A*b*c-16*B*a*c-2*c*(-6*A 
*c+5*B*b)*x)*(c*x^2+b*x+a)^(1/2)/c^3-1/16*(8*A*a*c^2-6*A*b^2*c-12*B*a*b*c+ 
5*B*b^3)*arctanh(1/2*(2*c*x+b)/c^(1/2)/(c*x^2+b*x+a)^(1/2))/c^(7/2)
 

Mathematica [A] (verified)

Time = 0.56 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.87 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x+c x^2}} \, dx=\frac {2 \sqrt {c} \sqrt {a+x (b+c x)} \left (15 b^2 B-2 b c (9 A+5 B x)+4 c (-4 a B+c x (3 A+2 B x))\right )+3 \left (5 b^3 B-6 A b^2 c-12 a b B c+8 a A c^2\right ) \log \left (b+2 c x-2 \sqrt {c} \sqrt {a+x (b+c x)}\right )}{48 c^{7/2}} \] Input:

Integrate[(x^2*(A + B*x))/Sqrt[a + b*x + c*x^2],x]
 

Output:

(2*Sqrt[c]*Sqrt[a + x*(b + c*x)]*(15*b^2*B - 2*b*c*(9*A + 5*B*x) + 4*c*(-4 
*a*B + c*x*(3*A + 2*B*x))) + 3*(5*b^3*B - 6*A*b^2*c - 12*a*b*B*c + 8*a*A*c 
^2)*Log[b + 2*c*x - 2*Sqrt[c]*Sqrt[a + x*(b + c*x)]])/(48*c^(7/2))
 

Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.06, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {1236, 27, 1225, 1092, 219}

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^2 (A+B x)}{\sqrt {a+b x+c x^2}} \, dx\)

\(\Big \downarrow \) 1236

\(\displaystyle \frac {\int -\frac {x (4 a B+(5 b B-6 A c) x)}{2 \sqrt {c x^2+b x+a}}dx}{3 c}+\frac {B x^2 \sqrt {a+b x+c x^2}}{3 c}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {B x^2 \sqrt {a+b x+c x^2}}{3 c}-\frac {\int \frac {x (4 a B+(5 b B-6 A c) x)}{\sqrt {c x^2+b x+a}}dx}{6 c}\)

\(\Big \downarrow \) 1225

\(\displaystyle \frac {B x^2 \sqrt {a+b x+c x^2}}{3 c}-\frac {\frac {3 \left (8 a A c^2-12 a b B c-6 A b^2 c+5 b^3 B\right ) \int \frac {1}{\sqrt {c x^2+b x+a}}dx}{8 c^2}-\frac {\sqrt {a+b x+c x^2} \left (-16 a B c-2 c x (5 b B-6 A c)-18 A b c+15 b^2 B\right )}{4 c^2}}{6 c}\)

\(\Big \downarrow \) 1092

\(\displaystyle \frac {B x^2 \sqrt {a+b x+c x^2}}{3 c}-\frac {\frac {3 \left (8 a A c^2-12 a b B c-6 A b^2 c+5 b^3 B\right ) \int \frac {1}{4 c-\frac {(b+2 c x)^2}{c x^2+b x+a}}d\frac {b+2 c x}{\sqrt {c x^2+b x+a}}}{4 c^2}-\frac {\sqrt {a+b x+c x^2} \left (-16 a B c-2 c x (5 b B-6 A c)-18 A b c+15 b^2 B\right )}{4 c^2}}{6 c}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {B x^2 \sqrt {a+b x+c x^2}}{3 c}-\frac {\frac {3 \left (8 a A c^2-12 a b B c-6 A b^2 c+5 b^3 B\right ) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{8 c^{5/2}}-\frac {\sqrt {a+b x+c x^2} \left (-16 a B c-2 c x (5 b B-6 A c)-18 A b c+15 b^2 B\right )}{4 c^2}}{6 c}\)

Input:

Int[(x^2*(A + B*x))/Sqrt[a + b*x + c*x^2],x]
 

Output:

(B*x^2*Sqrt[a + b*x + c*x^2])/(3*c) - (-1/4*((15*b^2*B - 18*A*b*c - 16*a*B 
*c - 2*c*(5*b*B - 6*A*c)*x)*Sqrt[a + b*x + c*x^2])/c^2 + (3*(5*b^3*B - 6*A 
*b^2*c - 12*a*b*B*c + 8*a*A*c^2)*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + b 
*x + c*x^2])])/(8*c^(5/2)))/(6*c)
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 1092
Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Simp[2   Subst[I 
nt[1/(4*c - x^2), x], x, (b + 2*c*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a 
, b, c}, x]
 

rule 1225
Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*( 
x_)^2)^(p_), x_Symbol] :> Simp[(-(b*e*g*(p + 2) - c*(e*f + d*g)*(2*p + 3) - 
 2*c*e*g*(p + 1)*x))*((a + b*x + c*x^2)^(p + 1)/(2*c^2*(p + 1)*(2*p + 3))), 
 x] + Simp[(b^2*e*g*(p + 2) - 2*a*c*e*g + c*(2*c*d*f - b*(e*f + d*g))*(2*p 
+ 3))/(2*c^2*(2*p + 3))   Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c 
, d, e, f, g, p}, x] &&  !LeQ[p, -1]
 

rule 1236
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g*(d + e*x)^m*((a + b*x + c*x^2)^(p + 
1)/(c*(m + 2*p + 2))), x] + Simp[1/(c*(m + 2*p + 2))   Int[(d + e*x)^(m - 1 
)*(a + b*x + c*x^2)^p*Simp[m*(c*d*f - a*e*g) + d*(2*c*f - b*g)*(p + 1) + (m 
*(c*e*f + c*d*g - b*e*g) + e*(p + 1)*(2*c*f - b*g))*x, x], x], x] /; FreeQ[ 
{a, b, c, d, e, f, g, p}, x] && GtQ[m, 0] && NeQ[m + 2*p + 2, 0] && (Intege 
rQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p]) &&  !(IGtQ[m, 0] && EqQ[f, 0])
 
Maple [A] (verified)

Time = 1.23 (sec) , antiderivative size = 115, normalized size of antiderivative = 0.80

method result size
risch \(-\frac {\left (-8 B \,c^{2} x^{2}-12 A \,c^{2} x +10 B b c x +18 A b c +16 a B c -15 B \,b^{2}\right ) \sqrt {c \,x^{2}+b x +a}}{24 c^{3}}-\frac {\left (8 A a \,c^{2}-6 A \,b^{2} c -12 B a b c +5 B \,b^{3}\right ) \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{16 c^{\frac {7}{2}}}\) \(115\)
default \(A \left (\frac {x \sqrt {c \,x^{2}+b x +a}}{2 c}-\frac {3 b \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{4 c}-\frac {a \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )+B \left (\frac {x^{2} \sqrt {c \,x^{2}+b x +a}}{3 c}-\frac {5 b \left (\frac {x \sqrt {c \,x^{2}+b x +a}}{2 c}-\frac {3 b \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{4 c}-\frac {a \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{6 c}-\frac {2 a \left (\frac {\sqrt {c \,x^{2}+b x +a}}{c}-\frac {b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 c^{\frac {3}{2}}}\right )}{3 c}\right )\) \(295\)

Input:

int(x^2*(B*x+A)/(c*x^2+b*x+a)^(1/2),x,method=_RETURNVERBOSE)
 

Output:

-1/24*(-8*B*c^2*x^2-12*A*c^2*x+10*B*b*c*x+18*A*b*c+16*B*a*c-15*B*b^2)/c^3* 
(c*x^2+b*x+a)^(1/2)-1/16*(8*A*a*c^2-6*A*b^2*c-12*B*a*b*c+5*B*b^3)/c^(7/2)* 
ln((1/2*b+c*x)/c^(1/2)+(c*x^2+b*x+a)^(1/2))
 

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 295, normalized size of antiderivative = 2.06 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x+c x^2}} \, dx=\left [\frac {3 \, {\left (5 \, B b^{3} + 8 \, A a c^{2} - 6 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} \sqrt {c} \log \left (-8 \, c^{2} x^{2} - 8 \, b c x - b^{2} + 4 \, \sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {c} - 4 \, a c\right ) + 4 \, {\left (8 \, B c^{3} x^{2} + 15 \, B b^{2} c - 2 \, {\left (8 \, B a + 9 \, A b\right )} c^{2} - 2 \, {\left (5 \, B b c^{2} - 6 \, A c^{3}\right )} x\right )} \sqrt {c x^{2} + b x + a}}{96 \, c^{4}}, \frac {3 \, {\left (5 \, B b^{3} + 8 \, A a c^{2} - 6 \, {\left (2 \, B a b + A b^{2}\right )} c\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {-c}}{2 \, {\left (c^{2} x^{2} + b c x + a c\right )}}\right ) + 2 \, {\left (8 \, B c^{3} x^{2} + 15 \, B b^{2} c - 2 \, {\left (8 \, B a + 9 \, A b\right )} c^{2} - 2 \, {\left (5 \, B b c^{2} - 6 \, A c^{3}\right )} x\right )} \sqrt {c x^{2} + b x + a}}{48 \, c^{4}}\right ] \] Input:

integrate(x^2*(B*x+A)/(c*x^2+b*x+a)^(1/2),x, algorithm="fricas")
 

Output:

[1/96*(3*(5*B*b^3 + 8*A*a*c^2 - 6*(2*B*a*b + A*b^2)*c)*sqrt(c)*log(-8*c^2* 
x^2 - 8*b*c*x - b^2 + 4*sqrt(c*x^2 + b*x + a)*(2*c*x + b)*sqrt(c) - 4*a*c) 
 + 4*(8*B*c^3*x^2 + 15*B*b^2*c - 2*(8*B*a + 9*A*b)*c^2 - 2*(5*B*b*c^2 - 6* 
A*c^3)*x)*sqrt(c*x^2 + b*x + a))/c^4, 1/48*(3*(5*B*b^3 + 8*A*a*c^2 - 6*(2* 
B*a*b + A*b^2)*c)*sqrt(-c)*arctan(1/2*sqrt(c*x^2 + b*x + a)*(2*c*x + b)*sq 
rt(-c)/(c^2*x^2 + b*c*x + a*c)) + 2*(8*B*c^3*x^2 + 15*B*b^2*c - 2*(8*B*a + 
 9*A*b)*c^2 - 2*(5*B*b*c^2 - 6*A*c^3)*x)*sqrt(c*x^2 + b*x + a))/c^4]
 

Sympy [A] (verification not implemented)

Time = 0.58 (sec) , antiderivative size = 292, normalized size of antiderivative = 2.04 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x+c x^2}} \, dx=\begin {cases} \left (- \frac {a \left (A - \frac {5 B b}{6 c}\right )}{2 c} - \frac {b \left (- \frac {2 B a}{3 c} - \frac {3 b \left (A - \frac {5 B b}{6 c}\right )}{4 c}\right )}{2 c}\right ) \left (\begin {cases} \frac {\log {\left (b + 2 \sqrt {c} \sqrt {a + b x + c x^{2}} + 2 c x \right )}}{\sqrt {c}} & \text {for}\: a - \frac {b^{2}}{4 c} \neq 0 \\\frac {\left (\frac {b}{2 c} + x\right ) \log {\left (\frac {b}{2 c} + x \right )}}{\sqrt {c \left (\frac {b}{2 c} + x\right )^{2}}} & \text {otherwise} \end {cases}\right ) + \sqrt {a + b x + c x^{2}} \left (\frac {B x^{2}}{3 c} + \frac {x \left (A - \frac {5 B b}{6 c}\right )}{2 c} + \frac {- \frac {2 B a}{3 c} - \frac {3 b \left (A - \frac {5 B b}{6 c}\right )}{4 c}}{c}\right ) & \text {for}\: c \neq 0 \\\frac {2 \left (\frac {B \left (a + b x\right )^{\frac {7}{2}}}{7 b} + \frac {\left (a + b x\right )^{\frac {5}{2}} \left (A b - 3 B a\right )}{5 b} + \frac {\left (a + b x\right )^{\frac {3}{2}} \left (- 2 A a b + 3 B a^{2}\right )}{3 b} + \frac {\sqrt {a + b x} \left (A a^{2} b - B a^{3}\right )}{b}\right )}{b^{3}} & \text {for}\: b \neq 0 \\\frac {\frac {A x^{3}}{3} + \frac {B x^{4}}{4}}{\sqrt {a}} & \text {otherwise} \end {cases} \] Input:

integrate(x**2*(B*x+A)/(c*x**2+b*x+a)**(1/2),x)
 

Output:

Piecewise(((-a*(A - 5*B*b/(6*c))/(2*c) - b*(-2*B*a/(3*c) - 3*b*(A - 5*B*b/ 
(6*c))/(4*c))/(2*c))*Piecewise((log(b + 2*sqrt(c)*sqrt(a + b*x + c*x**2) + 
 2*c*x)/sqrt(c), Ne(a - b**2/(4*c), 0)), ((b/(2*c) + x)*log(b/(2*c) + x)/s 
qrt(c*(b/(2*c) + x)**2), True)) + sqrt(a + b*x + c*x**2)*(B*x**2/(3*c) + x 
*(A - 5*B*b/(6*c))/(2*c) + (-2*B*a/(3*c) - 3*b*(A - 5*B*b/(6*c))/(4*c))/c) 
, Ne(c, 0)), (2*(B*(a + b*x)**(7/2)/(7*b) + (a + b*x)**(5/2)*(A*b - 3*B*a) 
/(5*b) + (a + b*x)**(3/2)*(-2*A*a*b + 3*B*a**2)/(3*b) + sqrt(a + b*x)*(A*a 
**2*b - B*a**3)/b)/b**3, Ne(b, 0)), ((A*x**3/3 + B*x**4/4)/sqrt(a), True))
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x+c x^2}} \, dx=\text {Exception raised: ValueError} \] Input:

integrate(x^2*(B*x+A)/(c*x^2+b*x+a)^(1/2),x, algorithm="maxima")
 

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` for 
 more deta
 

Giac [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 126, normalized size of antiderivative = 0.88 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x+c x^2}} \, dx=\frac {1}{24} \, \sqrt {c x^{2} + b x + a} {\left (2 \, {\left (\frac {4 \, B x}{c} - \frac {5 \, B b c - 6 \, A c^{2}}{c^{3}}\right )} x + \frac {15 \, B b^{2} - 16 \, B a c - 18 \, A b c}{c^{3}}\right )} + \frac {{\left (5 \, B b^{3} - 12 \, B a b c - 6 \, A b^{2} c + 8 \, A a c^{2}\right )} \log \left ({\left | 2 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} \sqrt {c} + b \right |}\right )}{16 \, c^{\frac {7}{2}}} \] Input:

integrate(x^2*(B*x+A)/(c*x^2+b*x+a)^(1/2),x, algorithm="giac")
 

Output:

1/24*sqrt(c*x^2 + b*x + a)*(2*(4*B*x/c - (5*B*b*c - 6*A*c^2)/c^3)*x + (15* 
B*b^2 - 16*B*a*c - 18*A*b*c)/c^3) + 1/16*(5*B*b^3 - 12*B*a*b*c - 6*A*b^2*c 
 + 8*A*a*c^2)*log(abs(2*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))*sqrt(c) + b))/ 
c^(7/2)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x+c x^2}} \, dx=\int \frac {x^2\,\left (A+B\,x\right )}{\sqrt {c\,x^2+b\,x+a}} \,d x \] Input:

int((x^2*(A + B*x))/(a + b*x + c*x^2)^(1/2),x)
 

Output:

int((x^2*(A + B*x))/(a + b*x + c*x^2)^(1/2), x)
 

Reduce [B] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 233, normalized size of antiderivative = 1.63 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x+c x^2}} \, dx=\frac {-68 \sqrt {c \,x^{2}+b x +a}\, a b \,c^{2}+24 \sqrt {c \,x^{2}+b x +a}\, a \,c^{3} x +30 \sqrt {c \,x^{2}+b x +a}\, b^{3} c -20 \sqrt {c \,x^{2}+b x +a}\, b^{2} c^{2} x +16 \sqrt {c \,x^{2}+b x +a}\, b \,c^{3} x^{2}-24 \sqrt {c}\, \mathrm {log}\left (\frac {2 \sqrt {c}\, \sqrt {c \,x^{2}+b x +a}+b +2 c x}{\sqrt {4 a c -b^{2}}}\right ) a^{2} c^{2}+54 \sqrt {c}\, \mathrm {log}\left (\frac {2 \sqrt {c}\, \sqrt {c \,x^{2}+b x +a}+b +2 c x}{\sqrt {4 a c -b^{2}}}\right ) a \,b^{2} c -15 \sqrt {c}\, \mathrm {log}\left (\frac {2 \sqrt {c}\, \sqrt {c \,x^{2}+b x +a}+b +2 c x}{\sqrt {4 a c -b^{2}}}\right ) b^{4}}{48 c^{4}} \] Input:

int(x^2*(B*x+A)/(c*x^2+b*x+a)^(1/2),x)
 

Output:

( - 68*sqrt(a + b*x + c*x**2)*a*b*c**2 + 24*sqrt(a + b*x + c*x**2)*a*c**3* 
x + 30*sqrt(a + b*x + c*x**2)*b**3*c - 20*sqrt(a + b*x + c*x**2)*b**2*c**2 
*x + 16*sqrt(a + b*x + c*x**2)*b*c**3*x**2 - 24*sqrt(c)*log((2*sqrt(c)*sqr 
t(a + b*x + c*x**2) + b + 2*c*x)/sqrt(4*a*c - b**2))*a**2*c**2 + 54*sqrt(c 
)*log((2*sqrt(c)*sqrt(a + b*x + c*x**2) + b + 2*c*x)/sqrt(4*a*c - b**2))*a 
*b**2*c - 15*sqrt(c)*log((2*sqrt(c)*sqrt(a + b*x + c*x**2) + b + 2*c*x)/sq 
rt(4*a*c - b**2))*b**4)/(48*c**4)