\(\int \frac {(d+e x+f x^2)^2}{\sqrt {a+b x+c x^2}} \, dx\) [148]

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

Optimal result

Integrand size = 27, antiderivative size = 316 \[ \int \frac {\left (d+e x+f x^2\right )^2}{\sqrt {a+b x+c x^2}} \, dx=\frac {\left (384 c^3 d e-105 b^3 f^2+20 b c f (12 b e+11 a f)-16 c^2 \left (16 a e f+9 b \left (e^2+2 d f\right )\right )\right ) \sqrt {a+b x+c x^2}}{192 c^4}+\frac {\left (35 b^2 f^2-4 c f (20 b e+9 a f)+48 c^2 \left (e^2+2 d f\right )\right ) x \sqrt {a+b x+c x^2}}{96 c^3}+\frac {f (16 c e-7 b f) x^2 \sqrt {a+b x+c x^2}}{24 c^2}+\frac {f^2 x^3 \sqrt {a+b x+c x^2}}{4 c}+\frac {\left (128 c^4 d^2+35 b^4 f^2-40 b^2 c f (2 b e+3 a f)-64 c^3 \left (2 b d e+a \left (e^2+2 d f\right )\right )+48 c^2 \left (4 a b e f+a^2 f^2+b^2 \left (e^2+2 d f\right )\right )\right ) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{128 c^{9/2}} \] Output:

1/192*(384*c^3*d*e-105*b^3*f^2+20*b*c*f*(11*a*f+12*b*e)-16*c^2*(16*a*e*f+9 
*b*(2*d*f+e^2)))*(c*x^2+b*x+a)^(1/2)/c^4+1/96*(35*b^2*f^2-4*c*f*(9*a*f+20* 
b*e)+48*c^2*(2*d*f+e^2))*x*(c*x^2+b*x+a)^(1/2)/c^3+1/24*f*(-7*b*f+16*c*e)* 
x^2*(c*x^2+b*x+a)^(1/2)/c^2+1/4*f^2*x^3*(c*x^2+b*x+a)^(1/2)/c+1/128*(128*c 
^4*d^2+35*b^4*f^2-40*b^2*c*f*(3*a*f+2*b*e)-64*c^3*(2*b*d*e+a*(2*d*f+e^2))+ 
48*c^2*(4*a*b*e*f+a^2*f^2+b^2*(2*d*f+e^2)))*arctanh(1/2*(2*c*x+b)/c^(1/2)/ 
(c*x^2+b*x+a)^(1/2))/c^(9/2)
 

Mathematica [A] (verified)

Time = 2.14 (sec) , antiderivative size = 254, normalized size of antiderivative = 0.80 \[ \int \frac {\left (d+e x+f x^2\right )^2}{\sqrt {a+b x+c x^2}} \, dx=\frac {\sqrt {c} \sqrt {a+x (b+c x)} \left (-105 b^3 f^2+10 b c f (24 b e+22 a f+7 b f x)+16 c^3 \left (12 d (2 e+f x)+x \left (6 e^2+8 e f x+3 f^2 x^2\right )\right )-8 c^2 \left (a f (32 e+9 f x)+b \left (18 e^2+36 d f+20 e f x+7 f^2 x^2\right )\right )\right )+3 \left (128 c^4 d^2+35 b^4 f^2-40 b^2 c f (2 b e+3 a f)-64 c^3 \left (2 b d e+a \left (e^2+2 d f\right )\right )+48 c^2 \left (4 a b e f+a^2 f^2+b^2 \left (e^2+2 d f\right )\right )\right ) \text {arctanh}\left (\frac {\sqrt {c} x}{-\sqrt {a}+\sqrt {a+x (b+c x)}}\right )}{192 c^{9/2}} \] Input:

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

Output:

(Sqrt[c]*Sqrt[a + x*(b + c*x)]*(-105*b^3*f^2 + 10*b*c*f*(24*b*e + 22*a*f + 
 7*b*f*x) + 16*c^3*(12*d*(2*e + f*x) + x*(6*e^2 + 8*e*f*x + 3*f^2*x^2)) - 
8*c^2*(a*f*(32*e + 9*f*x) + b*(18*e^2 + 36*d*f + 20*e*f*x + 7*f^2*x^2))) + 
 3*(128*c^4*d^2 + 35*b^4*f^2 - 40*b^2*c*f*(2*b*e + 3*a*f) - 64*c^3*(2*b*d* 
e + a*(e^2 + 2*d*f)) + 48*c^2*(4*a*b*e*f + a^2*f^2 + b^2*(e^2 + 2*d*f)))*A 
rcTanh[(Sqrt[c]*x)/(-Sqrt[a] + Sqrt[a + x*(b + c*x)])])/(192*c^(9/2))
 

Rubi [A] (verified)

Time = 0.87 (sec) , antiderivative size = 337, normalized size of antiderivative = 1.07, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2192, 27, 2192, 27, 2192, 27, 1160, 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 {\left (d+e x+f x^2\right )^2}{\sqrt {a+b x+c x^2}} \, dx\)

