\(\int (a+b x)^m (c+d x)^{1-m} (e+f x)^2 \, dx\) [1758]

Optimal result
Mathematica [A] (warning: unable to verify)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F(-2)]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 26, antiderivative size = 237 \[ \int (a+b x)^m (c+d x)^{1-m} (e+f x)^2 \, dx=\frac {f (8 b d e-a d f (6-m)-b c f (2+m)) (a+b x)^{1+m} (c+d x)^{2-m}}{12 b^2 d^2}+\frac {f^2 (a+b x)^{2+m} (c+d x)^{2-m}}{4 b^2 d}+\frac {\left (a^2 d^2 f^2 \left (6-5 m+m^2\right )-2 a b d f (2-m) (4 d e-c f (1+m))+b^2 \left (12 d^2 e^2-8 c d e f (1+m)+c^2 f^2 \left (2+3 m+m^2\right )\right )\right ) (a+b x)^{1+m} (c+d x)^{2-m} \operatorname {Hypergeometric2F1}\left (1,3,2+m,-\frac {d (a+b x)}{b c-a d}\right )}{12 b^2 d^2 (b c-a d) (1+m)} \] Output:

1/12*f*(8*b*d*e-a*d*f*(6-m)-b*c*f*(2+m))*(b*x+a)^(1+m)*(d*x+c)^(2-m)/b^2/d 
^2+1/4*f^2*(b*x+a)^(2+m)*(d*x+c)^(2-m)/b^2/d+1/12*(a^2*d^2*f^2*(m^2-5*m+6) 
-2*a*b*d*f*(2-m)*(4*d*e-c*f*(1+m))+b^2*(12*d^2*e^2-8*c*d*e*f*(1+m)+c^2*f^2 
*(m^2+3*m+2)))*(b*x+a)^(1+m)*(d*x+c)^(2-m)*hypergeom([1, 3],[2+m],-d*(b*x+ 
a)/(-a*d+b*c))/b^2/d^2/(-a*d+b*c)/(1+m)
 

Mathematica [A] (warning: unable to verify)

Time = 0.26 (sec) , antiderivative size = 223, normalized size of antiderivative = 0.94 \[ \int (a+b x)^m (c+d x)^{1-m} (e+f x)^2 \, dx=\frac {(a+b x)^{1+m} (c+d x)^{-m} \left (b^2 f (1+m) (5 b d e+a d f (-3+m)-b c f (2+m)) (c+d x)^2+3 b^3 d f (1+m) (c+d x)^2 (e+f x)+(b c-a d) \left (a^2 d^2 f^2 \left (6-5 m+m^2\right )-2 a b d f (-2+m) (-4 d e+c f (1+m))+b^2 \left (12 d^2 e^2-8 c d e f (1+m)+c^2 f^2 \left (2+3 m+m^2\right )\right )\right ) \left (\frac {b (c+d x)}{b c-a d}\right )^m \operatorname {Hypergeometric2F1}\left (-1+m,1+m,2+m,\frac {d (a+b x)}{-b c+a d}\right )\right )}{12 b^4 d^2 (1+m)} \] Input:

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

Output:

((a + b*x)^(1 + m)*(b^2*f*(1 + m)*(5*b*d*e + a*d*f*(-3 + m) - b*c*f*(2 + m 
))*(c + d*x)^2 + 3*b^3*d*f*(1 + m)*(c + d*x)^2*(e + f*x) + (b*c - a*d)*(a^ 
2*d^2*f^2*(6 - 5*m + m^2) - 2*a*b*d*f*(-2 + m)*(-4*d*e + c*f*(1 + m)) + b^ 
2*(12*d^2*e^2 - 8*c*d*e*f*(1 + m) + c^2*f^2*(2 + 3*m + m^2)))*((b*(c + d*x 
))/(b*c - a*d))^m*Hypergeometric2F1[-1 + m, 1 + m, 2 + m, (d*(a + b*x))/(- 
(b*c) + a*d)]))/(12*b^4*d^2*(1 + m)*(c + d*x)^m)
 

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 270, normalized size of antiderivative = 1.14, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {101, 25, 90, 80, 79}

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

\(\Big \downarrow \) 101

