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

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

Optimal result

Integrand size = 30, antiderivative size = 665 \[ \int \frac {f+g x+h x^2}{(d+e x)^2 \left (a+b x+c x^2\right )^2} \, dx=-\frac {e \left (2 c^2 d^2 f-b c d (2 e f+d g)+2 a^2 e^2 h-a b e (e g+2 d h)+b^2 \left (2 e^2 f-d e g+2 d^2 h\right )-2 a c \left (3 e^2 f-4 d e g+3 d^2 h\right )\right )}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right )^2 (d+e x)}+\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-((2 c d-b e) (c f-a h)-(b d-2 a e) (c g-b h)) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) (d+e x) \left (a+b x+c x^2\right )}+\frac {\left (4 c^4 d^4 f-b^3 e^3 (2 b e f-b d g-a e g+2 a d h)-2 c^3 d^2 \left (b d (4 e f+d g)-2 a \left (6 e^2 f-2 d e g+d^2 h\right )\right )-6 c^2 e \left (4 a b d e^2 f-b^2 d^3 g+2 a^2 e \left (e^2 f-2 d e g+2 d^2 h\right )\right )-c e \left (6 a^2 b e^3 g-4 a^3 e^3 h-b^3 d \left (4 e^2 f-3 d e g-2 d^2 h\right )-6 a b^2 e \left (2 e^2 f-d e g+2 d^2 h\right )\right )\right ) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{3/2} \left (c d^2-b d e+a e^2\right )^3}-\frac {e \left (e^2 (2 b e f-b d g-a e g+2 a d h)-c d \left (4 e^2 f-3 d e g+2 d^2 h\right )\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^3}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Mathematica [A] (verified)

Time = 1.87 (sec) , antiderivative size = 650, normalized size of antiderivative = 0.98 \[ \int \frac {f+g x+h x^2}{(d+e x)^2 \left (a+b x+c x^2\right )^2} \, dx=-\frac {e \left (e^2 f-d e g+d^2 h\right )}{\left (c d^2+e (-b d+a e)\right )^2 (d+e x)}+\frac {-b^3 e^2 f+b^2 \left (a e^2 g-c \left (-2 d e f+e^2 f x+d^2 h x\right )\right )+b \left (-a^2 e^2 h+c^2 d (-d f+2 e f x+d g x)+a c \left (-d^2 h+e^2 (3 f+g x)-2 d e (g-h x)\right )\right )+2 c \left (-c^2 d^2 f x+a c \left (e^2 f x-2 d e (f+g x)+d^2 (g+h x)\right )-a^2 e (-2 d h+e (g+h x))\right )}{\left (b^2-4 a c\right ) \left (c d^2+e (-b d+a e)\right )^2 (a+x (b+c x))}-\frac {\left (4 c^4 d^4 f+b^3 e^3 (-2 b e f+b d g+a e g-2 a d h)-2 c^3 d^2 \left (b d (4 e f+d g)-2 a \left (6 e^2 f-2 d e g+d^2 h\right )\right )-6 c^2 e \left (4 a b d e^2 f-b^2 d^3 g+2 a^2 e \left (e^2 f-2 d e g+2 d^2 h\right )\right )+c e \left (-6 a^2 b e^3 g+4 a^3 e^3 h+b^3 d \left (4 e^2 f-3 d e g-2 d^2 h\right )+6 a b^2 e \left (2 e^2 f-d e g+2 d^2 h\right )\right )\right ) \arctan \left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\left (-b^2+4 a c\right )^{3/2} \left (-c d^2+e (b d-a e)\right )^3}+\frac {\left (e^3 (-2 b e f+b d g+a e g-2 a d h)+c d e \left (4 e^2 f-3 d e g+2 d^2 h\right )\right ) \log (d+e x)}{\left (c d^2+e (-b d+a e)\right )^3}-\frac {\left (e^3 (-2 b e f+b d g+a e g-2 a d h)+c d e \left (4 e^2 f-3 d e g+2 d^2 h\right )\right ) \log (a+x (b+c x))}{2 \left (c d^2+e (-b d+a e)\right )^3} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 3.88 (sec) , antiderivative size = 709, normalized size of antiderivative = 1.07, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {2177, 2159, 2009}

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

\(\Big \downarrow \) 2177

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

\(\Big \downarrow \) 2159

\(\displaystyle -\frac {\int \left (\frac {\left (b^2-4 a c\right ) \left (e^2 (2 b e f-b d g-a e g+2 a d h)-c d \left (2 h d^2-3 e g d+4 e^2 f\right )\right ) e^2}{\left (c d^2-b e d+a e^2\right )^3 (d+e x)}-\frac {\left (b^2-4 a c\right ) \left (h d^2-e g d+e^2 f\right ) e^2}{\left (c d^2-b e d+a e^2\right )^2 (d+e x)^2}+\frac {2 c^4 f d^4-c^3 \left (b d (4 e f+d g)-2 a \left (h d^2-2 e g d+6 e^2 f\right )\right ) d^2-b^3 e^3 (2 b e f-b d g-a e g+2 a d h)+c^2 e \left (3 b^2 g d^3-2 a b \left (2 h d^2-3 e g d+10 e^2 f\right ) d-6 a^2 e \left (2 h d^2-2 e g d+e^2 f\right )\right )+c e^2 \left (2 e^2 h a^3-b e (5 e g-4 d h) a^2+b^2 \left (6 h d^2-5 e g d+10 e^2 f\right ) a+b^3 d (4 e f-3 d g)\right )-c \left (b^2-4 a c\right ) e \left (e^2 (2 b e f-b d g-a e g+2 a d h)-c d \left (2 h d^2-3 e g d+4 e^2 f\right )\right ) x}{\left (c d^2-b e d+a e^2\right )^3 \left (c x^2+b x+a\right )}\right )dx}{b^2-4 a c}-\frac {c x \left (2 a^2 e^2 h-c \left (2 a \left (d^2 h-2 d e g+e^2 f\right )+b d (d g+2 e f)\right )-a b e (2 d h+e g)+b^2 \left (d^2 h+e^2 f\right )+2 c^2 d^2 f\right )+b \left (a^2 e^2 h-a c \left (d^2 (-h)-2 d e g+3 e^2 f\right )+c^2 d^2 f\right )-b^2 e (a e g+2 c d f)+2 a c (a e (e g-2 d h)+c d (2 e f-d g))+b^3 e^2 f}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right ) \left (a e^2-b d e+c d^2\right )^2}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {c x \left (2 a^2 e^2 h-c \left (2 a \left (d^2 h-2 d e g+e^2 f\right )+b d (d g+2 e f)\right )-a b e (2 d h+e g)+b^2 \left (d^2 h+e^2 f\right )+2 c^2 d^2 f\right )+b \left (a^2 e^2 h-a c \left (d^2 (-h)-2 d e g+3 e^2 f\right )+c^2 d^2 f\right )-b^2 e (a e g+2 c d f)+2 a c (a e (e g-2 d h)+c d (2 e f-d g))+b^3 e^2 f}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right ) \left (a e^2-b d e+c d^2\right )^2}-\frac {-\frac {\text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (-6 c^2 e \left (2 a^2 e \left (2 d^2 h-2 d e g+e^2 f\right )+4 a b d e^2 f-b^2 d^3 g\right )-c e \left (-4 a^3 e^3 h+6 a^2 b e^3 g-6 a b^2 e \left (2 d^2 h-d e g+2 e^2 f\right )+b^3 (-d) \left (-2 d^2 h-3 d e g+4 e^2 f\right )\right )-b^3 e^3 (2 a d h-a e g-b d g+2 b e f)-2 c^3 d^2 \left (b d (d g+4 e f)-2 a \left (d^2 h-2 d e g+6 e^2 f\right )\right )+4 c^4 d^4 f\right )}{\sqrt {b^2-4 a c} \left (a e^2-b d e+c d^2\right )^3}-\frac {e \left (b^2-4 a c\right ) \log \left (a+b x+c x^2\right ) \left (e^2 (2 a d h-a e g-b d g+2 b e f)-c d \left (2 d^2 h-3 d e g+4 e^2 f\right )\right )}{2 \left (a e^2-b d e+c d^2\right )^3}+\frac {e \left (b^2-4 a c\right ) \left (d^2 h-d e g+e^2 f\right )}{(d+e x) \left (a e^2-b d e+c d^2\right )^2}+\frac {e \left (b^2-4 a c\right ) \log (d+e x) \left (e^2 (2 a d h-a e g-b d g+2 b e f)-c d \left (2 d^2 h-3 d e g+4 e^2 f\right )\right )}{\left (a e^2-b d e+c d^2\right )^3}}{b^2-4 a c}\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2159
Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p 
_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*Pq*(a + b*x + c*x^2)^p, x 
], x] /; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
 

