### 3.142 $$\int (a+b x+c x^2)^2 (A+C x^2) \, dx$$

Optimal. Leaf size=96 $\frac{1}{3} x^3 \left (a^2 C+A \left (2 a c+b^2\right )\right )+a^2 A x+\frac{1}{5} x^5 \left (C \left (2 a c+b^2\right )+A c^2\right )+\frac{1}{2} b x^4 (a C+A c)+a A b x^2+\frac{1}{3} b c C x^6+\frac{1}{7} c^2 C x^7$

[Out]

a^2*A*x + a*A*b*x^2 + ((A*(b^2 + 2*a*c) + a^2*C)*x^3)/3 + (b*(A*c + a*C)*x^4)/2 + ((A*c^2 + (b^2 + 2*a*c)*C)*x
^5)/5 + (b*c*C*x^6)/3 + (c^2*C*x^7)/7

________________________________________________________________________________________

Rubi [A]  time = 0.0994486, antiderivative size = 96, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 20, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.05, Rules used = {1657} $\frac{1}{3} x^3 \left (a^2 C+A \left (2 a c+b^2\right )\right )+a^2 A x+\frac{1}{5} x^5 \left (C \left (2 a c+b^2\right )+A c^2\right )+\frac{1}{2} b x^4 (a C+A c)+a A b x^2+\frac{1}{3} b c C x^6+\frac{1}{7} c^2 C x^7$

Antiderivative was successfully veriﬁed.

[In]

Int[(a + b*x + c*x^2)^2*(A + C*x^2),x]

[Out]

a^2*A*x + a*A*b*x^2 + ((A*(b^2 + 2*a*c) + a^2*C)*x^3)/3 + (b*(A*c + a*C)*x^4)/2 + ((A*c^2 + (b^2 + 2*a*c)*C)*x
^5)/5 + (b*c*C*x^6)/3 + (c^2*C*x^7)/7

Rule 1657

Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x + c*x^2)^p, x
], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

\begin{align*} \int \left (a+b x+c x^2\right )^2 \left (A+C x^2\right ) \, dx &=\int \left (a^2 A+2 a A b x+\left (A \left (b^2+2 a c\right )+a^2 C\right ) x^2+2 b (A c+a C) x^3+\left (A c^2+\left (b^2+2 a c\right ) C\right ) x^4+2 b c C x^5+c^2 C x^6\right ) \, dx\\ &=a^2 A x+a A b x^2+\frac{1}{3} \left (A \left (b^2+2 a c\right )+a^2 C\right ) x^3+\frac{1}{2} b (A c+a C) x^4+\frac{1}{5} \left (A c^2+\left (b^2+2 a c\right ) C\right ) x^5+\frac{1}{3} b c C x^6+\frac{1}{7} c^2 C x^7\\ \end{align*}

Mathematica [A]  time = 0.0214049, size = 96, normalized size = 1. $\frac{1}{3} x^3 \left (a^2 C+2 a A c+A b^2\right )+a^2 A x+\frac{1}{5} x^5 \left (2 a c C+A c^2+b^2 C\right )+\frac{1}{2} b x^4 (a C+A c)+a A b x^2+\frac{1}{3} b c C x^6+\frac{1}{7} c^2 C x^7$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(a + b*x + c*x^2)^2*(A + C*x^2),x]

[Out]

a^2*A*x + a*A*b*x^2 + ((A*b^2 + 2*a*A*c + a^2*C)*x^3)/3 + (b*(A*c + a*C)*x^4)/2 + ((A*c^2 + b^2*C + 2*a*c*C)*x
^5)/5 + (b*c*C*x^6)/3 + (c^2*C*x^7)/7

________________________________________________________________________________________

Maple [A]  time = 0.048, size = 90, normalized size = 0.9 \begin{align*}{\frac{{c}^{2}C{x}^{7}}{7}}+{\frac{bcC{x}^{6}}{3}}+{\frac{ \left ( A{c}^{2}+ \left ( 2\,ac+{b}^{2} \right ) C \right ){x}^{5}}{5}}+{\frac{ \left ( 2\,Abc+2\,abC \right ){x}^{4}}{4}}+{\frac{ \left ( A \left ( 2\,ac+{b}^{2} \right ) +{a}^{2}C \right ){x}^{3}}{3}}+aAb{x}^{2}+{a}^{2}Ax \end{align*}

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

[In]

int((c*x^2+b*x+a)^2*(C*x^2+A),x)

[Out]

1/7*c^2*C*x^7+1/3*b*c*C*x^6+1/5*(A*c^2+(2*a*c+b^2)*C)*x^5+1/4*(2*A*b*c+2*C*a*b)*x^4+1/3*(A*(2*a*c+b^2)+a^2*C)*
x^3+a*A*b*x^2+a^2*A*x