\(\displaystyle \frac {\int -(a+b x)^m (c+d x)^{1-m} (a f (c f+d e (2-m))-b e (4 d e-c f (m+1))-f (5 b d e-a d f (3-m)-b c f (m+2)) x)dx}{4 b d}+\frac {f (e+f x) (a+b x)^{m+1} (c+d x)^{2-m}}{4 b d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {f (e+f x) (a+b x)^{m+1} (c+d x)^{2-m}}{4 b d}-\frac {\int (a+b x)^m (c+d x)^{1-m} (a f (c f+d e (2-m))-b e (4 d e-c f (m+1))-f (5 b d e-a d f (3-m)-b c f (m+2)) x)dx}{4 b d}\)

\(\Big \downarrow \) 90

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

\(\Big \downarrow \) 80

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

\(\Big \downarrow \) 79

\(\displaystyle \frac {f (e+f x) (a+b x)^{m+1} (c+d x)^{2-m}}{4 b d}-\frac {-\frac {(b c-a d) (a+b x)^{m+1} (c+d x)^{-m} \left (\frac {b (c+d x)}{b c-a d}\right )^m \left (a^2 d^2 f^2 \left (m^2-5 m+6\right )-2 a b d f (2-m) (4 d e-c f (m+1))+b^2 \left (c^2 f^2 \left (m^2+3 m+2\right )-8 c d e f (m+1)+12 d^2 e^2\right )\right ) \operatorname {Hypergeometric2F1}\left (m-1,m+1,m+2,-\frac {d (a+b x)}{b c-a d}\right )}{3 b^3 d (m+1)}-\frac {f (a+b x)^{m+1} (c+d x)^{2-m} (-a d f (3-m)-b c f (m+2)+5 b d e)}{3 b d}}{4 b d}\)

Input:

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

Output:

(f*(a + b*x)^(1 + m)*(c + d*x)^(2 - m)*(e + f*x))/(4*b*d) - (-1/3*(f*(5*b* 
d*e - a*d*f*(3 - m) - b*c*f*(2 + m))*(a + b*x)^(1 + m)*(c + d*x)^(2 - m))/ 
(b*d) - ((b*c - a*d)*(a^2*d^2*f^2*(6 - 5*m + m^2) - 2*a*b*d*f*(2 - m)*(4*d 
*e - c*f*(1 + m)) + b^2*(12*d^2*e^2 - 8*c*d*e*f*(1 + m) + c^2*f^2*(2 + 3*m 
 + m^2)))*(a + b*x)^(1 + m)*((b*(c + d*x))/(b*c - a*d))^m*Hypergeometric2F 
1[-1 + m, 1 + m, 2 + m, -((d*(a + b*x))/(b*c - a*d))])/(3*b^3*d*(1 + m)*(c 
 + d*x)^m))/(4*b*d)
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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

rule 80
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(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] &&  !IntegerQ[m] &&  !Integ 
erQ[n] && (RationalQ[m] ||  !SimplerQ[n + 1, m + 1])
 

rule 90
Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p 
_.), x_] :> Simp[b*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), 
 x] + Simp[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(d*f*(n + p 
+ 2))   Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, 
p}, x] && NeQ[n + p + 2, 0]
 

rule 101
Int[((a_.) + (b_.)*(x_))^2*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^( 
p_), x_] :> Simp[b*(a + b*x)*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + 
 p + 3))), x] + Simp[1/(d*f*(n + p + 3))   Int[(c + d*x)^n*(e + f*x)^p*Simp 
[a^2*d*f*(n + p + 3) - b*(b*c*e + a*(d*e*(n + 1) + c*f*(p + 1))) + b*(a*d*f 
*(n + p + 4) - b*(d*e*(n + 2) + c*f*(p + 2)))*x, x], x], x] /; FreeQ[{a, b, 
 c, d, e, f, n, p}, x] && NeQ[n + p + 3, 0]
 
Maple [F]

\[\int \left (b x +a \right )^{m} \left (x d +c \right )^{-m +1} \left (f x +e \right )^{2}d x\]

Input:

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

Output:

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

Fricas [F]

\[ \int (a+b x)^m (c+d x)^{1-m} (e+f x)^2 \, dx=\int { {\left (f x + e\right )}^{2} {\left (b x + a\right )}^{m} {\left (d x + c\right )}^{-m + 1} \,d x } \] Input:

integrate((b*x+a)^m*(d*x+c)^(1-m)*(f*x+e)^2,x, algorithm="fricas")
 

Output:

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

Sympy [F(-2)]

Exception generated. \[ \int (a+b x)^m (c+d x)^{1-m} (e+f x)^2 \, dx=\text {Exception raised: HeuristicGCDFailed} \] Input:

integrate((b*x+a)**m*(d*x+c)**(1-m)*(f*x+e)**2,x)
 

Output:

Exception raised: HeuristicGCDFailed >> no luck
 

Maxima [F]

\[ \int (a+b x)^m (c+d x)^{1-m} (e+f x)^2 \, dx=\int { {\left (f x + e\right )}^{2} {\left (b x + a\right )}^{m} {\left (d x + c\right )}^{-m + 1} \,d x } \] Input:

integrate((b*x+a)^m*(d*x+c)^(1-m)*(f*x+e)^2,x, algorithm="maxima")
 

Output:

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

Giac [F]

\[ \int (a+b x)^m (c+d x)^{1-m} (e+f x)^2 \, dx=\int { {\left (f x + e\right )}^{2} {\left (b x + a\right )}^{m} {\left (d x + c\right )}^{-m + 1} \,d x } \] Input:

integrate((b*x+a)^m*(d*x+c)^(1-m)*(f*x+e)^2,x, algorithm="giac")
 

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int (a+b x)^m (c+d x)^{1-m} (e+f x)^2 \, dx=\left (\int \frac {\left (b x +a \right )^{m}}{\left (d x +c \right )^{m}}d x \right ) c \,e^{2}+\left (\int \frac {\left (b x +a \right )^{m} x^{3}}{\left (d x +c \right )^{m}}d x \right ) d \,f^{2}+\left (\int \frac {\left (b x +a \right )^{m} x^{2}}{\left (d x +c \right )^{m}}d x \right ) c \,f^{2}+2 \left (\int \frac {\left (b x +a \right )^{m} x^{2}}{\left (d x +c \right )^{m}}d x \right ) d e f +2 \left (\int \frac {\left (b x +a \right )^{m} x}{\left (d x +c \right )^{m}}d x \right ) c e f +\left (\int \frac {\left (b x +a \right )^{m} x}{\left (d x +c \right )^{m}}d x \right ) d \,e^{2} \] Input:

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

Output:

int((a + b*x)**m/(c + d*x)**m,x)*c*e**2 + int(((a + b*x)**m*x**3)/(c + d*x 
)**m,x)*d*f**2 + int(((a + b*x)**m*x**2)/(c + d*x)**m,x)*c*f**2 + 2*int((( 
a + b*x)**m*x**2)/(c + d*x)**m,x)*d*e*f + 2*int(((a + b*x)**m*x)/(c + d*x) 
**m,x)*c*e*f + int(((a + b*x)**m*x)/(c + d*x)**m,x)*d*e**2