\(\Big \downarrow \) 2192

\(\displaystyle \frac {\int \frac {f (16 c e-7 b f) x^3-2 \left (3 a f^2-4 c \left (e^2+2 d f\right )\right ) x^2+16 c d e x+8 c d^2}{2 \sqrt {c x^2+b x+a}}dx}{4 c}+\frac {f^2 x^3 \sqrt {a+b x+c x^2}}{4 c}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\int \frac {f (16 c e-7 b f) x^3-2 \left (3 a f^2-4 c \left (e^2+2 d f\right )\right ) x^2+16 c d e x+8 c d^2}{\sqrt {c x^2+b x+a}}dx}{8 c}+\frac {f^2 x^3 \sqrt {a+b x+c x^2}}{4 c}\)

\(\Big \downarrow \) 2192

\(\displaystyle \frac {\frac {\int \frac {48 c^2 d^2+\left (48 \left (e^2+2 d f\right ) c^2-4 f (20 b e+9 a f) c+35 b^2 f^2\right ) x^2+4 \left (24 d e c^2-16 a e f c+7 a b f^2\right ) x}{2 \sqrt {c x^2+b x+a}}dx}{3 c}+\frac {f x^2 \sqrt {a+b x+c x^2} (16 c e-7 b f)}{3 c}}{8 c}+\frac {f^2 x^3 \sqrt {a+b x+c x^2}}{4 c}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {\int \frac {48 c^2 d^2+\left (48 \left (e^2+2 d f\right ) c^2-4 f (20 b e+9 a f) c+35 b^2 f^2\right ) x^2+4 \left (24 d e c^2-16 a e f c+7 a b f^2\right ) x}{\sqrt {c x^2+b x+a}}dx}{6 c}+\frac {f x^2 \sqrt {a+b x+c x^2} (16 c e-7 b f)}{3 c}}{8 c}+\frac {f^2 x^3 \sqrt {a+b x+c x^2}}{4 c}\)

\(\Big \downarrow \) 2192

