### 3.258 $$\int \frac{d+e x+f x^2}{(g+h x) (-c g^2+b g h+b h^2 x+c h^2 x^2)^{3/2}} \, dx$$

Optimal. Leaf size=208 $\frac{(b+2 c x) \left (-3 b^2 f h^2+6 b c e h^2+4 c^2 \left (f g^2-h (2 d h+e g)\right )\right )}{3 c h^2 (2 c g-b h)^3 \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}+\frac{2 \left (d h^2-e g h+f g^2\right )}{3 h^3 (g+h x) (2 c g-b h) \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}-\frac{f}{c h^3 \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}$

[Out]

-(f/(c*h^3*Sqrt[-(g*(c*g - b*h)) + b*h^2*x + c*h^2*x^2])) + ((6*b*c*e*h^2 - 3*b^2*f*h^2 + 4*c^2*(f*g^2 - h*(e*
g + 2*d*h)))*(b + 2*c*x))/(3*c*h^2*(2*c*g - b*h)^3*Sqrt[-(g*(c*g - b*h)) + b*h^2*x + c*h^2*x^2]) + (2*(f*g^2 -
e*g*h + d*h^2))/(3*h^3*(2*c*g - b*h)*(g + h*x)*Sqrt[-(g*(c*g - b*h)) + b*h^2*x + c*h^2*x^2])

________________________________________________________________________________________

Rubi [A]  time = 0.424205, antiderivative size = 208, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 47, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.064, Rules used = {1638, 792, 613} $\frac{(b+2 c x) \left (-3 b^2 f h^2+6 b c e h^2+4 c^2 \left (f g^2-h (2 d h+e g)\right )\right )}{3 c h^2 (2 c g-b h)^3 \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}+\frac{2 \left (d h^2-e g h+f g^2\right )}{3 h^3 (g+h x) (2 c g-b h) \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}-\frac{f}{c h^3 \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}$

Antiderivative was successfully veriﬁed.

[In]

Int[(d + e*x + f*x^2)/((g + h*x)*(-(c*g^2) + b*g*h + b*h^2*x + c*h^2*x^2)^(3/2)),x]

[Out]

-(f/(c*h^3*Sqrt[-(g*(c*g - b*h)) + b*h^2*x + c*h^2*x^2])) + ((6*b*c*e*h^2 - 3*b^2*f*h^2 + 4*c^2*(f*g^2 - h*(e*
g + 2*d*h)))*(b + 2*c*x))/(3*c*h^2*(2*c*g - b*h)^3*Sqrt[-(g*(c*g - b*h)) + b*h^2*x + c*h^2*x^2]) + (2*(f*g^2 -
e*g*h + d*h^2))/(3*h^3*(2*c*g - b*h)*(g + h*x)*Sqrt[-(g*(c*g - b*h)) + b*h^2*x + c*h^2*x^2])

Rule 1638

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq
, x], f = Coeff[Pq, x, Expon[Pq, x]]}, Simp[(f*(d + e*x)^(m + q - 1)*(a + b*x + c*x^2)^(p + 1))/(c*e^(q - 1)*(
m + q + 2*p + 1)), x] + Dist[1/(c*e^q*(m + q + 2*p + 1)), Int[(d + e*x)^m*(a + b*x + c*x^2)^p*ExpandToSum[c*e^
q*(m + q + 2*p + 1)*Pq - c*f*(m + q + 2*p + 1)*(d + e*x)^q + e*f*(m + p + q)*(d + e*x)^(q - 2)*(b*d - 2*a*e +
(2*c*d - b*e)*x), x], x], x] /; NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, b, c, d, e, m, p}, x] && PolyQ[Pq, x] &&
NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - b*d*e + a*e^2, 0]

