Integrand size = 37, antiderivative size = 162 \[ \int \frac {(d+e x)^2 \left (A+B x+C x^2\right )}{(f+g x) \left (2+5 x+3 x^2\right )} \, dx=\frac {e (3 B e g-C (3 e f-6 d g+5 e g)) x}{9 g^2}+\frac {C e^2 x^2}{6 g}-\frac {(A-B+C) (d-e)^2 \log (1+x)}{f-g}+\frac {(9 A-6 B+4 C) (3 d-2 e)^2 \log (2+3 x)}{27 (3 f-2 g)}+\frac {(e f-d g)^2 \left (C f^2-B f g+A g^2\right ) \log (f+g x)}{(3 f-2 g) (f-g) g^3} \] Output:
1/9*e*(3*B*e*g-C*(-6*d*g+3*e*f+5*e*g))*x/g^2+1/6*C*e^2*x^2/g-(A-B+C)*(d-e) ^2*ln(1+x)/(f-g)+(9*A-6*B+4*C)*(3*d-2*e)^2*ln(2+3*x)/(81*f-54*g)+(-d*g+e*f )^2*(A*g^2-B*f*g+C*f^2)*ln(g*x+f)/(3*f-2*g)/(f-g)/g^3
Time = 0.22 (sec) , antiderivative size = 159, normalized size of antiderivative = 0.98 \[ \int \frac {(d+e x)^2 \left (A+B x+C x^2\right )}{(f+g x) \left (2+5 x+3 x^2\right )} \, dx=\frac {e (3 B e g+C (-3 e f+6 d g-5 e g)) x}{9 g^2}+\frac {C e^2 x^2}{6 g}-\frac {(A-B+C) (d-e)^2 \log (1+x)}{f-g}+\frac {(9 A-6 B+4 C) (3 d-2 e)^2 \log (2+3 x)}{81 f-54 g}+\frac {(e f-d g)^2 \left (C f^2+g (-B f+A g)\right ) \log (f+g x)}{g^3 \left (3 f^2-5 f g+2 g^2\right )} \] Input:
Integrate[((d + e*x)^2*(A + B*x + C*x^2))/((f + g*x)*(2 + 5*x + 3*x^2)),x]
Output:
(e*(3*B*e*g + C*(-3*e*f + 6*d*g - 5*e*g))*x)/(9*g^2) + (C*e^2*x^2)/(6*g) - ((A - B + C)*(d - e)^2*Log[1 + x])/(f - g) + ((9*A - 6*B + 4*C)*(3*d - 2* e)^2*Log[2 + 3*x])/(81*f - 54*g) + ((e*f - d*g)^2*(C*f^2 + g*(-(B*f) + A*g ))*Log[f + g*x])/(g^3*(3*f^2 - 5*f*g + 2*g^2))
Time = 0.82 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.054, Rules used = {2153, 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 {(d+e x)^2 \left (A+B x+C x^2\right )}{\left (3 x^2+5 x+2\right ) (f+g x)} \, dx\) |
\(\Big \downarrow \) 2153 |
\(\displaystyle \int \left (\frac {(e f-d g)^2 \left (A g^2-B f g+C f^2\right )}{g^2 (3 f-2 g) (f-g) (f+g x)}+\frac {(3 d-2 e)^2 (9 A-6 B+4 C)}{9 (3 x+2) (3 f-2 g)}-\frac {(d-e)^2 (A-B+C)}{(x+1) (f-g)}+\frac {e (3 B e g-C (-6 d g+3 e f+5 e g))}{9 g^2}+\frac {C e^2 x}{3 g}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {(e f-d g)^2 \log (f+g x) \left (A g^2-B f g+C f^2\right )}{g^3 (3 f-2 g) (f-g)}+\frac {(3 d-2 e)^2 \log (3 x+2) (9 A-6 B+4 C)}{27 (3 f-2 g)}-\frac {(d-e)^2 \log (x+1) (A-B+C)}{f-g}+\frac {e x (3 B e g-C (-6 d g+3 e f+5 e g))}{9 g^2}+\frac {C e^2 x^2}{6 g}\) |
Input:
Int[((d + e*x)^2*(A + B*x + C*x^2))/((f + g*x)*(2 + 5*x + 3*x^2)),x]
Output:
(e*(3*B*e*g - C*(3*e*f - 6*d*g + 5*e*g))*x)/(9*g^2) + (C*e^2*x^2)/(6*g) - ((A - B + C)*(d - e)^2*Log[1 + x])/(f - g) + ((9*A - 6*B + 4*C)*(3*d - 2*e )^2*Log[2 + 3*x])/(27*(3*f - 2*g)) + ((e*f - d*g)^2*(C*f^2 - B*f*g + A*g^2 )*Log[f + g*x])/((3*f - 2*g)*(f - g)*g^3)
Int[(Px_)*((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.)*((a_.) + (b _.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Px*(d + e* x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p}, x] && PolyQ[Px, x] && (IntegerQ[p] || (IntegerQ[2*p] && IntegerQ [m] && ILtQ[n, 0])) && !(IGtQ[m, 0] && IGtQ[n, 0])
Time = 0.26 (sec) , antiderivative size = 286, normalized size of antiderivative = 1.77
method | result | size |
default | \(\frac {e \left (\frac {3}{2} C e g \,x^{2}+3 B x e g +6 C d g x -3 C e f x -5 C e x g \right )}{9 g^{2}}+\frac {\left (-A \,d^{2}+2 A d e -A \,e^{2}+B \,d^{2}-2 B d e +B \,e^{2}-C \,d^{2}+2 C d e -C \,e^{2}\right ) \ln \left (1+x \right )}{f -g}+\frac {\left (81 A \,d^{2}-108 A d e +36 A \,e^{2}-54 B \,d^{2}+72 B d e -24 B \,e^{2}+36 C \,d^{2}-48 C d e +16 C \,e^{2}\right ) \ln \left (2+3 x \right )}{81 f -54 g}+\frac {\left (A \,d^{2} g^{4}-2 A d e \,g^{3} f +A \,e^{2} f^{2} g^{2}-B \,d^{2} g^{3} f +2 B d e \,f^{2} g^{2}-B \,e^{2} f^{3} g +C \,d^{2} f^{2} g^{2}-2 C d e \,f^{3} g +C \,e^{2} f^{4}\right ) \ln \left (g x +f \right )}{g^{3} \left (f -g \right ) \left (3 f -2 g \right )}\) | \(286\) |
norman | \(\frac {C \,e^{2} x^{2}}{6 g}+\frac {e \left (3 B e g +6 C d g -3 C e f -5 C e g \right ) x}{9 g^{2}}+\frac {\left (A \,d^{2} g^{4}-2 A d e \,g^{3} f +A \,e^{2} f^{2} g^{2}-B \,d^{2} g^{3} f +2 B d e \,f^{2} g^{2}-B \,e^{2} f^{3} g +C \,d^{2} f^{2} g^{2}-2 C d e \,f^{3} g +C \,e^{2} f^{4}\right ) \ln \left (g x +f \right )}{g^{3} \left (f -g \right ) \left (3 f -2 g \right )}-\frac {\left (A \,d^{2}-2 A d e +A \,e^{2}-B \,d^{2}+2 B d e -B \,e^{2}+C \,d^{2}-2 C d e +C \,e^{2}\right ) \ln \left (1+x \right )}{f -g}+\frac {\left (81 A \,d^{2}-108 A d e +36 A \,e^{2}-54 B \,d^{2}+72 B d e -24 B \,e^{2}+36 C \,d^{2}-48 C d e +16 C \,e^{2}\right ) \ln \left (2+3 x \right )}{81 f -54 g}\) | \(286\) |
risch | \(\frac {2 e C d x}{3 g}+\frac {C \,e^{2} x^{2}}{6 g}+\frac {g \ln \left (g x +f \right ) A \,d^{2}}{3 f^{2}-5 f g +2 g^{2}}-\frac {\ln \left (g x +f \right ) B \,d^{2} f}{3 f^{2}-5 f g +2 g^{2}}-\frac {\ln \left (-x -1\right ) A \,d^{2}}{f -g}-\frac {\ln \left (-x -1\right ) A \,e^{2}}{f -g}+\frac {\ln \left (-x -1\right ) B \,d^{2}}{f -g}+\frac {\ln \left (-x -1\right ) B \,e^{2}}{f -g}-\frac {\ln \left (-x -1\right ) C \,d^{2}}{f -g}-\frac {\ln \left (-x -1\right ) C \,e^{2}}{f -g}+\frac {e^{2} B x}{3 g}+\frac {3 \ln \left (-3 x -2\right ) A \,d^{2}}{3 f -2 g}+\frac {4 \ln \left (-3 x -2\right ) A \,e^{2}}{3 \left (3 f -2 g \right )}-\frac {2 \ln \left (-3 x -2\right ) B \,d^{2}}{3 f -2 g}-\frac {8 \ln \left (-3 x -2\right ) B \,e^{2}}{9 \left (3 f -2 g \right )}+\frac {4 \ln \left (-3 x -2\right ) C \,d^{2}}{3 \left (3 f -2 g \right )}+\frac {16 \ln \left (-3 x -2\right ) C \,e^{2}}{27 \left (3 f -2 g \right )}+\frac {2 \ln \left (g x +f \right ) B d e \,f^{2}}{g \left (3 f^{2}-5 f g +2 g^{2}\right )}-\frac {2 \ln \left (g x +f \right ) C d e \,f^{3}}{g^{2} \left (3 f^{2}-5 f g +2 g^{2}\right )}-\frac {5 C \,e^{2} x}{9 g}-\frac {2 \ln \left (g x +f \right ) A d e f}{3 f^{2}-5 f g +2 g^{2}}+\frac {\ln \left (g x +f \right ) A \,e^{2} f^{2}}{g \left (3 f^{2}-5 f g +2 g^{2}\right )}-\frac {\ln \left (g x +f \right ) B \,e^{2} f^{3}}{g^{2} \left (3 f^{2}-5 f g +2 g^{2}\right )}+\frac {\ln \left (g x +f \right ) C \,d^{2} f^{2}}{g \left (3 f^{2}-5 f g +2 g^{2}\right )}+\frac {\ln \left (g x +f \right ) C \,e^{2} f^{4}}{g^{3} \left (3 f^{2}-5 f g +2 g^{2}\right )}-\frac {e^{2} C f x}{3 g^{2}}-\frac {4 \ln \left (-3 x -2\right ) A d e}{3 f -2 g}+\frac {8 \ln \left (-3 x -2\right ) B d e}{3 \left (3 f -2 g \right )}-\frac {16 \ln \left (-3 x -2\right ) C d e}{9 \left (3 f -2 g \right )}+\frac {2 \ln \left (-x -1\right ) A d e}{f -g}-\frac {2 \ln \left (-x -1\right ) B d e}{f -g}+\frac {2 \ln \left (-x -1\right ) C d e}{f -g}\) | \(699\) |
parallelrisch | \(-\frac {45 C \,e^{2} f \,g^{3} x^{2}-54 B \,e^{2} f^{2} g^{2} x -72 C d e \,g^{4} x +180 C d e f \,g^{3} x -108 A \ln \left (1+x \right ) e^{2} g^{4}+162 A \ln \left (x +\frac {2}{3}\right ) d^{2} g^{4}+72 A \ln \left (x +\frac {2}{3}\right ) e^{2} g^{4}-54 A \ln \left (g x +f \right ) d^{2} g^{4}+108 B \ln \left (1+x \right ) d^{2} g^{4}+108 B \ln \left (1+x \right ) e^{2} g^{4}-108 B \ln \left (x +\frac {2}{3}\right ) d^{2} g^{4}-48 B \ln \left (x +\frac {2}{3}\right ) e^{2} g^{4}-108 C \ln \left (1+x \right ) d^{2} g^{4}-108 C \ln \left (1+x \right ) e^{2} g^{4}+72 C \ln \left (x +\frac {2}{3}\right ) d^{2} g^{4}+32 C \ln \left (x +\frac {2}{3}\right ) e^{2} g^{4}-54 C \ln \left (g x +f \right ) e^{2} f^{4}-108 A \ln \left (1+x \right ) d^{2} g^{4}-18 C \,e^{2} g^{4} x^{2}-36 B \,e^{2} g^{4} x +60 C \,e^{2} g^{4} x -108 C d e \,f^{2} g^{2} x +90 B \,e^{2} f \,g^{3} x -114 C \,e^{2} f \,g^{3} x +162 A \ln \left (1+x \right ) d^{2} f \,g^{3}+216 A \ln \left (1+x \right ) d e \,g^{4}+162 A \ln \left (1+x \right ) e^{2} f \,g^{3}-162 A \ln \left (x +\frac {2}{3}\right ) d^{2} f \,g^{3}-216 A \ln \left (x +\frac {2}{3}\right ) d e \,g^{4}-72 A \ln \left (x +\frac {2}{3}\right ) e^{2} f \,g^{3}-54 A \ln \left (g x +f \right ) e^{2} f^{2} g^{2}-162 B \ln \left (1+x \right ) d^{2} f \,g^{3}-216 B \ln \left (1+x \right ) d e \,g^{4}-162 B \ln \left (1+x \right ) e^{2} f \,g^{3}+108 B \ln \left (x +\frac {2}{3}\right ) d^{2} f \,g^{3}+144 B \ln \left (x +\frac {2}{3}\right ) d e \,g^{4}+48 B \ln \left (x +\frac {2}{3}\right ) e^{2} f \,g^{3}+54 B \ln \left (g x +f \right ) d^{2} f \,g^{3}+54 B \ln \left (g x +f \right ) e^{2} f^{3} g +162 C \ln \left (1+x \right ) d^{2} f \,g^{3}+216 C \ln \left (1+x \right ) d e \,g^{4}+162 C \ln \left (1+x \right ) e^{2} f \,g^{3}-72 C \ln \left (x +\frac {2}{3}\right ) d^{2} f \,g^{3}-96 C \ln \left (x +\frac {2}{3}\right ) d e \,g^{4}-32 C \ln \left (x +\frac {2}{3}\right ) e^{2} f \,g^{3}-54 C \ln \left (g x +f \right ) d^{2} f^{2} g^{2}-27 C \,x^{2} e^{2} f^{2} g^{2}+54 C x \,e^{2} f^{3} g -324 A \ln \left (1+x \right ) d e f \,g^{3}+216 A \ln \left (x +\frac {2}{3}\right ) d e f \,g^{3}+108 A \ln \left (g x +f \right ) d e f \,g^{3}+324 B \ln \left (1+x \right ) d e f \,g^{3}-144 B \ln \left (x +\frac {2}{3}\right ) d e f \,g^{3}-108 B \ln \left (g x +f \right ) d e \,f^{2} g^{2}-324 C \ln \left (1+x \right ) d e f \,g^{3}+96 C \ln \left (x +\frac {2}{3}\right ) d e f \,g^{3}+108 C \ln \left (g x +f \right ) d e \,f^{3} g}{54 \left (f -g \right ) \left (3 f -2 g \right ) g^{3}}\) | \(779\) |
Input:
int((e*x+d)^2*(C*x^2+B*x+A)/(g*x+f)/(3*x^2+5*x+2),x,method=_RETURNVERBOSE)
Output:
1/9*e/g^2*(3/2*C*e*g*x^2+3*B*x*e*g+6*C*d*g*x-3*C*e*f*x-5*C*e*x*g)+(-A*d^2+ 2*A*d*e-A*e^2+B*d^2-2*B*d*e+B*e^2-C*d^2+2*C*d*e-C*e^2)/(f-g)*ln(1+x)+1/3*( 81*A*d^2-108*A*d*e+36*A*e^2-54*B*d^2+72*B*d*e-24*B*e^2+36*C*d^2-48*C*d*e+1 6*C*e^2)/(27*f-18*g)*ln(2+3*x)+1/g^3*(A*d^2*g^4-2*A*d*e*f*g^3+A*e^2*f^2*g^ 2-B*d^2*f*g^3+2*B*d*e*f^2*g^2-B*e^2*f^3*g+C*d^2*f^2*g^2-2*C*d*e*f^3*g+C*e^ 2*f^4)/(f-g)/(3*f-2*g)*ln(g*x+f)
Leaf count of result is larger than twice the leaf count of optimal. 410 vs. \(2 (156) = 312\).
Time = 44.88 (sec) , antiderivative size = 410, normalized size of antiderivative = 2.53 \[ \int \frac {(d+e x)^2 \left (A+B x+C x^2\right )}{(f+g x) \left (2+5 x+3 x^2\right )} \, dx=\frac {9 \, {\left (3 \, C e^{2} f^{2} g^{2} - 5 \, C e^{2} f g^{3} + 2 \, C e^{2} g^{4}\right )} x^{2} - 6 \, {\left (9 \, C e^{2} f^{3} g - 9 \, {\left (2 \, C d e + B e^{2}\right )} f^{2} g^{2} + {\left (30 \, C d e + {\left (15 \, B - 19 \, C\right )} e^{2}\right )} f g^{3} - 2 \, {\left (6 \, C d e + {\left (3 \, B - 5 \, C\right )} e^{2}\right )} g^{4}\right )} x + 54 \, {\left (C e^{2} f^{4} + A d^{2} g^{4} - {\left (2 \, C d e + B e^{2}\right )} f^{3} g + {\left (C d^{2} + 2 \, B d e + A e^{2}\right )} f^{2} g^{2} - {\left (B d^{2} + 2 \, A d e\right )} f g^{3}\right )} \log \left (g x + f\right ) + 2 \, {\left ({\left (9 \, {\left (9 \, A - 6 \, B + 4 \, C\right )} d^{2} - 12 \, {\left (9 \, A - 6 \, B + 4 \, C\right )} d e + 4 \, {\left (9 \, A - 6 \, B + 4 \, C\right )} e^{2}\right )} f g^{3} - {\left (9 \, {\left (9 \, A - 6 \, B + 4 \, C\right )} d^{2} - 12 \, {\left (9 \, A - 6 \, B + 4 \, C\right )} d e + 4 \, {\left (9 \, A - 6 \, B + 4 \, C\right )} e^{2}\right )} g^{4}\right )} \log \left (3 \, x + 2\right ) - 54 \, {\left (3 \, {\left ({\left (A - B + C\right )} d^{2} - 2 \, {\left (A - B + C\right )} d e + {\left (A - B + C\right )} e^{2}\right )} f g^{3} - 2 \, {\left ({\left (A - B + C\right )} d^{2} - 2 \, {\left (A - B + C\right )} d e + {\left (A - B + C\right )} e^{2}\right )} g^{4}\right )} \log \left (x + 1\right )}{54 \, {\left (3 \, f^{2} g^{3} - 5 \, f g^{4} + 2 \, g^{5}\right )}} \] Input:
integrate((e*x+d)^2*(C*x^2+B*x+A)/(g*x+f)/(3*x^2+5*x+2),x, algorithm="fric as")
Output:
1/54*(9*(3*C*e^2*f^2*g^2 - 5*C*e^2*f*g^3 + 2*C*e^2*g^4)*x^2 - 6*(9*C*e^2*f ^3*g - 9*(2*C*d*e + B*e^2)*f^2*g^2 + (30*C*d*e + (15*B - 19*C)*e^2)*f*g^3 - 2*(6*C*d*e + (3*B - 5*C)*e^2)*g^4)*x + 54*(C*e^2*f^4 + A*d^2*g^4 - (2*C* d*e + B*e^2)*f^3*g + (C*d^2 + 2*B*d*e + A*e^2)*f^2*g^2 - (B*d^2 + 2*A*d*e) *f*g^3)*log(g*x + f) + 2*((9*(9*A - 6*B + 4*C)*d^2 - 12*(9*A - 6*B + 4*C)* d*e + 4*(9*A - 6*B + 4*C)*e^2)*f*g^3 - (9*(9*A - 6*B + 4*C)*d^2 - 12*(9*A - 6*B + 4*C)*d*e + 4*(9*A - 6*B + 4*C)*e^2)*g^4)*log(3*x + 2) - 54*(3*((A - B + C)*d^2 - 2*(A - B + C)*d*e + (A - B + C)*e^2)*f*g^3 - 2*((A - B + C) *d^2 - 2*(A - B + C)*d*e + (A - B + C)*e^2)*g^4)*log(x + 1))/(3*f^2*g^3 - 5*f*g^4 + 2*g^5)
Timed out. \[ \int \frac {(d+e x)^2 \left (A+B x+C x^2\right )}{(f+g x) \left (2+5 x+3 x^2\right )} \, dx=\text {Timed out} \] Input:
integrate((e*x+d)**2*(C*x**2+B*x+A)/(g*x+f)/(3*x**2+5*x+2),x)
Output:
Timed out
Time = 0.04 (sec) , antiderivative size = 257, normalized size of antiderivative = 1.59 \[ \int \frac {(d+e x)^2 \left (A+B x+C x^2\right )}{(f+g x) \left (2+5 x+3 x^2\right )} \, dx=\frac {{\left (C e^{2} f^{4} + A d^{2} g^{4} - {\left (2 \, C d e + B e^{2}\right )} f^{3} g + {\left (C d^{2} + 2 \, B d e + A e^{2}\right )} f^{2} g^{2} - {\left (B d^{2} + 2 \, A d e\right )} f g^{3}\right )} \log \left (g x + f\right )}{3 \, f^{2} g^{3} - 5 \, f g^{4} + 2 \, g^{5}} + \frac {{\left (9 \, {\left (9 \, A - 6 \, B + 4 \, C\right )} d^{2} - 12 \, {\left (9 \, A - 6 \, B + 4 \, C\right )} d e + 4 \, {\left (9 \, A - 6 \, B + 4 \, C\right )} e^{2}\right )} \log \left (3 \, x + 2\right )}{27 \, {\left (3 \, f - 2 \, g\right )}} - \frac {{\left ({\left (A - B + C\right )} d^{2} - 2 \, {\left (A - B + C\right )} d e + {\left (A - B + C\right )} e^{2}\right )} \log \left (x + 1\right )}{f - g} + \frac {3 \, C e^{2} g x^{2} - 2 \, {\left (3 \, C e^{2} f - {\left (6 \, C d e + {\left (3 \, B - 5 \, C\right )} e^{2}\right )} g\right )} x}{18 \, g^{2}} \] Input:
integrate((e*x+d)^2*(C*x^2+B*x+A)/(g*x+f)/(3*x^2+5*x+2),x, algorithm="maxi ma")
Output:
(C*e^2*f^4 + A*d^2*g^4 - (2*C*d*e + B*e^2)*f^3*g + (C*d^2 + 2*B*d*e + A*e^ 2)*f^2*g^2 - (B*d^2 + 2*A*d*e)*f*g^3)*log(g*x + f)/(3*f^2*g^3 - 5*f*g^4 + 2*g^5) + 1/27*(9*(9*A - 6*B + 4*C)*d^2 - 12*(9*A - 6*B + 4*C)*d*e + 4*(9*A - 6*B + 4*C)*e^2)*log(3*x + 2)/(3*f - 2*g) - ((A - B + C)*d^2 - 2*(A - B + C)*d*e + (A - B + C)*e^2)*log(x + 1)/(f - g) + 1/18*(3*C*e^2*g*x^2 - 2*( 3*C*e^2*f - (6*C*d*e + (3*B - 5*C)*e^2)*g)*x)/g^2
Time = 0.13 (sec) , antiderivative size = 298, normalized size of antiderivative = 1.84 \[ \int \frac {(d+e x)^2 \left (A+B x+C x^2\right )}{(f+g x) \left (2+5 x+3 x^2\right )} \, dx=\frac {{\left (C e^{2} f^{4} - 2 \, C d e f^{3} g - B e^{2} f^{3} g + C d^{2} f^{2} g^{2} + 2 \, B d e f^{2} g^{2} + A e^{2} f^{2} g^{2} - B d^{2} f g^{3} - 2 \, A d e f g^{3} + A d^{2} g^{4}\right )} \log \left ({\left | g x + f \right |}\right )}{3 \, f^{2} g^{3} - 5 \, f g^{4} + 2 \, g^{5}} + \frac {{\left (81 \, A d^{2} - 54 \, B d^{2} + 36 \, C d^{2} - 108 \, A d e + 72 \, B d e - 48 \, C d e + 36 \, A e^{2} - 24 \, B e^{2} + 16 \, C e^{2}\right )} \log \left ({\left | 3 \, x + 2 \right |}\right )}{27 \, {\left (3 \, f - 2 \, g\right )}} - \frac {{\left (A d^{2} - B d^{2} + C d^{2} - 2 \, A d e + 2 \, B d e - 2 \, C d e + A e^{2} - B e^{2} + C e^{2}\right )} \log \left ({\left | x + 1 \right |}\right )}{f - g} + \frac {3 \, C e^{2} g x^{2} - 6 \, C e^{2} f x + 12 \, C d e g x + 6 \, B e^{2} g x - 10 \, C e^{2} g x}{18 \, g^{2}} \] Input:
integrate((e*x+d)^2*(C*x^2+B*x+A)/(g*x+f)/(3*x^2+5*x+2),x, algorithm="giac ")
Output:
(C*e^2*f^4 - 2*C*d*e*f^3*g - B*e^2*f^3*g + C*d^2*f^2*g^2 + 2*B*d*e*f^2*g^2 + A*e^2*f^2*g^2 - B*d^2*f*g^3 - 2*A*d*e*f*g^3 + A*d^2*g^4)*log(abs(g*x + f))/(3*f^2*g^3 - 5*f*g^4 + 2*g^5) + 1/27*(81*A*d^2 - 54*B*d^2 + 36*C*d^2 - 108*A*d*e + 72*B*d*e - 48*C*d*e + 36*A*e^2 - 24*B*e^2 + 16*C*e^2)*log(abs (3*x + 2))/(3*f - 2*g) - (A*d^2 - B*d^2 + C*d^2 - 2*A*d*e + 2*B*d*e - 2*C* d*e + A*e^2 - B*e^2 + C*e^2)*log(abs(x + 1))/(f - g) + 1/18*(3*C*e^2*g*x^2 - 6*C*e^2*f*x + 12*C*d*e*g*x + 6*B*e^2*g*x - 10*C*e^2*g*x)/g^2
Time = 22.70 (sec) , antiderivative size = 220, normalized size of antiderivative = 1.36 \[ \int \frac {(d+e x)^2 \left (A+B x+C x^2\right )}{(f+g x) \left (2+5 x+3 x^2\right )} \, dx=x\,\left (\frac {B\,e^2+2\,C\,d\,e}{3\,g}-\frac {C\,e^2\,\left (3\,f+5\,g\right )}{9\,g^2}\right )+\frac {\ln \left (f+g\,x\right )\,\left (g^2\,\left (C\,d^2\,f^2+2\,B\,d\,e\,f^2+A\,e^2\,f^2\right )-g^3\,\left (B\,f\,d^2+2\,A\,e\,f\,d\right )-g\,\left (B\,e^2\,f^3+2\,C\,d\,e\,f^3\right )+A\,d^2\,g^4+C\,e^2\,f^4\right )}{3\,f^2\,g^3-5\,f\,g^4+2\,g^5}+\frac {C\,e^2\,x^2}{6\,g}+\frac {\ln \left (x+\frac {2}{3}\right )\,{\left (3\,d-2\,e\right )}^2\,\left (9\,A-6\,B+4\,C\right )}{27\,\left (3\,f-2\,g\right )}-\frac {\ln \left (x+1\right )\,{\left (d-e\right )}^2\,\left (A-B+C\right )}{f-g} \] Input:
int(((d + e*x)^2*(A + B*x + C*x^2))/((f + g*x)*(5*x + 3*x^2 + 2)),x)
Output:
x*((B*e^2 + 2*C*d*e)/(3*g) - (C*e^2*(3*f + 5*g))/(9*g^2)) + (log(f + g*x)* (g^2*(A*e^2*f^2 + C*d^2*f^2 + 2*B*d*e*f^2) - g^3*(B*d^2*f + 2*A*d*e*f) - g *(B*e^2*f^3 + 2*C*d*e*f^3) + A*d^2*g^4 + C*e^2*f^4))/(2*g^5 - 5*f*g^4 + 3* f^2*g^3) + (C*e^2*x^2)/(6*g) + (log(x + 2/3)*(3*d - 2*e)^2*(9*A - 6*B + 4* C))/(27*(3*f - 2*g)) - (log(x + 1)*(d - e)^2*(A - B + C))/(f - g)
Time = 0.19 (sec) , antiderivative size = 815, normalized size of antiderivative = 5.03 \[ \int \frac {(d+e x)^2 \left (A+B x+C x^2\right )}{(f+g x) \left (2+5 x+3 x^2\right )} \, dx =\text {Too large to display} \] Input:
int((e*x+d)^2*(C*x^2+B*x+A)/(g*x+f)/(3*x^2+5*x+2),x)
Output:
(162*log(3*x + 2)*a*d**2*f*g**3 - 162*log(3*x + 2)*a*d**2*g**4 - 216*log(3 *x + 2)*a*d*e*f*g**3 + 216*log(3*x + 2)*a*d*e*g**4 + 72*log(3*x + 2)*a*e** 2*f*g**3 - 72*log(3*x + 2)*a*e**2*g**4 - 108*log(3*x + 2)*b*d**2*f*g**3 + 108*log(3*x + 2)*b*d**2*g**4 + 144*log(3*x + 2)*b*d*e*f*g**3 - 144*log(3*x + 2)*b*d*e*g**4 - 48*log(3*x + 2)*b*e**2*f*g**3 + 48*log(3*x + 2)*b*e**2* g**4 + 72*log(3*x + 2)*c*d**2*f*g**3 - 72*log(3*x + 2)*c*d**2*g**4 - 96*lo g(3*x + 2)*c*d*e*f*g**3 + 96*log(3*x + 2)*c*d*e*g**4 + 32*log(3*x + 2)*c*e **2*f*g**3 - 32*log(3*x + 2)*c*e**2*g**4 + 54*log(f + g*x)*a*d**2*g**4 - 1 08*log(f + g*x)*a*d*e*f*g**3 + 54*log(f + g*x)*a*e**2*f**2*g**2 - 54*log(f + g*x)*b*d**2*f*g**3 + 108*log(f + g*x)*b*d*e*f**2*g**2 - 54*log(f + g*x) *b*e**2*f**3*g + 54*log(f + g*x)*c*d**2*f**2*g**2 - 108*log(f + g*x)*c*d*e *f**3*g + 54*log(f + g*x)*c*e**2*f**4 - 162*log(x + 1)*a*d**2*f*g**3 + 108 *log(x + 1)*a*d**2*g**4 + 324*log(x + 1)*a*d*e*f*g**3 - 216*log(x + 1)*a*d *e*g**4 - 162*log(x + 1)*a*e**2*f*g**3 + 108*log(x + 1)*a*e**2*g**4 + 162* log(x + 1)*b*d**2*f*g**3 - 108*log(x + 1)*b*d**2*g**4 - 324*log(x + 1)*b*d *e*f*g**3 + 216*log(x + 1)*b*d*e*g**4 + 162*log(x + 1)*b*e**2*f*g**3 - 108 *log(x + 1)*b*e**2*g**4 - 162*log(x + 1)*c*d**2*f*g**3 + 108*log(x + 1)*c* d**2*g**4 + 324*log(x + 1)*c*d*e*f*g**3 - 216*log(x + 1)*c*d*e*g**4 - 162* log(x + 1)*c*e**2*f*g**3 + 108*log(x + 1)*c*e**2*g**4 + 54*b*e**2*f**2*g** 2*x - 90*b*e**2*f*g**3*x + 36*b*e**2*g**4*x + 108*c*d*e*f**2*g**2*x - 1...