\(\displaystyle \frac {\frac {\frac {\int \frac {192 d^2 c^3-96 a \left (e^2+2 d f\right ) c^2+8 a f (20 b e+9 a f) c-70 a b^2 f^2+\left (-105 f^2 b^3+20 c f (12 b e+11 a f) b+384 c^3 d e-16 c^2 \left (16 a e f+9 b \left (e^2+2 d f\right )\right )\right ) x}{2 \sqrt {c x^2+b x+a}}dx}{2 c}+\frac {x \sqrt {a+b x+c x^2} \left (-4 c f (9 a f+20 b e)+35 b^2 f^2+48 c^2 \left (2 d f+e^2\right )\right )}{2 c}}{6 c}+\frac {f x^2 \sqrt {a+b x+c x^2} (16 c e-7 b f)}{3 c}}{8 c}+\frac {f^2 x^3 \sqrt {a+b x+c x^2}}{4 c}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {\frac {\int \frac {2 \left (96 d^2 c^3-48 a \left (e^2+2 d f\right ) c^2+4 a f (20 b e+9 a f) c-35 a b^2 f^2\right )+\left (-105 f^2 b^3+20 c f (12 b e+11 a f) b+384 c^3 d e-16 c^2 \left (16 a e f+9 b \left (e^2+2 d f\right )\right )\right ) x}{\sqrt {c x^2+b x+a}}dx}{4 c}+\frac {x \sqrt {a+b x+c x^2} \left (-4 c f (9 a f+20 b e)+35 b^2 f^2+48 c^2 \left (2 d f+e^2\right )\right )}{2 c}}{6 c}+\frac {f x^2 \sqrt {a+b x+c x^2} (16 c e-7 b f)}{3 c}}{8 c}+\frac {f^2 x^3 \sqrt {a+b x+c x^2}}{4 c}\)

\(\Big \downarrow \) 1160

\(\displaystyle \frac {\frac {\frac {\frac {3 \left (48 c^2 \left (a^2 f^2+4 a b e f+b^2 \left (2 d f+e^2\right )\right )-40 b^2 c f (3 a f+2 b e)-64 c^3 \left (a \left (2 d f+e^2\right )+2 b d e\right )+35 b^4 f^2+128 c^4 d^2\right ) \int \frac {1}{\sqrt {c x^2+b x+a}}dx}{2 c}+\frac {\sqrt {a+b x+c x^2} \left (-16 c^2 \left (16 a e f+9 b \left (2 d f+e^2\right )\right )+20 b c f (11 a f+12 b e)-105 b^3 f^2+384 c^3 d e\right )}{c}}{4 c}+\frac {x \sqrt {a+b x+c x^2} \left (-4 c f (9 a f+20 b e)+35 b^2 f^2+48 c^2 \left (2 d f+e^2\right )\right )}{2 c}}{6 c}+\frac {f x^2 \sqrt {a+b x+c x^2} (16 c e-7 b f)}{3 c}}{8 c}+\frac {f^2 x^3 \sqrt {a+b x+c x^2}}{4 c}\)

\(\Big \downarrow \) 1092

\(\displaystyle \frac {\frac {\frac {\frac {3 \left (48 c^2 \left (a^2 f^2+4 a b e f+b^2 \left (2 d f+e^2\right )\right )-40 b^2 c f (3 a f+2 b e)-64 c^3 \left (a \left (2 d f+e^2\right )+2 b d e\right )+35 b^4 f^2+128 c^4 d^2\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}}}{c}+\frac {\sqrt {a+b x+c x^2} \left (-16 c^2 \left (16 a e f+9 b \left (2 d f+e^2\right )\right )+20 b c f (11 a f+12 b e)-105 b^3 f^2+384 c^3 d e\right )}{c}}{4 c}+\frac {x \sqrt {a+b x+c x^2} \left (-4 c f (9 a f+20 b e)+35 b^2 f^2+48 c^2 \left (2 d f+e^2\right )\right )}{2 c}}{6 c}+\frac {f x^2 \sqrt {a+b x+c x^2} (16 c e-7 b f)}{3 c}}{8 c}+\frac {f^2 x^3 \sqrt {a+b x+c x^2}}{4 c}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {\frac {\frac {\frac {3 \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right ) \left (48 c^2 \left (a^2 f^2+4 a b e f+b^2 \left (2 d f+e^2\right )\right )-40 b^2 c f (3 a f+2 b e)-64 c^3 \left (a \left (2 d f+e^2\right )+2 b d e\right )+35 b^4 f^2+128 c^4 d^2\right )}{2 c^{3/2}}+\frac {\sqrt {a+b x+c x^2} \left (-16 c^2 \left (16 a e f+9 b \left (2 d f+e^2\right )\right )+20 b c f (11 a f+12 b e)-105 b^3 f^2+384 c^3 d e\right )}{c}}{4 c}+\frac {x \sqrt {a+b x+c x^2} \left (-4 c f (9 a f+20 b e)+35 b^2 f^2+48 c^2 \left (2 d f+e^2\right )\right )}{2 c}}{6 c}+\frac {f x^2 \sqrt {a+b x+c x^2} (16 c e-7 b f)}{3 c}}{8 c}+\frac {f^2 x^3 \sqrt {a+b x+c x^2}}{4 c}\)