rule 2177
Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p 
_), x_Symbol] :> With[{Qx = PolynomialQuotient[(d + e*x)^m*Pq, a + b*x + c* 
x^2, x], R = Coeff[PolynomialRemainder[(d + e*x)^m*Pq, a + b*x + c*x^2, x], 
 x, 0], S = Coeff[PolynomialRemainder[(d + e*x)^m*Pq, a + b*x + c*x^2, x], 
x, 1]}, Simp[(b*R - 2*a*S + (2*c*R - b*S)*x)*((a + b*x + c*x^2)^(p + 1)/((p 
 + 1)*(b^2 - 4*a*c))), x] + Simp[1/((p + 1)*(b^2 - 4*a*c))   Int[(d + e*x)^ 
m*(a + b*x + c*x^2)^(p + 1)*ExpandToSum[((p + 1)*(b^2 - 4*a*c)*Qx)/(d + e*x 
)^m - ((2*p + 3)*(2*c*R - b*S))/(d + e*x)^m, 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] && ILtQ[m, 0]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(1344\) vs. \(2(659)=1318\).

Time = 0.32 (sec) , antiderivative size = 1345, normalized size of antiderivative = 2.02

method result size
default \(\text {Expression too large to display}\) \(1345\)
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*c^2*d^3*e*h-3*b^2*c^2*d^2*e^2*g+4*b^2*c^2*d*e^3*f 
)/c*ln(c*x^2+b*x+a)+2*(-20*a*b*c^2*d*e^3*f+4*a^2*b*c*d*e^3*h+6*a*b^2*c*d^2 
*e^2*h-5*a*b^2*c*d*e^3*g-4*a*b*c^2*d^3*e*h+6*a*b*c^2*d^2*e^2*g+2*a^3*c*e^4 
*h-6*a^2*c^2*e^4*f+a*b^3*e^4*g+2*a*c^3*d^4*h+b^4*d*e^3*g-b*c^3*d^4*g+2*c^4 
*d^4*f-5*a^2*b*c*e^4*g-12*a^2*c^2*d^2*e^2*h+12*a^2*c^2*d*e^3*g-2*a*b^3*d*e 
^3*h+10*a*b^2*c*e^4*f-4*a*c^3*d^3*e*g+12*a*c^3*d^2*e^2*f-3*b^3*c*d^2*e^2*g 
+4*b^3*c*d*e^3*f+3*b^2*c^2*d^3*e*g-4*b*c^3*d^3*e*f-1/2*(8*a^2*c^2*d*e^3*h- 
4*a^2*c^2*e^4*g-2*a*b^2*c*d*e^3*h+a*b^2*c*e^4*g-4*a*b*c^2*d*e^3*g+8*a*b...
 

Fricas [F(-1)]

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

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

Output:

Timed out
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F(-2)]

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

integrate((h*x^2+g*x+f)/(e*x+d)^2/(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 [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1506 vs. \(2 (658) = 1316\).

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

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

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

((a*b^2*e^3*f - 2*a*c^2*d^3*g + b*c^2*d^3*f - 4*a^2*c*e^3*f + b^3*d*e^2*f 
- 2*a*b^2*d*e^2*g + 4*a*c^2*d^2*e*f + a*b^2*d^2*e*h + a^2*b*d*e^2*h + 6*a^ 
2*c*d*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*d^3*e - 8*a*b*c^2*d^3*e - 8*a^2*b*c*d*e^3 + 
2*a*b^2*c*d^2*e^2))/(a*d + x*(a*e + b*d) + x^2*(b*e + c*d) + c*e*x^3) + sy 
msum(log((x*(36*a^2*c^5*e^7*f^2 + 4*b^4*c^3*e^7*f^2 + 4*a^4*c^3*e^7*h^2 + 
4*c^7*d^4*e^3*f^2 + a^2*b^2*c^3*e^7*g^2 + 64*a^2*c^5*d^2*e^5*g^2 + 12*b...
 

Reduce [B] (verification not implemented)

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

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

Output:

(8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**4*b*c*d*e**5 
*h + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**4*b*c*e* 
*6*h*x + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**4*c* 
*2*d**2*e**4*h + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2)) 
*a**4*c**2*d*e**5*h*x - 12*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c 
- b**2))*a**3*b**2*c*d*e**5*g + 8*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt 
(4*a*c - b**2))*a**3*b**2*c*d*e**5*h*x - 12*sqrt(4*a*c - b**2)*atan((b + 2 
*c*x)/sqrt(4*a*c - b**2))*a**3*b**2*c*e**6*g*x + 8*sqrt(4*a*c - b**2)*atan 
((b + 2*c*x)/sqrt(4*a*c - b**2))*a**3*b**2*c*e**6*h*x**2 - 48*sqrt(4*a*c - 
 b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**3*b*c**2*d**3*e**3*h + 36*s 
qrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**3*b*c**2*d**2*e* 
*4*g - 40*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**3*b*c 
**2*d**2*e**4*h*x - 24*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b* 
*2))*a**3*b*c**2*d*e**5*f + 36*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4* 
a*c - b**2))*a**3*b*c**2*d*e**5*g*x + 16*sqrt(4*a*c - b**2)*atan((b + 2*c* 
x)/sqrt(4*a*c - b**2))*a**3*b*c**2*d*e**5*h*x**2 - 24*sqrt(4*a*c - b**2)*a 
tan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**3*b*c**2*e**6*f*x + 8*sqrt(4*a*c - 
b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**3*b*c**2*e**6*h*x**3 - 48*sq 
rt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**3*c**3*d**4*e**2* 
h + 48*sqrt(4*a*c - b**2)*atan((b + 2*c*x)/sqrt(4*a*c - b**2))*a**3*c**...