Rule 792

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp
[((d*g - e*f)*(d + e*x)^m*(a + b*x + c*x^2)^(p + 1))/((2*c*d - b*e)*(m + p + 1)), x] + Dist[(m*(g*(c*d - b*e)
+ c*e*f) + e*(p + 1)*(2*c*f - b*g))/(e*(2*c*d - b*e)*(m + p + 1)), Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p,
x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - b*d*e + a*e^2, 0] && ((L
tQ[m, -1] &&  !IGtQ[m + p + 1, 0]) || (LtQ[m, 0] && LtQ[p, -1]) || EqQ[m + 2*p + 2, 0]) && NeQ[m + p + 1, 0]

Rule 613

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-3/2), x_Symbol] :> Simp[(-2*(b + 2*c*x))/((b^2 - 4*a*c)*Sqrt[a + b*x
+ c*x^2]), x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rubi steps

\begin{align*} \int \frac{d+e x+f x^2}{(g+h x) \left (-c g^2+b g h+b h^2 x+c h^2 x^2\right )^{3/2}} \, dx &=-\frac{f}{c h^3 \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}-\frac{\int \frac{\frac{1}{2} h^3 (b f g-2 c d h)+\frac{1}{2} h^3 (2 c f g-2 c e h+b f h) x}{(g+h x) \left (-c g^2+b g h+b h^2 x+c h^2 x^2\right )^{3/2}} \, dx}{c h^4}\\ &=-\frac{f}{c h^3 \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}+\frac{2 \left (f g^2-e g h+d h^2\right )}{3 h^3 (2 c g-b h) (g+h x) \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}-\frac{\left (6 b c e h^2-3 b^2 f h^2+4 c^2 \left (f g^2-h (e g+2 d h)\right )\right ) \int \frac{1}{\left (-c g^2+b g h+b h^2 x+c h^2 x^2\right )^{3/2}} \, dx}{6 c h^2 (2 c g-b h)}\\ &=-\frac{f}{c h^3 \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}+\frac{\left (6 b c e h^2-3 b^2 f h^2+4 c^2 \left (f g^2-h (e g+2 d h)\right )\right ) (b+2 c x)}{3 c h^2 (2 c g-b h)^3 \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}+\frac{2 \left (f g^2-e g h+d h^2\right )}{3 h^3 (2 c g-b h) (g+h x) \sqrt{-g (c g-b h)+b h^2 x+c h^2 x^2}}\\ \end{align*}

Mathematica [A]  time = 0.519542, size = 219, normalized size = 1.05 $\frac{2 b^2 h^2 \left (f \left (8 g^2+12 g h x+3 h^2 x^2\right )-h (d h+2 e g+3 e h x)\right )-4 b c h \left (h \left (e \left (g^2+2 g h x+3 h^2 x^2\right )-2 d h (2 g+h x)\right )+2 f g^2 (4 g+5 h x)\right )+8 c^2 \left (h \left (d h \left (-g^2+2 g h x+2 h^2 x^2\right )+e g \left (g^2+g h x+h^2 x^2\right )\right )+f g^2 \left (2 g^2+2 g h x-h^2 x^2\right )\right )}{3 h^3 (g+h x) (b h-2 c g)^3 \sqrt{(g+h x) (b h-c g+c h x)}}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(d + e*x + f*x^2)/((g + h*x)*(-(c*g^2) + b*g*h + b*h^2*x + c*h^2*x^2)^(3/2)),x]

[Out]

(2*b^2*h^2*(-(h*(2*e*g + d*h + 3*e*h*x)) + f*(8*g^2 + 12*g*h*x + 3*h^2*x^2)) + 8*c^2*(f*g^2*(2*g^2 + 2*g*h*x -
h^2*x^2) + h*(e*g*(g^2 + g*h*x + h^2*x^2) + d*h*(-g^2 + 2*g*h*x + 2*h^2*x^2))) - 4*b*c*h*(2*f*g^2*(4*g + 5*h*
x) + h*(-2*d*h*(2*g + h*x) + e*(g^2 + 2*g*h*x + 3*h^2*x^2))))/(3*h^3*(-2*c*g + b*h)^3*(g + h*x)*Sqrt[(g + h*x)
*(-(c*g) + b*h + c*h*x)])