Input:

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

Output:

(f^2*x^3*Sqrt[a + b*x + c*x^2])/(4*c) + ((f*(16*c*e - 7*b*f)*x^2*Sqrt[a + 
b*x + c*x^2])/(3*c) + (((35*b^2*f^2 - 4*c*f*(20*b*e + 9*a*f) + 48*c^2*(e^2 
 + 2*d*f))*x*Sqrt[a + b*x + c*x^2])/(2*c) + (((384*c^3*d*e - 105*b^3*f^2 + 
 20*b*c*f*(12*b*e + 11*a*f) - 16*c^2*(16*a*e*f + 9*b*(e^2 + 2*d*f)))*Sqrt[ 
a + b*x + c*x^2])/c + (3*(128*c^4*d^2 + 35*b^4*f^2 - 40*b^2*c*f*(2*b*e + 3 
*a*f) - 64*c^3*(2*b*d*e + a*(e^2 + 2*d*f)) + 48*c^2*(4*a*b*e*f + a^2*f^2 + 
 b^2*(e^2 + 2*d*f)))*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2]) 
])/(2*c^(3/2)))/(4*c))/(6*c))/(8*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 1160
Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol 
] :> Simp[e*((a + b*x + c*x^2)^(p + 1)/(2*c*(p + 1))), x] + Simp[(2*c*d - b 
*e)/(2*c)   Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, p}, x] 
 && NeQ[p, -1]
 

rule 2192
Int[(Pq_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = 
Expon[Pq, x], e = Coeff[Pq, x, Expon[Pq, x]]}, Simp[e*x^(q - 1)*((a + b*x + 
 c*x^2)^(p + 1)/(c*(q + 2*p + 1))), x] + Simp[1/(c*(q + 2*p + 1))   Int[(a 
+ b*x + c*x^2)^p*ExpandToSum[c*(q + 2*p + 1)*Pq - a*e*(q - 1)*x^(q - 2) - b 
*e*(q + p)*x^(q - 1) - c*e*(q + 2*p + 1)*x^q, x], x], x]] /; FreeQ[{a, b, c 
, p}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] &&  !LeQ[p, -1]
 
Maple [A] (verified)

Time = 2.42 (sec) , antiderivative size = 286, normalized size of antiderivative = 0.91

method result size
risch \(\frac {\left (48 c^{3} f^{2} x^{3}-56 b \,c^{2} f^{2} x^{2}+128 c^{3} e f \,x^{2}-72 a \,c^{2} f^{2} x +70 b^{2} c \,f^{2} x -160 b \,c^{2} e f x +192 c^{3} d f x +96 c^{3} e^{2} x +220 a b c \,f^{2}-256 a \,c^{2} e f -105 b^{3} f^{2}+240 b^{2} c e f -288 b \,c^{2} d f -144 b \,c^{2} e^{2}+384 c^{3} d e \right ) \sqrt {c \,x^{2}+b x +a}}{192 c^{4}}+\frac {\left (48 a^{2} c^{2} f^{2}-120 a \,b^{2} c \,f^{2}+192 a b \,c^{2} e f -128 a \,c^{3} d f -64 e^{2} a \,c^{3}+35 b^{4} f^{2}-80 b^{3} c e f +96 b^{2} c^{2} d f +48 b^{2} c^{2} e^{2}-128 c^{3} d e b +128 c^{4} d^{2}\right ) \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{128 c^{\frac {9}{2}}}\) \(286\)
default \(\frac {d^{2} \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{\sqrt {c}}+f^{2} \left (\frac {x^{3} \sqrt {c \,x^{2}+b x +a}}{4 c}-\frac {7 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 )}{8 c}-\frac {3 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 )}{4 c}\right )+\left (2 d f +e^{2}\right ) \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 )+2 d e \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 )+2 e f \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 )\) \(714\)