________________________________________________________________________________________

Maxima [A]  time = 0.964131, size = 117, normalized size = 1.22 \begin{align*} \frac{1}{7} \, C c^{2} x^{7} + \frac{1}{3} \, C b c x^{6} + \frac{1}{5} \,{\left (C b^{2} + 2 \, C a c + A c^{2}\right )} x^{5} + A a b x^{2} + \frac{1}{2} \,{\left (C a b + A b c\right )} x^{4} + A a^{2} x + \frac{1}{3} \,{\left (C a^{2} + A b^{2} + 2 \, A a c\right )} x^{3} \end{align*}

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

[In]

integrate((c*x^2+b*x+a)^2*(C*x^2+A),x, algorithm="maxima")

[Out]

1/7*C*c^2*x^7 + 1/3*C*b*c*x^6 + 1/5*(C*b^2 + 2*C*a*c + A*c^2)*x^5 + A*a*b*x^2 + 1/2*(C*a*b + A*b*c)*x^4 + A*a^
2*x + 1/3*(C*a^2 + A*b^2 + 2*A*a*c)*x^3

________________________________________________________________________________________

Fricas [A]  time = 1.31042, size = 244, normalized size = 2.54 \begin{align*} \frac{1}{7} x^{7} c^{2} C + \frac{1}{3} x^{6} c b C + \frac{1}{5} x^{5} b^{2} C + \frac{2}{5} x^{5} c a C + \frac{1}{5} x^{5} c^{2} A + \frac{1}{2} x^{4} b a C + \frac{1}{2} x^{4} c b A + \frac{1}{3} x^{3} a^{2} C + \frac{1}{3} x^{3} b^{2} A + \frac{2}{3} x^{3} c a A + x^{2} b a A + x a^{2} A \end{align*}

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

[In]

integrate((c*x^2+b*x+a)^2*(C*x^2+A),x, algorithm="fricas")

[Out]

1/7*x^7*c^2*C + 1/3*x^6*c*b*C + 1/5*x^5*b^2*C + 2/5*x^5*c*a*C + 1/5*x^5*c^2*A + 1/2*x^4*b*a*C + 1/2*x^4*c*b*A
+ 1/3*x^3*a^2*C + 1/3*x^3*b^2*A + 2/3*x^3*c*a*A + x^2*b*a*A + x*a^2*A

________________________________________________________________________________________

Sympy [A]  time = 0.07848, size = 102, normalized size = 1.06 \begin{align*} A a^{2} x + A a b x^{2} + \frac{C b c x^{6}}{3} + \frac{C c^{2} x^{7}}{7} + x^{5} \left (\frac{A c^{2}}{5} + \frac{2 C a c}{5} + \frac{C b^{2}}{5}\right ) + x^{4} \left (\frac{A b c}{2} + \frac{C a b}{2}\right ) + x^{3} \left (\frac{2 A a c}{3} + \frac{A b^{2}}{3} + \frac{C a^{2}}{3}\right ) \end{align*}

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

[In]

integrate((c*x**2+b*x+a)**2*(C*x**2+A),x)

[Out]

A*a**2*x + A*a*b*x**2 + C*b*c*x**6/3 + C*c**2*x**7/7 + x**5*(A*c**2/5 + 2*C*a*c/5 + C*b**2/5) + x**4*(A*b*c/2
+ C*a*b/2) + x**3*(2*A*a*c/3 + A*b**2/3 + C*a**2/3)

________________________________________________________________________________________

Giac [A]  time = 1.24712, size = 134, normalized size = 1.4 \begin{align*} \frac{1}{7} \, C c^{2} x^{7} + \frac{1}{3} \, C b c x^{6} + \frac{1}{5} \, C b^{2} x^{5} + \frac{2}{5} \, C a c x^{5} + \frac{1}{5} \, A c^{2} x^{5} + \frac{1}{2} \, C a b x^{4} + \frac{1}{2} \, A b c x^{4} + \frac{1}{3} \, C a^{2} x^{3} + \frac{1}{3} \, A b^{2} x^{3} + \frac{2}{3} \, A a c x^{3} + A a b x^{2} + A a^{2} x \end{align*}

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

[In]

integrate((c*x^2+b*x+a)^2*(C*x^2+A),x, algorithm="giac")

[Out]

1/7*C*c^2*x^7 + 1/3*C*b*c*x^6 + 1/5*C*b^2*x^5 + 2/5*C*a*c*x^5 + 1/5*A*c^2*x^5 + 1/2*C*a*b*x^4 + 1/2*A*b*c*x^4
+ 1/3*C*a^2*x^3 + 1/3*A*b^2*x^3 + 2/3*A*a*c*x^3 + A*a*b*x^2 + A*a^2*x