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

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

Optimal result

Integrand size = 28, antiderivative size = 232 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{\left (a+b x+c x^2\right )^2} \, dx=\frac {a b^2 e h-b c (c d f+a e g+a d h)+2 a c (c (e f+d g)-a e h)-\left (2 c^3 d f-b^3 e h-c^2 (b e f+b d g+2 a e g+2 a d h)+b c (b e g+b d h+3 a e h)\right ) x}{c^2 \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 ) \text {arctanh}\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} \] Output:

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

Mathematica [A] (verified)

Time = 0.37 (sec) , antiderivative size = 225, normalized size of antiderivative = 0.97 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{\left (a+b x+c x^2\right )^2} \, dx=\frac {-\frac {2 \left (-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 \left (a^2 e h+c^2 d f x-a c (e (f+g x)+d (g+h x))\right )\right )}{\left (b^2-4 a c\right ) (a+x (b+c x))}+\frac {2 \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 ) \arctan \left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\left (-b^2+4 a c\right )^{3/2}}+e h \log (a+x (b+c x))}{2 c^2} \] Input:

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

Output:

((-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)))*Arc 
Tan[(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)
 

Rubi [A] (verified)

Time = 0.46 (sec) , antiderivative size = 200, normalized size of antiderivative = 0.86, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {2175, 1142, 1083, 219, 1103}

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 {(d+e x) \left (f+g x+h x^2\right )}{\left (a+b x+c x^2\right )^2} \, dx\)

\(\Big \downarrow \) 2175

\(\displaystyle \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 {\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}{c x^2+b x+a}dx}{b^2-4 a c}\)

\(\Big \downarrow \) 1142

\(\displaystyle \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 {\frac {\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 ) \int \frac {1}{c x^2+b x+a}dx}{2 c^2}-\frac {e h \left (b^2-4 a c\right ) \int \frac {b+2 c x}{c x^2+b x+a}dx}{2 c^2}}{b^2-4 a c}\)

\(\Big \downarrow \) 1083

\(\displaystyle \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 {-\frac {e h \left (b^2-4 a c\right ) \int \frac {b+2 c x}{c x^2+b x+a}dx}{2 c^2}-\frac {\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 ) \int \frac {1}{b^2-(b+2 c x)^2-4 a c}d(b+2 c x)}{c^2}}{b^2-4 a c}\)

\(\Big \downarrow \) 219

\(\displaystyle \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 {-\frac {e h \left (b^2-4 a c\right ) \int \frac {b+2 c x}{c x^2+b x+a}dx}{2 c^2}-\frac {\text {arctanh}\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 \sqrt {b^2-4 a c}}}{b^2-4 a c}\)

\(\Big \downarrow \) 1103

\(\displaystyle \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 {-\frac {\text {arctanh}\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 \sqrt {b^2-4 a c}}-\frac {e h \left (b^2-4 a c\right ) \log \left (a+b x+c x^2\right )}{2 c^2}}{b^2-4 a c}\)

Input:

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

Output:

((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)/ 
Sqrt[b^2 - 4*a*c]])/(c^2*Sqrt[b^2 - 4*a*c])) - ((b^2 - 4*a*c)*e*h*Log[a + 
b*x + c*x^2])/(2*c^2))/(b^2 - 4*a*c)
 

Defintions of rubi rules used

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 1083
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2   Subst[I 
nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, 
x]
 

rule 1103
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S 
imp[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]
 

rule 1142
Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S 
imp[(2*c*d - b*e)/(2*c)   Int[1/(a + b*x + c*x^2), x], x] + Simp[e/(2*c) 
Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
 

rule 2175
Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p 
_), x_Symbol] :> With[{Qx = PolynomialQuotient[Pq, a + b*x + c*x^2, x], R = 
 Coeff[PolynomialRemainder[Pq, a + b*x + c*x^2, x], x, 0], S = Coeff[Polyno 
mialRemainder[Pq, a + b*x + c*x^2, x], x, 1]}, Simp[(d + e*x)^m*(a + b*x + 
c*x^2)^(p + 1)*((R*b - 2*a*S + (2*c*R - b*S)*x)/((p + 1)*(b^2 - 4*a*c))), x 
] + Simp[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)*Qx + S*(2*a*e*m + b*d 
*(2*p + 3)) - R*(b*e*m + 2*c*d*(2*p + 3)) - e*(2*c*R - b*S)*(m + 2*p + 3)*x 
, x], x], x]] /; FreeQ[{a, b, c, d, e}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a 
*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && LtQ[p, -1] && GtQ[m, 0] && (Inte 
gerQ[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]))
 