________________________________________________________________________________________

Maple [A]  time = 0.06, size = 324, normalized size = 1.6 \begin{align*} -{\frac{ \left ( 2\,chx+2\,bh-2\,cg \right ) \left ( -3\,{b}^{2}f{h}^{4}{x}^{2}+6\,bce{h}^{4}{x}^{2}-8\,{c}^{2}d{h}^{4}{x}^{2}-4\,{c}^{2}eg{h}^{3}{x}^{2}+4\,{c}^{2}f{g}^{2}{h}^{2}{x}^{2}+3\,{b}^{2}e{h}^{4}x-12\,{b}^{2}fg{h}^{3}x-4\,bcd{h}^{4}x+4\,bceg{h}^{3}x+20\,bcf{g}^{2}{h}^{2}x-8\,{c}^{2}dg{h}^{3}x-4\,{c}^{2}e{g}^{2}{h}^{2}x-8\,{c}^{2}f{g}^{3}hx+{b}^{2}d{h}^{4}+2\,{b}^{2}eg{h}^{3}-8\,{b}^{2}f{g}^{2}{h}^{2}-8\,bcdg{h}^{3}+2\,bce{g}^{2}{h}^{2}+16\,bcf{g}^{3}h+4\,{c}^{2}d{g}^{2}{h}^{2}-4\,{c}^{2}e{g}^{3}h-8\,{c}^{2}f{g}^{4} \right ) }{ \left ( 3\,{b}^{3}{h}^{3}-18\,{b}^{2}cg{h}^{2}+36\,b{c}^{2}{g}^{2}h-24\,{c}^{3}{g}^{3} \right ){h}^{3}} \left ( c{h}^{2}{x}^{2}+b{h}^{2}x+bgh-c{g}^{2} \right ) ^{-{\frac{3}{2}}}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int((f*x^2+e*x+d)/(h*x+g)/(c*h^2*x^2+b*h^2*x+b*g*h-c*g^2)^(3/2),x)

[Out]

-2/3*(c*h*x+b*h-c*g)*(-3*b^2*f*h^4*x^2+6*b*c*e*h^4*x^2-8*c^2*d*h^4*x^2-4*c^2*e*g*h^3*x^2+4*c^2*f*g^2*h^2*x^2+3
*b^2*e*h^4*x-12*b^2*f*g*h^3*x-4*b*c*d*h^4*x+4*b*c*e*g*h^3*x+20*b*c*f*g^2*h^2*x-8*c^2*d*g*h^3*x-4*c^2*e*g^2*h^2
*x-8*c^2*f*g^3*h*x+b^2*d*h^4+2*b^2*e*g*h^3-8*b^2*f*g^2*h^2-8*b*c*d*g*h^3+2*b*c*e*g^2*h^2+16*b*c*f*g^3*h+4*c^2*
d*g^2*h^2-4*c^2*e*g^3*h-8*c^2*f*g^4)/(b^3*h^3-6*b^2*c*g*h^2+12*b*c^2*g^2*h-8*c^3*g^3)/h^3/(c*h^2*x^2+b*h^2*x+b
*g*h-c*g^2)^(3/2)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)/(c*h^2*x^2+b*h^2*x+b*g*h-c*g^2)^(3/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 134.36, size = 941, normalized size = 4.52 \begin{align*} \frac{2 \,{\left (8 \, c^{2} f g^{4} - b^{2} d h^{4} + 4 \,{\left (c^{2} e - 4 \, b c f\right )} g^{3} h - 2 \,{\left (2 \, c^{2} d + b c e - 4 \, b^{2} f\right )} g^{2} h^{2} + 2 \,{\left (4 \, b c d - b^{2} e\right )} g h^{3} -{\left (4 \, c^{2} f g^{2} h^{2} - 4 \, c^{2} e g h^{3} -{\left (8 \, c^{2} d - 6 \, b c e + 3 \, b^{2} f\right )} h^{4}\right )} x^{2} +{\left (8 \, c^{2} f g^{3} h + 4 \,{\left (c^{2} e - 5 \, b c f\right )} g^{2} h^{2} + 4 \,{\left (2 \, c^{2} d - b c e + 3 \, b^{2} f\right )} g h^{3} +{\left (4 \, b c d - 3 \, b^{2} e\right )} h^{4}\right )} x\right )} \sqrt{c h^{2} x^{2} + b h^{2} x - c g^{2} + b g h}}{3 \,{\left (8 \, c^{4} g^{6} h^{3} - 20 \, b c^{3} g^{5} h^{4} + 18 \, b^{2} c^{2} g^{4} h^{5} - 7 \, b^{3} c g^{3} h^{6} + b^{4} g^{2} h^{7} -{\left (8 \, c^{4} g^{3} h^{6} - 12 \, b c^{3} g^{2} h^{7} + 6 \, b^{2} c^{2} g h^{8} - b^{3} c h^{9}\right )} x^{3} -{\left (8 \, c^{4} g^{4} h^{5} - 4 \, b c^{3} g^{3} h^{6} - 6 \, b^{2} c^{2} g^{2} h^{7} + 5 \, b^{3} c g h^{8} - b^{4} h^{9}\right )} x^{2} +{\left (8 \, c^{4} g^{5} h^{4} - 28 \, b c^{3} g^{4} h^{5} + 30 \, b^{2} c^{2} g^{3} h^{6} - 13 \, b^{3} c g^{2} h^{7} + 2 \, b^{4} g h^{8}\right )} x\right )}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)/(c*h^2*x^2+b*h^2*x+b*g*h-c*g^2)^(3/2),x, algorithm="fricas")