Input:

int((f*x^2+e*x+d)^2/(c*x^2+b*x+a)^(1/2),x,method=_RETURNVERBOSE)
 

Output:

1/192*(48*c^3*f^2*x^3-56*b*c^2*f^2*x^2+128*c^3*e*f*x^2-72*a*c^2*f^2*x+70*b 
^2*c*f^2*x-160*b*c^2*e*f*x+192*c^3*d*f*x+96*c^3*e^2*x+220*a*b*c*f^2-256*a* 
c^2*e*f-105*b^3*f^2+240*b^2*c*e*f-288*b*c^2*d*f-144*b*c^2*e^2+384*c^3*d*e) 
/c^4*(c*x^2+b*x+a)^(1/2)+1/128*(48*a^2*c^2*f^2-120*a*b^2*c*f^2+192*a*b*c^2 
*e*f-128*a*c^3*d*f-64*a*c^3*e^2+35*b^4*f^2-80*b^3*c*e*f+96*b^2*c^2*d*f+48* 
b^2*c^2*e^2-128*b*c^3*d*e+128*c^4*d^2)/c^(9/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.19 (sec) , antiderivative size = 637, normalized size of antiderivative = 2.02 \[ \int \frac {\left (d+e x+f x^2\right )^2}{\sqrt {a+b x+c x^2}} \, dx=\left [\frac {3 \, {\left (128 \, c^{4} d^{2} - 128 \, b c^{3} d e + 16 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} e^{2} + {\left (35 \, b^{4} - 120 \, a b^{2} c + 48 \, a^{2} c^{2}\right )} f^{2} + 16 \, {\left (2 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} d - {\left (5 \, b^{3} c - 12 \, a b c^{2}\right )} e\right )} f\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 (48 \, c^{4} f^{2} x^{3} + 384 \, c^{4} d e - 144 \, b c^{3} e^{2} - 5 \, {\left (21 \, b^{3} c - 44 \, a b c^{2}\right )} f^{2} + 8 \, {\left (16 \, c^{4} e f - 7 \, b c^{3} f^{2}\right )} x^{2} - 16 \, {\left (18 \, b c^{3} d - {\left (15 \, b^{2} c^{2} - 16 \, a c^{3}\right )} e\right )} f + 2 \, {\left (48 \, c^{4} e^{2} + {\left (35 \, b^{2} c^{2} - 36 \, a c^{3}\right )} f^{2} + 16 \, {\left (6 \, c^{4} d - 5 \, b c^{3} e\right )} f\right )} x\right )} \sqrt {c x^{2} + b x + a}}{768 \, c^{5}}, -\frac {3 \, {\left (128 \, c^{4} d^{2} - 128 \, b c^{3} d e + 16 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} e^{2} + {\left (35 \, b^{4} - 120 \, a b^{2} c + 48 \, a^{2} c^{2}\right )} f^{2} + 16 \, {\left (2 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} d - {\left (5 \, b^{3} c - 12 \, a b c^{2}\right )} e\right )} f\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 (48 \, c^{4} f^{2} x^{3} + 384 \, c^{4} d e - 144 \, b c^{3} e^{2} - 5 \, {\left (21 \, b^{3} c - 44 \, a b c^{2}\right )} f^{2} + 8 \, {\left (16 \, c^{4} e f - 7 \, b c^{3} f^{2}\right )} x^{2} - 16 \, {\left (18 \, b c^{3} d - {\left (15 \, b^{2} c^{2} - 16 \, a c^{3}\right )} e\right )} f + 2 \, {\left (48 \, c^{4} e^{2} + {\left (35 \, b^{2} c^{2} - 36 \, a c^{3}\right )} f^{2} + 16 \, {\left (6 \, c^{4} d - 5 \, b c^{3} e\right )} f\right )} x\right )} \sqrt {c x^{2} + b x + a}}{384 \, c^{5}}\right ] \] Input:

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

