### 3.139 $$\int (d+e x)^m (-c d^2+b d e+b e^2 x+c e^2 x^2)^p (-(c d-b e) f+(c e f-c d g+b e g) x+c e g x^2) \, dx$$

Optimal. Leaf size=222 $\frac{g (d+e x)^{m-1} \left (-d (c d-b e)+b e^2 x+c e^2 x^2\right )^{p+2}}{c e^2 (m+2 p+3)}-\frac{(d+e x)^m (-b e+c d-c e x)^2 \left (-d (c d-b e)+b e^2 x+c e^2 x^2\right )^p \left (\frac{c (d+e x)}{2 c d-b e}\right )^{-m-p} (b e g (m+p+1)+c (d g (1-m)-e f (m+2 p+3))) \, _2F_1\left (-m-p,p+2;p+3;\frac{c d-b e-c e x}{2 c d-b e}\right )}{c^2 e^2 (p+2) (m+2 p+3)}$

[Out]

(g*(d + e*x)^(-1 + m)*(-(d*(c*d - b*e)) + b*e^2*x + c*e^2*x^2)^(2 + p))/(c*e^2*(3 + m + 2*p)) - ((b*e*g*(1 + m
+ p) + c*(d*g*(1 - m) - e*f*(3 + m + 2*p)))*(d + e*x)^m*((c*(d + e*x))/(2*c*d - b*e))^(-m - p)*(c*d - b*e - c
*e*x)^2*(-(d*(c*d - b*e)) + b*e^2*x + c*e^2*x^2)^p*Hypergeometric2F1[-m - p, 2 + p, 3 + p, (c*d - b*e - c*e*x)
/(2*c*d - b*e)])/(c^2*e^2*(2 + p)*(3 + m + 2*p))

________________________________________________________________________________________

Rubi [A]  time = 0.40739, antiderivative size = 222, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 70, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.086, Rules used = {1632, 794, 679, 677, 70, 69} $\frac{g (d+e x)^{m-1} \left (-d (c d-b e)+b e^2 x+c e^2 x^2\right )^{p+2}}{c e^2 (m+2 p+3)}-\frac{(d+e x)^m (-b e+c d-c e x)^2 \left (-d (c d-b e)+b e^2 x+c e^2 x^2\right )^p \left (\frac{c (d+e x)}{2 c d-b e}\right )^{-m-p} (b e g (m+p+1)+c (d g (1-m)-e f (m+2 p+3))) \, _2F_1\left (-m-p,p+2;p+3;\frac{c d-b e-c e x}{2 c d-b e}\right )}{c^2 e^2 (p+2) (m+2 p+3)}$

Antiderivative was successfully veriﬁed.

[In]

Int[(d + e*x)^m*(-(c*d^2) + b*d*e + b*e^2*x + c*e^2*x^2)^p*(-((c*d - b*e)*f) + (c*e*f - c*d*g + b*e*g)*x + c*e
*g*x^2),x]

[Out]

(g*(d + e*x)^(-1 + m)*(-(d*(c*d - b*e)) + b*e^2*x + c*e^2*x^2)^(2 + p))/(c*e^2*(3 + m + 2*p)) - ((b*e*g*(1 + m
+ p) + c*(d*g*(1 - m) - e*f*(3 + m + 2*p)))*(d + e*x)^m*((c*(d + e*x))/(2*c*d - b*e))^(-m - p)*(c*d - b*e - c
*e*x)^2*(-(d*(c*d - b*e)) + b*e^2*x + c*e^2*x^2)^p*Hypergeometric2F1[-m - p, 2 + p, 3 + p, (c*d - b*e - c*e*x)
/(2*c*d - b*e)])/(c^2*e^2*(2 + p)*(3 + m + 2*p))

Rule 1632

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