Maple [A] (verified)

Time = 0.26 (sec) , antiderivative size = 308, normalized size of antiderivative = 1.33

method result size
default \(\frac {\frac {\left (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 \right ) x}{c^{2} \left (4 a c -b^{2}\right )}+\frac {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}{\left (4 a c -b^{2}\right ) c^{2}}}{c \,x^{2}+b x +a}+\frac {\frac {\left (4 a c e h -b^{2} e h \right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (-a b e h +2 a c d h +2 a c e g -b c d g -b c e f +2 c^{2} d f -\frac {\left (4 a c e h -b^{2} e h \right ) b}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}}{c \left (4 a c -b^{2}\right )}\) \(308\)
risch \(\text {Expression too large to display}\) \(2659\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 697 vs. \(2 (227) = 454\).

Time = 0.14 (sec) , antiderivative size = 1413, normalized size of antiderivative = 6.09 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{\left (a+b x+c x^2\right )^2} \, dx=\text {Too large to display} \] Input:

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

Output:

[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)*l 
og(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)*sqrt(-b^2 + 4*a*c)*arctan(-sqrt(-b^2 + 4*a*c)*(2*...
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1535 vs. \(2 (236) = 472\).

Time = 19.77 (sec) , antiderivative size = 1535, normalized size of antiderivative = 6.62 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{\left (a+b x+c x^2\right )^2} \, dx=\text {Too large to display} \] Input:

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

Output:

(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 +...
 

Maxima [F(-2)]

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

integrate((e*x+d)*(h*x^2+g*x+f)/(c*x^2+b*x+a)^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.23 (sec) , antiderivative size = 271, normalized size of antiderivative = 1.17 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{\left (a+b x+c x^2\right )^2} \, dx=\frac {e h \log \left (c x^{2} + b x + a\right )}{2 \, c^{2}} - \frac {{\left (4 \, c^{3} d f - 2 \, b c^{2} e f - 2 \, b c^{2} d g + 4 \, a c^{2} e g + 4 \, a c^{2} d h + b^{3} e h - 6 \, a b c e h\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} e f - 2 \, a c^{2} d g + a b c e g + a b c d h - a b^{2} e h + 2 \, a^{2} c e h + {\left (2 \, c^{3} d f - b c^{2} e f - b c^{2} d g + b^{2} c e g - 2 \, a c^{2} e g + b^{2} c d h - 2 \, a c^{2} d h - b^{3} e h + 3 \, a b c e h\right )} x}{{\left (c x^{2} + b x + a\right )} {\left (b^{2} - 4 \, a c\right )} c^{2}} \] Input:

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

Output:

1/2*e*h*log(c*x^2 + b*x + a)/c^2 - (4*c^3*d*f - 2*b*c^2*e*f - 2*b*c^2*d*g 
+ 4*a*c^2*e*g + 4*a*c^2*d*h + b^3*e*h - 6*a*b*c*e*h)*arctan((2*c*x + b)/sq 
rt(-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*e*f - 2*a*c^2*d*g + a*b*c*e*g + a*b*c*d*h - a*b^2*e*h + 2*a^2*c*e* 
h + (2*c^3*d*f - b*c^2*e*f - b*c^2*d*g + b^2*c*e*g - 2*a*c^2*e*g + b^2*c*d 
*h - 2*a*c^2*d*h - b^3*e*h + 3*a*b*c*e*h)*x)/((c*x^2 + b*x + a)*(b^2 - 4*a 
*c)*c^2)
 

Mupad [B] (verification not implemented)

Time = 18.51 (sec) , antiderivative size = 376, normalized size of antiderivative = 1.62 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{\left (a+b x+c x^2\right )^2} \, dx=\frac {\frac {b\,c^2\,d\,f-2\,a\,c^2\,e\,f-2\,a\,c^2\,d\,g-a\,b^2\,e\,h+2\,a^2\,c\,e\,h+a\,b\,c\,d\,h+a\,b\,c\,e\,g}{c^2\,\left (4\,a\,c-b^2\right )}-\frac {x\,\left (b^3\,e\,h-2\,c^3\,d\,f+2\,a\,c^2\,d\,h+2\,a\,c^2\,e\,g+b\,c^2\,d\,g+b\,c^2\,e\,f-b^2\,c\,d\,h-b^2\,c\,e\,g-3\,a\,b\,c\,e\,h\right )}{c^2\,\left (4\,a\,c-b^2\right )}}{c\,x^2+b\,x+a}-\frac {\ln \left (c\,x^2+b\,x+a\right )\,\left (-64\,e\,h\,a^3\,c^3+48\,e\,h\,a^2\,b^2\,c^2-12\,e\,h\,a\,b^4\,c+e\,h\,b^6\right )}{2\,\left (64\,a^3\,c^5-48\,a^2\,b^2\,c^4+12\,a\,b^4\,c^3-b^6\,c^2\right )}+\frac {\mathrm {atan}\left (\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}-\frac {b^3\,c-4\,a\,b\,c^2}{c\,{\left (4\,a\,c-b^2\right )}^{3/2}}\right )\,\left (4\,c^3\,d\,f+b^3\,e\,h+4\,a\,c^2\,d\,h+4\,a\,c^2\,e\,g-2\,b\,c^2\,d\,g-2\,b\,c^2\,e\,f-6\,a\,b\,c\,e\,h\right )}{c^2\,{\left (4\,a\,c-b^2\right )}^{3/2}} \] Input:

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

Output:

((b*c^2*d*f - 2*a*c^2*e*f - 2*a*c^2*d*g - a*b^2*e*h + 2*a^2*c*e*h + a*b*c* 
d*h + a*b*c*e*g)/(c^2*(4*a*c - b^2)) - (x*(b^3*e*h - 2*c^3*d*f + 2*a*c^2*d 
*h + 2*a*c^2*e*g + b*c^2*d*g + b*c^2*e*f - b^2*c*d*h - b^2*c*e*g - 3*a*b*c 
*e*h))/(c^2*(4*a*c - b^2)))/(a + b*x + c*x^2) - (log(a + b*x + c*x^2)*(b^6 
*e*h - 64*a^3*c^3*e*h + 48*a^2*b^2*c^2*e*h - 12*a*b^4*c*e*h))/(2*(64*a^3*c 
^5 - b^6*c^2 + 12*a*b^4*c^3 - 48*a^2*b^2*c^4)) + (atan((2*c*x)/(4*a*c - b^ 
2)^(1/2) - (b^3*c - 4*a*b*c^2)/(c*(4*a*c - b^2)^(3/2)))*(4*c^3*d*f + b^3*e 
*h + 4*a*c^2*d*h + 4*a*c^2*e*g - 2*b*c^2*d*g - 2*b*c^2*e*f - 6*a*b*c*e*h)) 
/(c^2*(4*a*c - b^2)^(3/2))
 

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 1526, normalized size of antiderivative = 6.58 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{\left (a+b x+c x^2\right )^2} \, dx =\text {Too large to display} \] Input:

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

Output:

( - 12*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**2*b**2*c 
*e*h + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**2*b*c* 
*2*d*h + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**2*b* 
c**2*e*g + 2*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a*b** 
4*e*h - 12*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a*b**3* 
c*e*h*x - 4*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a*b**2 
*c**2*d*g + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a*b* 
*2*c**2*d*h*x - 4*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))* 
a*b**2*c**2*e*f + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2) 
)*a*b**2*c**2*e*g*x - 12*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - 
b**2))*a*b**2*c**2*e*h*x**2 + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4 
*a*c - b**2))*a*b*c**3*d*f + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4* 
a*c - b**2))*a*b*c**3*d*h*x**2 + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqr 
t(4*a*c - b**2))*a*b*c**3*e*g*x**2 + 2*sqrt(4*a*c - b**2)*atan((b + 2*c*x) 
/sqrt(4*a*c - b**2))*b**5*e*h*x + 2*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sq 
rt(4*a*c - b**2))*b**4*c*e*h*x**2 - 4*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/ 
sqrt(4*a*c - b**2))*b**3*c**2*d*g*x - 4*sqrt(4*a*c - b**2)*atan((b + 2*c*x 
)/sqrt(4*a*c - b**2))*b**3*c**2*e*f*x + 8*sqrt(4*a*c - b**2)*atan((b + 2*c 
*x)/sqrt(4*a*c - b**2))*b**2*c**3*d*f*x - 4*sqrt(4*a*c - b**2)*atan((b + 2 
*c*x)/sqrt(4*a*c - b**2))*b**2*c**3*d*g*x**2 - 4*sqrt(4*a*c - b**2)*ata...