### 3.155 $$\int \frac{(d+e x)^2 (f+g x+h x^2)}{(a+b x+c x^2)^2} \, dx$$

Optimal. Leaf size=288 $\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (b^2 c e (12 a e h+2 b d h+b e g)-c^3 \left (2 b d (d g+2 e f)-4 a \left (d^2 h+2 d e g+e^2 f\right )\right )-6 a c^2 e (2 a e h+2 b d h+b e g)-2 b^4 e^2 h+4 c^4 d^2 f\right )}{c^3 \left (b^2-4 a c\right )^{3/2}}+\frac{(d+e x)^2 \left (c \left (2 a g-b \left (\frac{a h}{c}+f\right )\right )-x \left (-2 a c h+b^2 h-b c g+2 c^2 f\right )\right )}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{e^2 x \left (-6 a c h+2 b^2 h-b c g+2 c^2 f\right )}{c^2 \left (b^2-4 a c\right )}+\frac{e \log \left (a+b x+c x^2\right ) (-2 b e h+2 c d h+c e g)}{2 c^3}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.700316, antiderivative size = 288, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 30, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.2, Rules used = {1644, 773, 634, 618, 206, 628} $\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (b^2 c e (12 a e h+2 b d h+b e g)-c^3 \left (2 b d (d g+2 e f)-4 a \left (d^2 h+2 d e g+e^2 f\right )\right )-6 a c^2 e (2 a e h+2 b d h+b e g)-2 b^4 e^2 h+4 c^4 d^2 f\right )}{c^3 \left (b^2-4 a c\right )^{3/2}}+\frac{(d+e x)^2 \left (c \left (2 a g-b \left (\frac{a h}{c}+f\right )\right )-x \left (-2 a c h+b^2 h-b c g+2 c^2 f\right )\right )}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{e^2 x \left (-6 a c h+2 b^2 h-b c g+2 c^2 f\right )}{c^2 \left (b^2-4 a c\right )}+\frac{e \log \left (a+b x+c x^2\right ) (-2 b e h+2 c d h+c e g)}{2 c^3}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 1644

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = Polynomi
alQuotient[Pq, a + b*x + c*x^2, x], f = Coeff[PolynomialRemainder[Pq, a + b*x + c*x^2, x], x, 0], g = Coeff[Po
lynomialRemainder[Pq, a + b*x + c*x^2, x], x, 1]}, Simp[((d + e*x)^m*(a + b*x + c*x^2)^(p + 1)*(f*b - 2*a*g +
(2*c*f - b*g)*x))/((p + 1)*(b^2 - 4*a*c)), x] + Dist[1/((p + 1)*(b^2 - 4*a*c)), Int[(d + e*x)^(m - 1)*(a + b*x
+ c*x^2)^(p + 1)*ExpandToSum[(p + 1)*(b^2 - 4*a*c)*(d + e*x)*Q + g*(2*a*e*m + b*d*(2*p + 3)) - f*(b*e*m + 2*c
*d*(2*p + 3)) - e*(2*c*f - b*g)*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, c, d, e}, x] && PolyQ[Pq, x] && N
eQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && LtQ[p, -1] && GtQ[m, 0] && (IntegerQ[p] ||  !IntegerQ[m
] ||  !RationalQ[a, b, c, d, e]) &&  !(IGtQ[m, 0] && RationalQ[a, b, c, d, e] && (IntegerQ[p] || ILtQ[p + 1/2,
0]))

Rule 773

Int[(((d_.) + (e_.)*(x_))*((f_) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(e*g*x)/
c, x] + Dist[1/c, Int[(c*d*f - a*e*g + (c*e*f + c*d*g - b*e*g)*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c,
d, e, f, g}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

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

Rule 206

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

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

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

Mathematica [A]  time = 0.949623, size = 398, normalized size = 1.38 $\frac{-\frac{2 \left (b c \left (-3 a^2 e^2 h+a c \left (d^2 h+2 d e (g+3 h x)+e^2 (f+3 g x)\right )+c^2 d (d (f-g x)-2 e f x)\right )+2 c^2 \left (a^2 e (2 d h+e (g+h x))-a c \left (d^2 (g+h x)+2 d e (f+g x)+e^2 f x\right )+c^2 d^2 f x\right )+b^2 c \left (c x \left (d^2 h+2 d e g+e^2 f\right )-a e (2 d h+e g+4 e h x)\right )+b^3 e (a e h-c x (2 d h+e g))+b^4 e^2 h x\right )}{\left (b^2-4 a c\right ) (a+x (b+c x))}+\frac{2 \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right ) \left (b^2 c e (12 a e h+2 b d h+b e g)+c^3 \left (4 a \left (d^2 h+2 d e g+e^2 f\right )-2 b d (d g+2 e f)\right )-6 a c^2 e (2 a e h+2 b d h+b e g)-2 b^4 e^2 h+4 c^4 d^2 f\right )}{\left (4 a c-b^2\right )^{3/2}}+e \log (a+x (b+c x)) (-2 b e h+2 c d h+c e g)+2 c e^2 h x}{2 c^3}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.194, size = 1712, normalized size = 5.9 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

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

[Out]

2/c/(c*x^2+b*x+a)/(4*a*c-b^2)*a*b*d*e*g+3/c/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/(c*x^2+b*x+a)/(4*a*c-b^2)*a^2*e^2*g+1/c^3/(4*a*c-b^2)*ln(c*x^2+b
*x+a)*b^3*e^2*h-12/c/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*a^2*e^2*h

________________________________________________________________________________________

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((e*x+d)^2*(h*x^2+g*x+f)/(c*x^2+b*x+a)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 4.94007, size = 5646, normalized size = 19.6 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

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

[Out]

[1/2*(2*(b^4*c^2 - 8*a*b^2*c^3 + 16*a^2*c^4)*e^2*h*x^3 + 2*(b^5*c - 8*a*b^3*c^2 + 16*a^2*b*c^3)*e^2*h*x^2 + ((
4*(c^5*d^2 - b*c^4*d*e + a*c^4*e^2)*f - (2*b*c^4*d^2 - 8*a*c^4*d*e - (b^3*c^2 - 6*a*b*c^3)*e^2)*g + 2*(2*a*c^4
*d^2 + (b^3*c^2 - 6*a*b*c^3)*d*e - (b^4*c - 6*a*b^2*c^2 + 6*a^2*c^3)*e^2)*h)*x^2 + 4*(a*c^4*d^2 - a*b*c^3*d*e
+ a^2*c^3*e^2)*f - (2*a*b*c^3*d^2 - 8*a^2*c^3*d*e - (a*b^3*c - 6*a^2*b*c^2)*e^2)*g + 2*(2*a^2*c^3*d^2 + (a*b^3
*c - 6*a^2*b*c^2)*d*e - (a*b^4 - 6*a^2*b^2*c + 6*a^3*c^2)*e^2)*h + (4*(b*c^4*d^2 - b^2*c^3*d*e + a*b*c^3*e^2)*
f - (2*b^2*c^3*d^2 - 8*a*b*c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*c^2 + 16*a^3*c^3)*d*e - (a*b^
5 - 8*a^2*b^3*c + 16*a^3*b*c^2)*e^2)*h + ((b^5*c - 8*a*b^3*c^2 + 16*a^2*b*c^3)*e^2*g + 2*((b^5*c - 8*a*b^3*c^2
+ 16*a^2*b*c^3)*d*e - (b^6 - 8*a*b^4*c + 16*a^2*b^2*c^2)*e^2)*h)*x)*log(c*x^2 + b*x + a))/(a*b^4*c^3 - 8*a^2*
b^2*c^4 + 16*a^3*c^5 + (b^4*c^4 - 8*a*b^2*c^5 + 16*a^2*c^6)*x^2 + (b^5*c^3 - 8*a*b^3*c^4 + 16*a^2*b*c^5)*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((e*x+d)**2*(h*x**2+g*x+f)/(c*x**2+b*x+a)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.30768, size = 729, normalized size = 2.53 \begin{align*} \frac{h x e^{2}}{c^{2}} - \frac{{\left (4 \, c^{4} d^{2} f - 2 \, b c^{3} d^{2} g + 4 \, a c^{3} d^{2} h - 4 \, b c^{3} d f e + 8 \, a c^{3} d g e + 2 \, b^{3} c d h e - 12 \, a b c^{2} d h e + 4 \, a c^{3} f e^{2} + b^{3} c g e^{2} - 6 \, a b c^{2} g e^{2} - 2 \, b^{4} h e^{2} + 12 \, a b^{2} c h e^{2} - 12 \, a^{2} c^{2} h e^{2}\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{{\left (b^{2} c^{3} - 4 \, a c^{4}\right )} \sqrt{-b^{2} + 4 \, a c}} + \frac{{\left (2 \, c d h e + c g e^{2} - 2 \, b h e^{2}\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{3}} - \frac{\frac{{\left (2 \, c^{4} d^{2} f - b c^{3} d^{2} g + b^{2} c^{2} d^{2} h - 2 \, a c^{3} d^{2} h - 2 \, b c^{3} d f e + 2 \, b^{2} c^{2} d g e - 4 \, a c^{3} d g e - 2 \, b^{3} c d h e + 6 \, a b c^{2} d h e + b^{2} c^{2} f e^{2} - 2 \, a c^{3} f e^{2} - b^{3} c g e^{2} + 3 \, a b c^{2} g e^{2} + b^{4} h e^{2} - 4 \, a b^{2} c h e^{2} + 2 \, a^{2} c^{2} h e^{2}\right )} x}{c} + \frac{b c^{3} d^{2} f - 2 \, a c^{3} d^{2} g + a b c^{2} d^{2} h - 4 \, a c^{3} d f e + 2 \, a b c^{2} d g e - 2 \, a b^{2} c d h e + 4 \, a^{2} c^{2} d h e + a b c^{2} f e^{2} - a b^{2} c g e^{2} + 2 \, a^{2} c^{2} g e^{2} + a b^{3} h e^{2} - 3 \, a^{2} b c h e^{2}}{c}}{{\left (c x^{2} + b x + a\right )}{\left (b^{2} - 4 \, a c\right )} c^{2}} \end{align*}

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

[In]

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

[Out]

h*x*e^2/c^2 - (4*c^4*d^2*f - 2*b*c^3*d^2*g + 4*a*c^3*d^2*h - 4*b*c^3*d*f*e + 8*a*c^3*d*g*e + 2*b^3*c*d*h*e - 1
2*a*b*c^2*d*h*e + 4*a*c^3*f*e^2 + b^3*c*g*e^2 - 6*a*b*c^2*g*e^2 - 2*b^4*h*e^2 + 12*a*b^2*c*h*e^2 - 12*a^2*c^2*
h*e^2)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/((b^2*c^3 - 4*a*c^4)*sqrt(-b^2 + 4*a*c)) + 1/2*(2*c*d*h*e + c*g*
e^2 - 2*b*h*e^2)*log(c*x^2 + b*x + a)/c^3 - ((2*c^4*d^2*f - b*c^3*d^2*g + b^2*c^2*d^2*h - 2*a*c^3*d^2*h - 2*b*
c^3*d*f*e + 2*b^2*c^2*d*g*e - 4*a*c^3*d*g*e - 2*b^3*c*d*h*e + 6*a*b*c^2*d*h*e + b^2*c^2*f*e^2 - 2*a*c^3*f*e^2
- b^3*c*g*e^2 + 3*a*b*c^2*g*e^2 + b^4*h*e^2 - 4*a*b^2*c*h*e^2 + 2*a^2*c^2*h*e^2)*x/c + (b*c^3*d^2*f - 2*a*c^3*
d^2*g + a*b*c^2*d^2*h - 4*a*c^3*d*f*e + 2*a*b*c^2*d*g*e - 2*a*b^2*c*d*h*e + 4*a^2*c^2*d*h*e + a*b*c^2*f*e^2 -
a*b^2*c*g*e^2 + 2*a^2*c^2*g*e^2 + a*b^3*h*e^2 - 3*a^2*b*c*h*e^2)/c)/((c*x^2 + b*x + a)*(b^2 - 4*a*c)*c^2)