Rule 794

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp
[(g*(d + e*x)^m*(a + b*x + c*x^2)^(p + 1))/(c*(m + 2*p + 2)), x] + Dist[(m*(g*(c*d - b*e) + c*e*f) + e*(p + 1)
*(2*c*f - b*g))/(c*e*(m + 2*p + 2)), Int[(d + e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g
, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[m + 2*p + 2, 0] && (NeQ[m, 2] || Eq
Q[d, 0])

Rule 679

Int[((d_) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Dist[(d^IntPart[m]*(d + e*
x)^FracPart[m])/(1 + (e*x)/d)^FracPart[m], Int[(1 + (e*x)/d)^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[c*d^2 - b*d*e + a*e^2, 0] &&  !IntegerQ[p] &&  !(IntegerQ[m] || GtQ
[d, 0])

Rule 677

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

Rule 70

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Dist[(c + d*x)^FracPart[n]/((b/(b*c - a*d)
)^IntPart[n]*((b*(c + d*x))/(b*c - a*d))^FracPart[n]), Int[(a + b*x)^m*Simp[(b*c)/(b*c - a*d) + (b*d*x)/(b*c -
a*d), x]^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] &&
(RationalQ[m] ||  !SimplerQ[n + 1, m + 1])

Rule 69

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*Hypergeometric2F1[
-n, m + 1, m + 2, -((d*(a + b*x))/(b*c - a*d))])/(b*(m + 1)*(b/(b*c - a*d))^n), x] /; FreeQ[{a, b, c, d, m, n}
, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] ||  !(Ra
tionalQ[n] && GtQ[-(d/(b*c - a*d)), 0]))

Rubi steps

\begin{align*} \int (d+e x)^m \left (-c d^2+b d e+b e^2 x+c e^2 x^2\right )^p \left (-(c d-b e) f+(c e f-c d g+b e g) x+c e g x^2\right ) \, dx &=(d e) \int (d+e x)^{-1+m} \left (\frac{f}{d e}+\frac{g x}{d e}\right ) \left (-c d^2+b d e+b e^2 x+c e^2 x^2\right )^{1+p} \, dx\\ &=\frac{g (d+e x)^{-1+m} \left (-d (c d-b e)+b e^2 x+c e^2 x^2\right )^{2+p}}{c e^2 (3+m+2 p)}+\frac{\left (d \left (\left (\frac{c e^2 f}{d}+\frac{\left (c d e^2-b e^3\right ) g}{d e}\right ) (-1+m)+e \left (\frac{2 c e f}{d}-\frac{b e g}{d}\right ) (2+p)\right )\right ) \int (d+e x)^{-1+m} \left (-c d^2+b d e+b e^2 x+c e^2 x^2\right )^{1+p} \, dx}{c e^2 (1+m+2 (1+p))}\\ &=\frac{g (d+e x)^{-1+m} \left (-d (c d-b e)+b e^2 x+c e^2 x^2\right )^{2+p}}{c e^2 (3+m+2 p)}+\frac{\left (\left (\left (\frac{c e^2 f}{d}+\frac{\left (c d e^2-b e^3\right ) g}{d e}\right ) (-1+m)+e \left (\frac{2 c e f}{d}-\frac{b e g}{d}\right ) (2+p)\right ) (d+e x)^m \left (1+\frac{e x}{d}\right )^{-m}\right ) \int \left (1+\frac{e x}{d}\right )^{-1+m} \left (-c d^2+b d e+b e^2 x+c e^2 x^2\right )^{1+p} \, dx}{c e^2 (1+m+2 (1+p))}\\ &=\frac{g (d+e x)^{-1+m} \left (-d (c d-b e)+b e^2 x+c e^2 x^2\right )^{2+p}}{c e^2 (3+m+2 p)}+\frac{\left (\left (\left (\frac{c e^2 f}{d}+\frac{\left (c d e^2-b e^3\right ) g}{d e}\right ) (-1+m)+e \left (\frac{2 c e f}{d}-\frac{b e g}{d}\right ) (2+p)\right ) (d+e x)^m \left (1+\frac{e x}{d}\right )^{-m-p} \left (-c d^2+b d e+c d e x\right )^{-p} \left (-c d^2+b d e+b e^2 x+c e^2 x^2\right )^p\right ) \int \left (1+\frac{e x}{d}\right )^{m+p} \left (-c d^2+b d e+c d e x\right )^{1+p} \, dx}{c e^2 (1+m+2 (1+p))}\\ &=\frac{g (d+e x)^{-1+m} \left (-d (c d-b e)+b e^2 x+c e^2 x^2\right )^{2+p}}{c e^2 (3+m+2 p)}+\frac{\left (\left (\left (\frac{c e^2 f}{d}+\frac{\left (c d e^2-b e^3\right ) g}{d e}\right ) (-1+m)+e \left (\frac{2 c e f}{d}-\frac{b e g}{d}\right ) (2+p)\right ) (d+e x)^m \left (\frac{c d e \left (1+\frac{e x}{d}\right )}{c d e-\frac{e \left (-c d^2+b d e\right )}{d}}\right )^{-m-p} \left (-c d^2+b d e+c d e x\right )^{-p} \left (-c d^2+b d e+b e^2 x+c e^2 x^2\right )^p\right ) \int \left (-c d^2+b d e+c d e x\right )^{1+p} \left (\frac{c d}{2 c d-b e}+\frac{c e x}{2 c d-b e}\right )^{m+p} \, dx}{c e^2 (1+m+2 (1+p))}\\ &=\frac{g (d+e x)^{-1+m} \left (-d (c d-b e)+b e^2 x+c e^2 x^2\right )^{2+p}}{c e^2 (3+m+2 p)}-\frac{(c d g (1-m)+b e g (1+m+p)-c e f (3+m+2 p)) (d+e x)^m \left (\frac{c (d+e x)}{2 c d-b e}\right )^{-m-p} (c d-b e-c e x)^2 \left (-d (c d-b e)+b e^2 x+c e^2 x^2\right )^p \, _2F_1\left (-m-p,2+p;3+p;\frac{c d-b e-c e x}{2 c d-b e}\right )}{c^2 e^2 (2+p) (3+m+2 p)}\\ \end{align*}

Mathematica [A]  time = 0.361065, size = 165, normalized size = 0.74 $\frac{(d+e x)^m (b e-c d+c e x)^2 (-(d+e x) (c (d-e x)-b e))^p \left (\frac{e \left (\frac{c (d+e x)}{2 c d-b e}\right )^{-m-p} (-b e g (m+p+1)+c d g (m-1)+c e f (m+2 p+3)) \, _2F_1\left (-m-p,p+2;p+3;\frac{-c d+b e+c e x}{b e-2 c d}\right )}{p+2}+c e g (d+e x)\right )}{c^2 e^3 (m+2 p+3)}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(d + e*x)^m*(-(c*d^2) + b*d*e + b*e^2*x + c*e^2*x^2)^p*(-((c*d - b*e)*f) + (c*e*f - c*d*g + b*e*g)*x
+ c*e*g*x^2),x]

[Out]

((d + e*x)^m*(-(c*d) + b*e + c*e*x)^2*(-((d + e*x)*(-(b*e) + c*(d - e*x))))^p*(c*e*g*(d + e*x) + (e*(c*d*g*(-1
+ m) - b*e*g*(1 + m + p) + c*e*f*(3 + m + 2*p))*((c*(d + e*x))/(2*c*d - b*e))^(-m - p)*Hypergeometric2F1[-m -
p, 2 + p, 3 + p, (-(c*d) + b*e + c*e*x)/(-2*c*d + b*e)])/(2 + p)))/(c^2*e^3*(3 + m + 2*p))

________________________________________________________________________________________

Maple [F]  time = 1.615, size = 0, normalized size = 0. \begin{align*} \int \left ( ex+d \right ) ^{m} \left ( c{e}^{2}{x}^{2}+xb{e}^{2}+bde-c{d}^{2} \right ) ^{p} \left ( - \left ( -be+cd \right ) f+ \left ( beg-cdg+cef \right ) x+ceg{x}^{2} \right ) \, dx \end{align*}

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

[In]

int((e*x+d)^m*(c*e^2*x^2+b*e^2*x+b*d*e-c*d^2)^p*(-(-b*e+c*d)*f+(b*e*g-c*d*g+c*e*f)*x+c*e*g*x^2),x)

[Out]

int((e*x+d)^m*(c*e^2*x^2+b*e^2*x+b*d*e-c*d^2)^p*(-(-b*e+c*d)*f+(b*e*g-c*d*g+c*e*f)*x+c*e*g*x^2),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (c e g x^{2} -{\left (c d - b e\right )} f +{\left (c e f - c d g + b e g\right )} x\right )}{\left (c e^{2} x^{2} + b e^{2} x - c d^{2} + b d e\right )}^{p}{\left (e x + d\right )}^{m}\,{d x} \end{align*}

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

[In]

integrate((e*x+d)^m*(c*e^2*x^2+b*e^2*x+b*d*e-c*d^2)^p*(-(-b*e+c*d)*f+(b*e*g-c*d*g+c*e*f)*x+c*e*g*x^2),x, algor
ithm="maxima")

[Out]

integrate((c*e*g*x^2 - (c*d - b*e)*f + (c*e*f - c*d*g + b*e*g)*x)*(c*e^2*x^2 + b*e^2*x - c*d^2 + b*d*e)^p*(e*x
+ d)^m, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (c e g x^{2} -{\left (c d - b e\right )} f +{\left (c e f -{\left (c d - b e\right )} g\right )} x\right )}{\left (c e^{2} x^{2} + b e^{2} x - c d^{2} + b d e\right )}^{p}{\left (e x + d\right )}^{m}, x\right ) \end{align*}

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

[In]

integrate((e*x+d)^m*(c*e^2*x^2+b*e^2*x+b*d*e-c*d^2)^p*(-(-b*e+c*d)*f+(b*e*g-c*d*g+c*e*f)*x+c*e*g*x^2),x, algor
ithm="fricas")

[Out]

integral((c*e*g*x^2 - (c*d - b*e)*f + (c*e*f - (c*d - b*e)*g)*x)*(c*e^2*x^2 + b*e^2*x - c*d^2 + b*d*e)^p*(e*x
+ d)^m, x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

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

[In]

integrate((e*x+d)**m*(c*e**2*x**2+b*e**2*x+b*d*e-c*d**2)**p*(-(-b*e+c*d)*f+(b*e*g-c*d*g+c*e*f)*x+c*e*g*x**2),x
)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (c e g x^{2} -{\left (c d - b e\right )} f +{\left (c e f - c d g + b e g\right )} x\right )}{\left (c e^{2} x^{2} + b e^{2} x - c d^{2} + b d e\right )}^{p}{\left (e x + d\right )}^{m}\,{d x} \end{align*}

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

[In]

integrate((e*x+d)^m*(c*e^2*x^2+b*e^2*x+b*d*e-c*d^2)^p*(-(-b*e+c*d)*f+(b*e*g-c*d*g+c*e*f)*x+c*e*g*x^2),x, algor
ithm="giac")

[Out]

integrate((c*e*g*x^2 - (c*d - b*e)*f + (c*e*f - c*d*g + b*e*g)*x)*(c*e^2*x^2 + b*e^2*x - c*d^2 + b*d*e)^p*(e*x
+ d)^m, x)