Output:

[1/768*(3*(128*c^4*d^2 - 128*b*c^3*d*e + 16*(3*b^2*c^2 - 4*a*c^3)*e^2 + (3 
5*b^4 - 120*a*b^2*c + 48*a^2*c^2)*f^2 + 16*(2*(3*b^2*c^2 - 4*a*c^3)*d - (5 
*b^3*c - 12*a*b*c^2)*e)*f)*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*(48*c^4*f^2*x^3 + 384*c 
^4*d*e - 144*b*c^3*e^2 - 5*(21*b^3*c - 44*a*b*c^2)*f^2 + 8*(16*c^4*e*f - 7 
*b*c^3*f^2)*x^2 - 16*(18*b*c^3*d - (15*b^2*c^2 - 16*a*c^3)*e)*f + 2*(48*c^ 
4*e^2 + (35*b^2*c^2 - 36*a*c^3)*f^2 + 16*(6*c^4*d - 5*b*c^3*e)*f)*x)*sqrt( 
c*x^2 + b*x + a))/c^5, -1/384*(3*(128*c^4*d^2 - 128*b*c^3*d*e + 16*(3*b^2* 
c^2 - 4*a*c^3)*e^2 + (35*b^4 - 120*a*b^2*c + 48*a^2*c^2)*f^2 + 16*(2*(3*b^ 
2*c^2 - 4*a*c^3)*d - (5*b^3*c - 12*a*b*c^2)*e)*f)*sqrt(-c)*arctan(1/2*sqrt 
(c*x^2 + b*x + a)*(2*c*x + b)*sqrt(-c)/(c^2*x^2 + b*c*x + a*c)) - 2*(48*c^ 
4*f^2*x^3 + 384*c^4*d*e - 144*b*c^3*e^2 - 5*(21*b^3*c - 44*a*b*c^2)*f^2 + 
8*(16*c^4*e*f - 7*b*c^3*f^2)*x^2 - 16*(18*b*c^3*d - (15*b^2*c^2 - 16*a*c^3 
)*e)*f + 2*(48*c^4*e^2 + (35*b^2*c^2 - 36*a*c^3)*f^2 + 16*(6*c^4*d - 5*b*c 
^3*e)*f)*x)*sqrt(c*x^2 + b*x + a))/c^5]
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 641 vs. \(2 (318) = 636\).

