### 3.1127 $$\int \frac{(a+b x+c x^2)^2}{(b d+2 c d x)^2} \, dx$$

Optimal. Leaf size=72 $-\frac{x \left (b^2-8 a c\right )}{16 c^2 d^2}-\frac{\left (b^2-4 a c\right )^2}{32 c^3 d^2 (b+2 c x)}+\frac{b x^2}{8 c d^2}+\frac{x^3}{12 d^2}$

[Out]

-((b^2 - 8*a*c)*x)/(16*c^2*d^2) + (b*x^2)/(8*c*d^2) + x^3/(12*d^2) - (b^2 - 4*a*c)^2/(32*c^3*d^2*(b + 2*c*x))

________________________________________________________________________________________

Rubi [A]  time = 0.0598793, antiderivative size = 72, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 24, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.042, Rules used = {683} $-\frac{x \left (b^2-8 a c\right )}{16 c^2 d^2}-\frac{\left (b^2-4 a c\right )^2}{32 c^3 d^2 (b+2 c x)}+\frac{b x^2}{8 c d^2}+\frac{x^3}{12 d^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-((b^2 - 8*a*c)*x)/(16*c^2*d^2) + (b*x^2)/(8*c*d^2) + x^3/(12*d^2) - (b^2 - 4*a*c)^2/(32*c^3*d^2*(b + 2*c*x))

Rule 683

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[2*c*d - b*e,
0] && IGtQ[p, 0] &&  !(EqQ[m, 3] && NeQ[p, 1])

Rubi steps

\begin{align*} \int \frac{\left (a+b x+c x^2\right )^2}{(b d+2 c d x)^2} \, dx &=\int \left (\frac{-b^2+8 a c}{16 c^2 d^2}+\frac{b x}{4 c d^2}+\frac{x^2}{4 d^2}+\frac{\left (-b^2+4 a c\right )^2}{16 c^2 d^2 (b+2 c x)^2}\right ) \, dx\\ &=-\frac{\left (b^2-8 a c\right ) x}{16 c^2 d^2}+\frac{b x^2}{8 c d^2}+\frac{x^3}{12 d^2}-\frac{\left (b^2-4 a c\right )^2}{32 c^3 d^2 (b+2 c x)}\\ \end{align*}

Mathematica [A]  time = 0.0519079, size = 59, normalized size = 0.82 $\frac{-\frac{6 x \left (b^2-8 a c\right )}{c^2}-\frac{3 \left (b^2-4 a c\right )^2}{c^3 (b+2 c x)}+\frac{12 b x^2}{c}+8 x^3}{96 d^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

((-6*(b^2 - 8*a*c)*x)/c^2 + (12*b*x^2)/c + 8*x^3 - (3*(b^2 - 4*a*c)^2)/(c^3*(b + 2*c*x)))/(96*d^2)

________________________________________________________________________________________

Maple [A]  time = 0.042, size = 70, normalized size = 1. \begin{align*}{\frac{1}{{d}^{2}} \left ({\frac{1}{16\,{c}^{2}} \left ({\frac{4\,{x}^{3}{c}^{2}}{3}}+2\,bc{x}^{2}+8\,acx-{b}^{2}x \right ) }-{\frac{16\,{a}^{2}{c}^{2}-8\,ac{b}^{2}+{b}^{4}}{32\,{c}^{3} \left ( 2\,cx+b \right ) }} \right ) } \end{align*}

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

[In]

int((c*x^2+b*x+a)^2/(2*c*d*x+b*d)^2,x)

[Out]

1/d^2*(1/16/c^2*(4/3*x^3*c^2+2*b*c*x^2+8*a*c*x-b^2*x)-1/32*(16*a^2*c^2-8*a*b^2*c+b^4)/c^3/(2*c*x+b))

________________________________________________________________________________________

Maxima [A]  time = 1.92837, size = 104, normalized size = 1.44 \begin{align*} -\frac{b^{4} - 8 \, a b^{2} c + 16 \, a^{2} c^{2}}{32 \,{\left (2 \, c^{4} d^{2} x + b c^{3} d^{2}\right )}} + \frac{4 \, c^{2} x^{3} + 6 \, b c x^{2} - 3 \,{\left (b^{2} - 8 \, a c\right )} x}{48 \, c^{2} d^{2}} \end{align*}

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

[In]

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

[Out]

-1/32*(b^4 - 8*a*b^2*c + 16*a^2*c^2)/(2*c^4*d^2*x + b*c^3*d^2) + 1/48*(4*c^2*x^3 + 6*b*c*x^2 - 3*(b^2 - 8*a*c)
*x)/(c^2*d^2)

________________________________________________________________________________________

Fricas [A]  time = 1.8754, size = 182, normalized size = 2.53 \begin{align*} \frac{16 \, c^{4} x^{4} + 32 \, b c^{3} x^{3} + 96 \, a c^{3} x^{2} - 3 \, b^{4} + 24 \, a b^{2} c - 48 \, a^{2} c^{2} - 6 \,{\left (b^{3} c - 8 \, a b c^{2}\right )} x}{96 \,{\left (2 \, c^{4} d^{2} x + b c^{3} d^{2}\right )}} \end{align*}

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

[In]

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

[Out]

1/96*(16*c^4*x^4 + 32*b*c^3*x^3 + 96*a*c^3*x^2 - 3*b^4 + 24*a*b^2*c - 48*a^2*c^2 - 6*(b^3*c - 8*a*b*c^2)*x)/(2
*c^4*d^2*x + b*c^3*d^2)

________________________________________________________________________________________

Sympy [A]  time = 0.6431, size = 78, normalized size = 1.08 \begin{align*} \frac{b x^{2}}{8 c d^{2}} - \frac{16 a^{2} c^{2} - 8 a b^{2} c + b^{4}}{32 b c^{3} d^{2} + 64 c^{4} d^{2} x} + \frac{x^{3}}{12 d^{2}} + \frac{x \left (8 a c - b^{2}\right )}{16 c^{2} d^{2}} \end{align*}

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

[In]

integrate((c*x**2+b*x+a)**2/(2*c*d*x+b*d)**2,x)

[Out]

b*x**2/(8*c*d**2) - (16*a**2*c**2 - 8*a*b**2*c + b**4)/(32*b*c**3*d**2 + 64*c**4*d**2*x) + x**3/(12*d**2) + x*
(8*a*c - b**2)/(16*c**2*d**2)

________________________________________________________________________________________

Giac [B]  time = 1.2094, size = 181, normalized size = 2.51 \begin{align*} -\frac{{\left (2 \, c d x + b d\right )}^{3}{\left (\frac{6 \, b^{2} d^{2}}{{\left (2 \, c d x + b d\right )}^{2}} - \frac{24 \, a c d^{2}}{{\left (2 \, c d x + b d\right )}^{2}} - 1\right )}}{96 \, c^{3} d^{5}} - \frac{\frac{b^{4} c^{3} d^{7}}{2 \, c d x + b d} - \frac{8 \, a b^{2} c^{4} d^{7}}{2 \, c d x + b d} + \frac{16 \, a^{2} c^{5} d^{7}}{2 \, c d x + b d}}{32 \, c^{6} d^{8}} \end{align*}

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

[In]

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

[Out]

-1/96*(2*c*d*x + b*d)^3*(6*b^2*d^2/(2*c*d*x + b*d)^2 - 24*a*c*d^2/(2*c*d*x + b*d)^2 - 1)/(c^3*d^5) - 1/32*(b^4
*c^3*d^7/(2*c*d*x + b*d) - 8*a*b^2*c^4*d^7/(2*c*d*x + b*d) + 16*a^2*c^5*d^7/(2*c*d*x + b*d))/(c^6*d^8)