[Out]

2/3*(8*c^2*f*g^4 - b^2*d*h^4 + 4*(c^2*e - 4*b*c*f)*g^3*h - 2*(2*c^2*d + b*c*e - 4*b^2*f)*g^2*h^2 + 2*(4*b*c*d
- b^2*e)*g*h^3 - (4*c^2*f*g^2*h^2 - 4*c^2*e*g*h^3 - (8*c^2*d - 6*b*c*e + 3*b^2*f)*h^4)*x^2 + (8*c^2*f*g^3*h +
4*(c^2*e - 5*b*c*f)*g^2*h^2 + 4*(2*c^2*d - b*c*e + 3*b^2*f)*g*h^3 + (4*b*c*d - 3*b^2*e)*h^4)*x)*sqrt(c*h^2*x^2
+ b*h^2*x - c*g^2 + b*g*h)/(8*c^4*g^6*h^3 - 20*b*c^3*g^5*h^4 + 18*b^2*c^2*g^4*h^5 - 7*b^3*c*g^3*h^6 + b^4*g^2
*h^7 - (8*c^4*g^3*h^6 - 12*b*c^3*g^2*h^7 + 6*b^2*c^2*g*h^8 - b^3*c*h^9)*x^3 - (8*c^4*g^4*h^5 - 4*b*c^3*g^3*h^6
- 6*b^2*c^2*g^2*h^7 + 5*b^3*c*g*h^8 - b^4*h^9)*x^2 + (8*c^4*g^5*h^4 - 28*b*c^3*g^4*h^5 + 30*b^2*c^2*g^3*h^6 -
13*b^3*c*g^2*h^7 + 2*b^4*g*h^8)*x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x**2+e*x+d)/(h*x+g)/(c*h**2*x**2+b*h**2*x+b*g*h-c*g**2)**(3/2),x)

[Out]

Timed out

________________________________________________________________________________________

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

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)/(c*h^2*x^2+b*h^2*x+b*g*h-c*g^2)^(3/2),x, algorithm="giac")

[Out]

integrate((f*x^2 + e*x + d)/((c*h^2*x^2 + b*h^2*x - c*g^2 + b*g*h)^(3/2)*(h*x + g)), x)