Time = 0.75 (sec) , antiderivative size = 641, normalized size of antiderivative = 2.03 \[ \int \frac {\left (d+e x+f x^2\right )^2}{\sqrt {a+b x+c x^2}} \, dx=\begin {cases} \sqrt {a + b x + c x^{2}} \left (\frac {f^{2} x^{3}}{4 c} + \frac {x^{2} \left (- \frac {7 b f^{2}}{8 c} + 2 e f\right )}{3 c} + \frac {x \left (- \frac {3 a f^{2}}{4 c} - \frac {5 b \left (- \frac {7 b f^{2}}{8 c} + 2 e f\right )}{6 c} + 2 d f + e^{2}\right )}{2 c} + \frac {- \frac {2 a \left (- \frac {7 b f^{2}}{8 c} + 2 e f\right )}{3 c} - \frac {3 b \left (- \frac {3 a f^{2}}{4 c} - \frac {5 b \left (- \frac {7 b f^{2}}{8 c} + 2 e f\right )}{6 c} + 2 d f + e^{2}\right )}{4 c} + 2 d e}{c}\right ) + \left (- \frac {a \left (- \frac {3 a f^{2}}{4 c} - \frac {5 b \left (- \frac {7 b f^{2}}{8 c} + 2 e f\right )}{6 c} + 2 d f + e^{2}\right )}{2 c} - \frac {b \left (- \frac {2 a \left (- \frac {7 b f^{2}}{8 c} + 2 e f\right )}{3 c} - \frac {3 b \left (- \frac {3 a f^{2}}{4 c} - \frac {5 b \left (- \frac {7 b f^{2}}{8 c} + 2 e f\right )}{6 c} + 2 d f + e^{2}\right )}{4 c} + 2 d e\right )}{2 c} + d^{2}\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 ) & \text {for}\: c \neq 0 \\\frac {2 \left (\frac {f^{2} \left (a + b x\right )^{\frac {9}{2}}}{9 b^{4}} + \frac {\left (a + b x\right )^{\frac {7}{2}} \left (- 4 a f^{2} + 2 b e f\right )}{7 b^{4}} + \frac {\left (a + b x\right )^{\frac {5}{2}} \cdot \left (6 a^{2} f^{2} - 6 a b e f + 2 b^{2} d f + b^{2} e^{2}\right )}{5 b^{4}} + \frac {\left (a + b x\right )^{\frac {3}{2}} \left (- 4 a^{3} f^{2} + 6 a^{2} b e f - 4 a b^{2} d f - 2 a b^{2} e^{2} + 2 b^{3} d e\right )}{3 b^{4}} + \frac {\sqrt {a + b x} \left (a^{4} f^{2} - 2 a^{3} b e f + 2 a^{2} b^{2} d f + a^{2} b^{2} e^{2} - 2 a b^{3} d e + b^{4} d^{2}\right )}{b^{4}}\right )}{b} & \text {for}\: b \neq 0 \\\frac {d^{2} x + d e x^{2} + \frac {e f x^{4}}{2} + \frac {f^{2} x^{5}}{5} + \frac {x^{3} \cdot \left (2 d f + e^{2}\right )}{3}}{\sqrt {a}} & \text {otherwise} \end {cases} \] Input:

integrate((f*x**2+e*x+d)**2/(c*x**2+b*x+a)**(1/2),x)
 

Output:

Piecewise((sqrt(a + b*x + c*x**2)*(f**2*x**3/(4*c) + x**2*(-7*b*f**2/(8*c) 
 + 2*e*f)/(3*c) + x*(-3*a*f**2/(4*c) - 5*b*(-7*b*f**2/(8*c) + 2*e*f)/(6*c) 
 + 2*d*f + e**2)/(2*c) + (-2*a*(-7*b*f**2/(8*c) + 2*e*f)/(3*c) - 3*b*(-3*a 
*f**2/(4*c) - 5*b*(-7*b*f**2/(8*c) + 2*e*f)/(6*c) + 2*d*f + e**2)/(4*c) + 
2*d*e)/c) + (-a*(-3*a*f**2/(4*c) - 5*b*(-7*b*f**2/(8*c) + 2*e*f)/(6*c) + 2 
*d*f + e**2)/(2*c) - b*(-2*a*(-7*b*f**2/(8*c) + 2*e*f)/(3*c) - 3*b*(-3*a*f 
**2/(4*c) - 5*b*(-7*b*f**2/(8*c) + 2*e*f)/(6*c) + 2*d*f + e**2)/(4*c) + 2* 
d*e)/(2*c) + d**2)*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)/sqr 
t(c*(b/(2*c) + x)**2), True)), Ne(c, 0)), (2*(f**2*(a + b*x)**(9/2)/(9*b** 
4) + (a + b*x)**(7/2)*(-4*a*f**2 + 2*b*e*f)/(7*b**4) + (a + b*x)**(5/2)*(6 
*a**2*f**2 - 6*a*b*e*f + 2*b**2*d*f + b**2*e**2)/(5*b**4) + (a + b*x)**(3/ 
2)*(-4*a**3*f**2 + 6*a**2*b*e*f - 4*a*b**2*d*f - 2*a*b**2*e**2 + 2*b**3*d* 
e)/(3*b**4) + sqrt(a + b*x)*(a**4*f**2 - 2*a**3*b*e*f + 2*a**2*b**2*d*f + 
a**2*b**2*e**2 - 2*a*b**3*d*e + b**4*d**2)/b**4)/b, Ne(b, 0)), ((d**2*x + 
d*e*x**2 + e*f*x**4/2 + f**2*x**5/5 + x**3*(2*d*f + e**2)/3)/sqrt(a), True 
))
 

