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

Optimal. Leaf size=178 $\frac{(d+e x) \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{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (-2 c^2 (b (d g+e f)-2 a (d h+e g))-6 a b c e h+b^3 e h+4 c^3 d f\right )}{c^2 \left (b^2-4 a c\right )^{3/2}}+\frac{e h \log \left (a+b x+c x^2\right )}{2 c^2}$

[Out]

((d + e*x)*(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^3*d*f + b^3*e*h - 6*a*b*c*e*h - 2*c^2*(b*(e*f + d*g) - 2*a*(e*g + d*h)))*ArcTanh[(b + 2*c*x)/S
qrt[b^2 - 4*a*c]])/(c^2*(b^2 - 4*a*c)^(3/2)) + (e*h*Log[a + b*x + c*x^2])/(2*c^2)

________________________________________________________________________________________

Rubi [A]  time = 0.265863, antiderivative size = 178, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 28, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.179, Rules used = {1644, 634, 618, 206, 628} $\frac{(d+e x) \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{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (-2 c^2 (b (d g+e f)-2 a (d h+e g))-6 a b c e h+b^3 e h+4 c^3 d f\right )}{c^2 \left (b^2-4 a c\right )^{3/2}}+\frac{e h \log \left (a+b x+c x^2\right )}{2 c^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

((d + e*x)*(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^3*d*f + b^3*e*h - 6*a*b*c*e*h - 2*c^2*(b*(e*f + d*g) - 2*a*(e*g + d*h)))*ArcTanh[(b + 2*c*x)/S
qrt[b^2 - 4*a*c]])/(c^2*(b^2 - 4*a*c)^(3/2)) + (e*h*Log[a + b*x + c*x^2])/(2*c^2)

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

Mathematica [A]  time = 0.539798, size = 225, normalized size = 1.26 $\frac{-\frac{2 \left (2 c \left (a^2 e h-a c (d (g+h x)+e (f+g x))+c^2 d f x\right )+b^2 (c x (d h+e g)-a e h)+b c (a d h+a e (g+3 h x)+c d (f-g x)-c e f x)+b^3 (-e) 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 (-2 c^2 (b (d g+e f)-2 a (d h+e g))-6 a b c e h+b^3 e h+4 c^3 d f\right )}{\left (4 a c-b^2\right )^{3/2}}+e h \log (a+x (b+c x))}{2 c^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.176, size = 500, normalized size = 2.8 \begin{align*}{\frac{1}{c{x}^{2}+bx+a} \left ({\frac{ \left ( 3\,abceh-2\,a{c}^{2}dh-2\,a{c}^{2}eg-{b}^{3}eh+{b}^{2}cdh+{b}^{2}ceg-b{c}^{2}dg-b{c}^{2}ef+2\,{c}^{3}df \right ) x}{{c}^{2} \left ( 4\,ac-{b}^{2} \right ) }}+{\frac{2\,{a}^{2}ceh-a{b}^{2}eh+abcdh+abceg-2\,a{c}^{2}dg-2\,a{c}^{2}ef+b{c}^{2}df}{{c}^{2} \left ( 4\,ac-{b}^{2} \right ) }} \right ) }+2\,{\frac{\ln \left ( c{x}^{2}+bx+a \right ) aeh}{c \left ( 4\,ac-{b}^{2} \right ) }}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ){b}^{2}eh}{2\,{c}^{2} \left ( 4\,ac-{b}^{2} \right ) }}-6\,{\frac{abeh}{c \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+4\,{\frac{adh}{ \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+4\,{\frac{aeg}{ \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-2\,{\frac{bdg}{ \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-2\,{\frac{bef}{ \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+4\,{\frac{cdf}{ \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+{\frac{{b}^{3}eh}{{c}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ) \left ( 4\,ac-{b}^{2} \right ) ^{-{\frac{3}{2}}}} \end{align*}

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

[In]

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

[Out]

((3*a*b*c*e*h-2*a*c^2*d*h-2*a*c^2*e*g-b^3*e*h+b^2*c*d*h+b^2*c*e*g-b*c^2*d*g-b*c^2*e*f+2*c^3*d*f)/c^2/(4*a*c-b^
2)*x+(2*a^2*c*e*h-a*b^2*e*h+a*b*c*d*h+a*b*c*e*g-2*a*c^2*d*g-2*a*c^2*e*f+b*c^2*d*f)/(4*a*c-b^2)/c^2)/(c*x^2+b*x
+a)+2/c/(4*a*c-b^2)*ln(c*x^2+b*x+a)*a*e*h-1/2/c^2/(4*a*c-b^2)*ln(c*x^2+b*x+a)*b^2*e*h-6/c/(4*a*c-b^2)^(3/2)*ar
ctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*a*b*e*h+4/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*a*d*h+4/(4*a
*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*a*e*g-2/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2)
)*b*d*g-2/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*b*e*f+4*c/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(
4*a*c-b^2)^(1/2))*d*f+1/c^2/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*b^3*e*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)*(h*x^2+g*x+f)/(c*x^2+b*x+a)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.70378, size = 2957, normalized size = 16.61 \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)*(h*x^2+g*x+f)/(c*x^2+b*x+a)^2,x, algorithm="fricas")

[Out]

[1/2*(((2*(2*c^4*d - b*c^3*e)*f - 2*(b*c^3*d - 2*a*c^3*e)*g + (4*a*c^3*d + (b^3*c - 6*a*b*c^2)*e)*h)*x^2 + 2*(
2*a*c^3*d - a*b*c^2*e)*f - 2*(a*b*c^2*d - 2*a^2*c^2*e)*g + (4*a^2*c^2*d + (a*b^3 - 6*a^2*b*c)*e)*h + (2*(2*b*c
^3*d - b^2*c^2*e)*f - 2*(b^2*c^2*d - 2*a*b*c^2*e)*g + (4*a*b*c^2*d + (b^4 - 6*a*b^2*c)*e)*h)*x)*sqrt(b^2 - 4*a
*c)*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c + sqrt(b^2 - 4*a*c)*(2*c*x + b))/(c*x^2 + b*x + a)) - 2*((b^3*c^2 -
4*a*b*c^3)*d - 2*(a*b^2*c^2 - 4*a^2*c^3)*e)*f + 2*(2*(a*b^2*c^2 - 4*a^2*c^3)*d - (a*b^3*c - 4*a^2*b*c^2)*e)*g
- 2*((a*b^3*c - 4*a^2*b*c^2)*d - (a*b^4 - 6*a^2*b^2*c + 8*a^3*c^2)*e)*h - 2*((2*(b^2*c^3 - 4*a*c^4)*d - (b^3*
c^2 - 4*a*b*c^3)*e)*f - ((b^3*c^2 - 4*a*b*c^3)*d - (b^4*c - 6*a*b^2*c^2 + 8*a^2*c^3)*e)*g + ((b^4*c - 6*a*b^2*
c^2 + 8*a^2*c^3)*d - (b^5 - 7*a*b^3*c + 12*a^2*b*c^2)*e)*h)*x + ((b^4*c - 8*a*b^2*c^2 + 16*a^2*c^3)*e*h*x^2 +
(b^5 - 8*a*b^3*c + 16*a^2*b*c^2)*e*h*x + (a*b^4 - 8*a^2*b^2*c + 16*a^3*c^2)*e*h)*log(c*x^2 + b*x + a))/(a*b^4*
c^2 - 8*a^2*b^2*c^3 + 16*a^3*c^4 + (b^4*c^3 - 8*a*b^2*c^4 + 16*a^2*c^5)*x^2 + (b^5*c^2 - 8*a*b^3*c^3 + 16*a^2*
b*c^4)*x), 1/2*(2*((2*(2*c^4*d - b*c^3*e)*f - 2*(b*c^3*d - 2*a*c^3*e)*g + (4*a*c^3*d + (b^3*c - 6*a*b*c^2)*e)*
h)*x^2 + 2*(2*a*c^3*d - a*b*c^2*e)*f - 2*(a*b*c^2*d - 2*a^2*c^2*e)*g + (4*a^2*c^2*d + (a*b^3 - 6*a^2*b*c)*e)*h
+ (2*(2*b*c^3*d - b^2*c^2*e)*f - 2*(b^2*c^2*d - 2*a*b*c^2*e)*g + (4*a*b*c^2*d + (b^4 - 6*a*b^2*c)*e)*h)*x)*sq
rt(-b^2 + 4*a*c)*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) - 2*((b^3*c^2 - 4*a*b*c^3)*d - 2*(a*b^2
*c^2 - 4*a^2*c^3)*e)*f + 2*(2*(a*b^2*c^2 - 4*a^2*c^3)*d - (a*b^3*c - 4*a^2*b*c^2)*e)*g - 2*((a*b^3*c - 4*a^2*b
*c^2)*d - (a*b^4 - 6*a^2*b^2*c + 8*a^3*c^2)*e)*h - 2*((2*(b^2*c^3 - 4*a*c^4)*d - (b^3*c^2 - 4*a*b*c^3)*e)*f -
((b^3*c^2 - 4*a*b*c^3)*d - (b^4*c - 6*a*b^2*c^2 + 8*a^2*c^3)*e)*g + ((b^4*c - 6*a*b^2*c^2 + 8*a^2*c^3)*d - (b^
5 - 7*a*b^3*c + 12*a^2*b*c^2)*e)*h)*x + ((b^4*c - 8*a*b^2*c^2 + 16*a^2*c^3)*e*h*x^2 + (b^5 - 8*a*b^3*c + 16*a^
2*b*c^2)*e*h*x + (a*b^4 - 8*a^2*b^2*c + 16*a^3*c^2)*e*h)*log(c*x^2 + b*x + a))/(a*b^4*c^2 - 8*a^2*b^2*c^3 + 16
*a^3*c^4 + (b^4*c^3 - 8*a*b^2*c^4 + 16*a^2*c^5)*x^2 + (b^5*c^2 - 8*a*b^3*c^3 + 16*a^2*b*c^4)*x)]

________________________________________________________________________________________

Sympy [B]  time = 53.1521, size = 1535, normalized size = 8.62 \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)*(h*x**2+g*x+f)/(c*x**2+b*x+a)**2,x)

[Out]

(e*h/(2*c**2) - sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e*h - 4*a*c**2*d*h - 4*a*c**2*e*g - b**3*e*h + 2*b*c**2*d*g
+ 2*b*c**2*e*f - 4*c**3*d*f)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6)))*log(x + (-16*a*
*2*c**3*(e*h/(2*c**2) - sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e*h - 4*a*c**2*d*h - 4*a*c**2*e*g - b**3*e*h + 2*b*c
**2*d*g + 2*b*c**2*e*f - 4*c**3*d*f)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))) + 8*a**
2*c*e*h + 8*a*b**2*c**2*(e*h/(2*c**2) - sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e*h - 4*a*c**2*d*h - 4*a*c**2*e*g -
b**3*e*h + 2*b*c**2*d*g + 2*b*c**2*e*f - 4*c**3*d*f)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c -
b**6))) - a*b**2*e*h - 2*a*b*c*d*h - 2*a*b*c*e*g - b**4*c*(e*h/(2*c**2) - sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e
*h - 4*a*c**2*d*h - 4*a*c**2*e*g - b**3*e*h + 2*b*c**2*d*g + 2*b*c**2*e*f - 4*c**3*d*f)/(2*c**2*(64*a**3*c**3
- 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))) + b**2*c*d*g + b**2*c*e*f - 2*b*c**2*d*f)/(6*a*b*c*e*h - 4*a*c**2*
d*h - 4*a*c**2*e*g - b**3*e*h + 2*b*c**2*d*g + 2*b*c**2*e*f - 4*c**3*d*f)) + (e*h/(2*c**2) + sqrt(-(4*a*c - b*
*2)**3)*(6*a*b*c*e*h - 4*a*c**2*d*h - 4*a*c**2*e*g - b**3*e*h + 2*b*c**2*d*g + 2*b*c**2*e*f - 4*c**3*d*f)/(2*c
**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6)))*log(x + (-16*a**2*c**3*(e*h/(2*c**2) + sqrt(-(4*
a*c - b**2)**3)*(6*a*b*c*e*h - 4*a*c**2*d*h - 4*a*c**2*e*g - b**3*e*h + 2*b*c**2*d*g + 2*b*c**2*e*f - 4*c**3*d
*f)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))) + 8*a**2*c*e*h + 8*a*b**2*c**2*(e*h/(2*c
**2) + sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e*h - 4*a*c**2*d*h - 4*a*c**2*e*g - b**3*e*h + 2*b*c**2*d*g + 2*b*c**
2*e*f - 4*c**3*d*f)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))) - a*b**2*e*h - 2*a*b*c*d
*h - 2*a*b*c*e*g - b**4*c*(e*h/(2*c**2) + sqrt(-(4*a*c - b**2)**3)*(6*a*b*c*e*h - 4*a*c**2*d*h - 4*a*c**2*e*g
- b**3*e*h + 2*b*c**2*d*g + 2*b*c**2*e*f - 4*c**3*d*f)/(2*c**2*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c
- b**6))) + b**2*c*d*g + b**2*c*e*f - 2*b*c**2*d*f)/(6*a*b*c*e*h - 4*a*c**2*d*h - 4*a*c**2*e*g - b**3*e*h + 2
*b*c**2*d*g + 2*b*c**2*e*f - 4*c**3*d*f)) + (2*a**2*c*e*h - a*b**2*e*h + a*b*c*d*h + a*b*c*e*g - 2*a*c**2*d*g
- 2*a*c**2*e*f + b*c**2*d*f + x*(3*a*b*c*e*h - 2*a*c**2*d*h - 2*a*c**2*e*g - b**3*e*h + b**2*c*d*h + b**2*c*e*
g - b*c**2*d*g - b*c**2*e*f + 2*c**3*d*f))/(4*a**2*c**3 - a*b**2*c**2 + x**2*(4*a*c**4 - b**2*c**3) + x*(4*a*b
*c**3 - b**3*c**2))

________________________________________________________________________________________

Giac [A]  time = 1.34085, size = 385, normalized size = 2.16 \begin{align*} \frac{h e \log \left (c x^{2} + b x + a\right )}{2 \, c^{2}} - \frac{{\left (4 \, c^{3} d f - 2 \, b c^{2} d g + 4 \, a c^{2} d h - 2 \, b c^{2} f e + 4 \, a c^{2} g e + b^{3} h e - 6 \, a b c h e\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} \sqrt{-b^{2} + 4 \, a c}} - \frac{b c^{2} d f - 2 \, a c^{2} d g + a b c d h - 2 \, a c^{2} f e + a b c g e - a b^{2} h e + 2 \, a^{2} c h e +{\left (2 \, c^{3} d f - b c^{2} d g + b^{2} c d h - 2 \, a c^{2} d h - b c^{2} f e + b^{2} c g e - 2 \, a c^{2} g e - b^{3} h e + 3 \, a b c h e\right )} x}{{\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)*(h*x^2+g*x+f)/(c*x^2+b*x+a)^2,x, algorithm="giac")

[Out]

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