Maxima [F(-2)]

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

integrate((f*x^2+e*x+d)^2/(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.15 (sec) , antiderivative size = 296, normalized size of antiderivative = 0.94 \[ \int \frac {\left (d+e x+f x^2\right )^2}{\sqrt {a+b x+c x^2}} \, dx=\frac {1}{192} \, \sqrt {c x^{2} + b x + a} {\left (2 \, {\left (4 \, {\left (\frac {6 \, f^{2} x}{c} + \frac {16 \, c^{3} e f - 7 \, b c^{2} f^{2}}{c^{4}}\right )} x + \frac {48 \, c^{3} e^{2} + 96 \, c^{3} d f - 80 \, b c^{2} e f + 35 \, b^{2} c f^{2} - 36 \, a c^{2} f^{2}}{c^{4}}\right )} x + \frac {384 \, c^{3} d e - 144 \, b c^{2} e^{2} - 288 \, b c^{2} d f + 240 \, b^{2} c e f - 256 \, a c^{2} e f - 105 \, b^{3} f^{2} + 220 \, a b c f^{2}}{c^{4}}\right )} - \frac {{\left (128 \, c^{4} d^{2} - 128 \, b c^{3} d e + 48 \, b^{2} c^{2} e^{2} - 64 \, a c^{3} e^{2} + 96 \, b^{2} c^{2} d f - 128 \, a c^{3} d f - 80 \, b^{3} c e f + 192 \, a b c^{2} e f + 35 \, b^{4} f^{2} - 120 \, a b^{2} c f^{2} + 48 \, a^{2} c^{2} f^{2}\right )} \log \left ({\left | 2 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} \sqrt {c} + b \right |}\right )}{128 \, c^{\frac {9}{2}}} \] Input:

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

Output:

1/192*sqrt(c*x^2 + b*x + a)*(2*(4*(6*f^2*x/c + (16*c^3*e*f - 7*b*c^2*f^2)/ 
c^4)*x + (48*c^3*e^2 + 96*c^3*d*f - 80*b*c^2*e*f + 35*b^2*c*f^2 - 36*a*c^2 
*f^2)/c^4)*x + (384*c^3*d*e - 144*b*c^2*e^2 - 288*b*c^2*d*f + 240*b^2*c*e* 
f - 256*a*c^2*e*f - 105*b^3*f^2 + 220*a*b*c*f^2)/c^4) - 1/128*(128*c^4*d^2 
 - 128*b*c^3*d*e + 48*b^2*c^2*e^2 - 64*a*c^3*e^2 + 96*b^2*c^2*d*f - 128*a* 
c^3*d*f - 80*b^3*c*e*f + 192*a*b*c^2*e*f + 35*b^4*f^2 - 120*a*b^2*c*f^2 + 
48*a^2*c^2*f^2)*log(abs(2*(sqrt(c)*x - sqrt(c*x^2 + b*x + a))*sqrt(c) + b) 
)/c^(9/2)
 

Mupad [F(-1)]

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

int((d + e*x + f*x^2)^2/(a + b*x + c*x^2)^(1/2),x)
 

Output:

int((d + e*x + f*x^2)^2/(a + b*x + c*x^2)^(1/2), x)
 

Reduce [F]

\[ \int \frac {\left (d+e x+f x^2\right )^2}{\sqrt {a+b x+c x^2}} \, dx=\int \frac {\left (f \,x^{2}+e x +d \right )^{2}}{\sqrt {c \,x^{2}+b x +a}}d x \] Input:

int((f*x^2+e*x+d)^2/(c*x^2+b*x+a)^(1/2),x)
 

Output:

int((f*x^2+e*x+d)^2/(c*x^2+b*x+a)^(1/2),x)