\(\int (a+b x)^{-n} (c+d x) (e+f x)^{-3+n} \, dx\) [261]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F(-2)]
Maxima [F]
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [F]

Optimal result

Integrand size = 24, antiderivative size = 123 \[ \int (a+b x)^{-n} (c+d x) (e+f x)^{-3+n} \, dx=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-2+n}}{f (b e-a f) (2-n)}+\frac {(b c f-a d f (2-n)+b d (e-e n)) (a+b x)^{1-n} (e+f x)^{-1+n}}{f (b e-a f)^2 (1-n) (2-n)} \] Output:

-(-c*f+d*e)*(b*x+a)^(1-n)*(f*x+e)^(-2+n)/f/(-a*f+b*e)/(2-n)+(b*c*f-a*d*f*( 
2-n)+b*d*(-e*n+e))*(b*x+a)^(1-n)*(f*x+e)^(-1+n)/f/(-a*f+b*e)^2/(1-n)/(2-n)
 

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.68 \[ \int (a+b x)^{-n} (c+d x) (e+f x)^{-3+n} \, dx=\frac {(a+b x)^{1-n} (e+f x)^{-2+n} (-a d e+a c f (-1+n)+a d f (-2+n) x-b d e (-1+n) x+b c (-e (-2+n)+f x))}{(b e-a f)^2 (-2+n) (-1+n)} \] Input:

Integrate[((c + d*x)*(e + f*x)^(-3 + n))/(a + b*x)^n,x]
 

Output:

((a + b*x)^(1 - n)*(e + f*x)^(-2 + n)*(-(a*d*e) + a*c*f*(-1 + n) + a*d*f*( 
-2 + n)*x - b*d*e*(-1 + n)*x + b*c*(-(e*(-2 + n)) + f*x)))/((b*e - a*f)^2* 
(-2 + n)*(-1 + n))
 

Rubi [A] (verified)

Time = 0.24 (sec) , antiderivative size = 123, 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.083, Rules used = {88, 48}

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

\(\Big \downarrow \) 88

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

\(\Big \downarrow \) 48

\(\displaystyle \frac {(a+b x)^{1-n} (e+f x)^{n-1} (-a d f (2-n)+b c f+b d (e-e n))}{f (1-n) (2-n) (b e-a f)^2}-\frac {(a+b x)^{1-n} (d e-c f) (e+f x)^{n-2}}{f (2-n) (b e-a f)}\)

Input:

Int[((c + d*x)*(e + f*x)^(-3 + n))/(a + b*x)^n,x]
 

Output:

-(((d*e - c*f)*(a + b*x)^(1 - n)*(e + f*x)^(-2 + n))/(f*(b*e - a*f)*(2 - n 
))) + ((b*c*f - a*d*f*(2 - n) + b*d*(e - e*n))*(a + b*x)^(1 - n)*(e + f*x) 
^(-1 + n))/(f*(b*e - a*f)^2*(1 - n)*(2 - n))
 

Defintions of rubi rules used

rule 48
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp 
[(a + b*x)^(m + 1)*((c + d*x)^(n + 1)/((b*c - a*d)*(m + 1))), x] /; FreeQ[{ 
a, b, c, d, m, n}, x] && EqQ[m + n + 2, 0] && NeQ[m, -1]
 

rule 88
Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p 
_.), x_] :> Simp[(-(b*e - a*f))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p 
+ 1)*(c*f - d*e))), x] - Simp[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p 
+ 1)))/(f*(p + 1)*(c*f - d*e))   Int[(c + d*x)^n*(e + f*x)^Simplify[p + 1], 
 x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] &&  !RationalQ[p] && SumSimpl 
erQ[p, 1]
 
Maple [A] (verified)

Time = 0.54 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.30

method result size
gosper \(\frac {\left (b x +a \right ) \left (f x +e \right )^{n -2} \left (b x +a \right )^{-n} \left (a d f n x -b d e n x +a c f n -2 a d f x -b c e n +b c f x +b d e x -a c f -a d e +2 b c e \right )}{a^{2} f^{2} n^{2}-2 a b e f \,n^{2}+b^{2} e^{2} n^{2}-3 a^{2} f^{2} n +6 a b e f n -3 b^{2} e^{2} n +2 a^{2} f^{2}-4 a b e f +2 b^{2} e^{2}}\) \(160\)
orering \(\frac {\left (b x +a \right ) \left (f x +e \right ) \left (a d f n x -b d e n x +a c f n -2 a d f x -b c e n +b c f x +b d e x -a c f -a d e +2 b c e \right ) \left (f x +e \right )^{-3+n} \left (b x +a \right )^{-n}}{a^{2} f^{2} n^{2}-2 a b e f \,n^{2}+b^{2} e^{2} n^{2}-3 a^{2} f^{2} n +6 a b e f n -3 b^{2} e^{2} n +2 a^{2} f^{2}-4 a b e f +2 b^{2} e^{2}}\) \(165\)
parallelrisch \(\frac {\left (x^{3} \left (f x +e \right )^{-3+n} a \,b^{2} d \,f^{3} n -x^{3} \left (f x +e \right )^{-3+n} b^{3} d e \,f^{2} n +x^{2} \left (f x +e \right )^{-3+n} a \,b^{2} c \,f^{3} n -x^{2} \left (f x +e \right )^{-3+n} b^{3} c e \,f^{2} n -x^{2} \left (f x +e \right )^{-3+n} b^{3} d \,e^{2} f n -2 x^{2} \left (f x +e \right )^{-3+n} a \,b^{2} d e \,f^{2}+x \left (f x +e \right )^{-3+n} a^{2} b c \,f^{3} n +x \left (f x +e \right )^{-3+n} a^{2} b d e \,f^{2} n +x^{2} \left (f x +e \right )^{-3+n} a^{2} b d \,f^{3} n -x \left (f x +e \right )^{-3+n} b^{3} c \,e^{2} f n -3 x \left (f x +e \right )^{-3+n} a^{2} b d e \,f^{2}+2 x \left (f x +e \right )^{-3+n} a \,b^{2} c e \,f^{2}+\left (f x +e \right )^{-3+n} a^{2} b c e \,f^{2} n +x^{3} \left (f x +e \right )^{-3+n} b^{3} c \,f^{3}-\left (f x +e \right )^{-3+n} a \,b^{2} c \,e^{2} f n -x \left (f x +e \right )^{-3+n} a \,b^{2} d \,e^{2} f n +2 \left (f x +e \right )^{-3+n} a \,b^{2} c \,e^{2} f -2 x^{3} \left (f x +e \right )^{-3+n} a \,b^{2} d \,f^{3}+x^{3} \left (f x +e \right )^{-3+n} b^{3} d e \,f^{2}-2 x^{2} \left (f x +e \right )^{-3+n} a^{2} b d \,f^{3}+3 x^{2} \left (f x +e \right )^{-3+n} b^{3} c e \,f^{2}+x^{2} \left (f x +e \right )^{-3+n} b^{3} d \,e^{2} f -x \left (f x +e \right )^{-3+n} a^{2} b c \,f^{3}+2 x \left (f x +e \right )^{-3+n} b^{3} c \,e^{2} f -\left (f x +e \right )^{-3+n} a^{2} b c e \,f^{2}-\left (f x +e \right )^{-3+n} a^{2} b d \,e^{2} f \right ) \left (b x +a \right )^{-n}}{\left (a^{2} f^{2} n^{2}-2 a b e f \,n^{2}+b^{2} e^{2} n^{2}-3 a^{2} f^{2} n +6 a b e f n -3 b^{2} e^{2} n +2 a^{2} f^{2}-4 a b e f +2 b^{2} e^{2}\right ) b f}\) \(650\)

Input:

int((d*x+c)*(f*x+e)^(-3+n)/((b*x+a)^n),x,method=_RETURNVERBOSE)
 

Output:

(b*x+a)*(f*x+e)^(n-2)/((b*x+a)^n)/(a^2*f^2*n^2-2*a*b*e*f*n^2+b^2*e^2*n^2-3 
*a^2*f^2*n+6*a*b*e*f*n-3*b^2*e^2*n+2*a^2*f^2-4*a*b*e*f+2*b^2*e^2)*(a*d*f*n 
*x-b*d*e*n*x+a*c*f*n-2*a*d*f*x-b*c*e*n+b*c*f*x+b*d*e*x-a*c*f-a*d*e+2*b*c*e 
)
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 326 vs. \(2 (115) = 230\).

Time = 0.11 (sec) , antiderivative size = 326, normalized size of antiderivative = 2.65 \[ \int (a+b x)^{-n} (c+d x) (e+f x)^{-3+n} \, dx=-\frac {{\left (a^{2} c e f - {\left (b^{2} d e f + {\left (b^{2} c - 2 \, a b d\right )} f^{2} - {\left (b^{2} d e f - a b d f^{2}\right )} n\right )} x^{3} - {\left (2 \, a b c - a^{2} d\right )} e^{2} - {\left (b^{2} d e^{2} - 2 \, a^{2} d f^{2} + {\left (3 \, b^{2} c - 2 \, a b d\right )} e f - {\left (b^{2} d e^{2} + b^{2} c e f - {\left (a b c + a^{2} d\right )} f^{2}\right )} n\right )} x^{2} + {\left (a b c e^{2} - a^{2} c e f\right )} n - {\left (2 \, b^{2} c e^{2} - a^{2} c f^{2} + {\left (2 \, a b c - 3 \, a^{2} d\right )} e f + {\left (a^{2} d e f + a^{2} c f^{2} - {\left (b^{2} c + a b d\right )} e^{2}\right )} n\right )} x\right )} {\left (f x + e\right )}^{n - 3}}{{\left (2 \, b^{2} e^{2} - 4 \, a b e f + 2 \, a^{2} f^{2} + {\left (b^{2} e^{2} - 2 \, a b e f + a^{2} f^{2}\right )} n^{2} - 3 \, {\left (b^{2} e^{2} - 2 \, a b e f + a^{2} f^{2}\right )} n\right )} {\left (b x + a\right )}^{n}} \] Input:

integrate((d*x+c)*(f*x+e)^(-3+n)/((b*x+a)^n),x, algorithm="fricas")
 

Output:

-(a^2*c*e*f - (b^2*d*e*f + (b^2*c - 2*a*b*d)*f^2 - (b^2*d*e*f - a*b*d*f^2) 
*n)*x^3 - (2*a*b*c - a^2*d)*e^2 - (b^2*d*e^2 - 2*a^2*d*f^2 + (3*b^2*c - 2* 
a*b*d)*e*f - (b^2*d*e^2 + b^2*c*e*f - (a*b*c + a^2*d)*f^2)*n)*x^2 + (a*b*c 
*e^2 - a^2*c*e*f)*n - (2*b^2*c*e^2 - a^2*c*f^2 + (2*a*b*c - 3*a^2*d)*e*f + 
 (a^2*d*e*f + a^2*c*f^2 - (b^2*c + a*b*d)*e^2)*n)*x)*(f*x + e)^(n - 3)/((2 
*b^2*e^2 - 4*a*b*e*f + 2*a^2*f^2 + (b^2*e^2 - 2*a*b*e*f + a^2*f^2)*n^2 - 3 
*(b^2*e^2 - 2*a*b*e*f + a^2*f^2)*n)*(b*x + a)^n)
 

Sympy [F(-2)]

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

integrate((d*x+c)*(f*x+e)**(-3+n)/((b*x+a)**n),x)
                                                                                    
                                                                                    
 

Output:

Exception raised: HeuristicGCDFailed >> no luck
 

Maxima [F]

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

integrate((d*x+c)*(f*x+e)^(-3+n)/((b*x+a)^n),x, algorithm="maxima")
 

Output:

integrate((d*x + c)*(f*x + e)^(n - 3)/(b*x + a)^n, x)
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1050 vs. \(2 (115) = 230\).

Time = 0.15 (sec) , antiderivative size = 1050, normalized size of antiderivative = 8.54 \[ \int (a+b x)^{-n} (c+d x) (e+f x)^{-3+n} \, dx=\text {Too large to display} \] Input:

integrate((d*x+c)*(f*x+e)^(-3+n)/((b*x+a)^n),x, algorithm="giac")
 

Output:

-(b^2*d*e*f*n*x^3*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + a)^n - a*b*d* 
f^2*n*x^3*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + a)^n + b^2*d*e^2*n*x^ 
2*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + a)^n + b^2*c*e*f*n*x^2*e^(n*l 
og(f*x + e) - 3*log(f*x + e))/(b*x + a)^n - a*b*c*f^2*n*x^2*e^(n*log(f*x + 
 e) - 3*log(f*x + e))/(b*x + a)^n - a^2*d*f^2*n*x^2*e^(n*log(f*x + e) - 3* 
log(f*x + e))/(b*x + a)^n - b^2*d*e*f*x^3*e^(n*log(f*x + e) - 3*log(f*x + 
e))/(b*x + a)^n - b^2*c*f^2*x^3*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + 
 a)^n + 2*a*b*d*f^2*x^3*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + a)^n + 
b^2*c*e^2*n*x*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + a)^n + a*b*d*e^2* 
n*x*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + a)^n - a^2*d*e*f*n*x*e^(n*l 
og(f*x + e) - 3*log(f*x + e))/(b*x + a)^n - a^2*c*f^2*n*x*e^(n*log(f*x + e 
) - 3*log(f*x + e))/(b*x + a)^n - b^2*d*e^2*x^2*e^(n*log(f*x + e) - 3*log( 
f*x + e))/(b*x + a)^n - 3*b^2*c*e*f*x^2*e^(n*log(f*x + e) - 3*log(f*x + e) 
)/(b*x + a)^n + 2*a*b*d*e*f*x^2*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + 
 a)^n + 2*a^2*d*f^2*x^2*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + a)^n + 
a*b*c*e^2*n*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + a)^n - a^2*c*e*f*n* 
e^(n*log(f*x + e) - 3*log(f*x + e))/(b*x + a)^n - 2*b^2*c*e^2*x*e^(n*log(f 
*x + e) - 3*log(f*x + e))/(b*x + a)^n - 2*a*b*c*e*f*x*e^(n*log(f*x + e) - 
3*log(f*x + e))/(b*x + a)^n + 3*a^2*d*e*f*x*e^(n*log(f*x + e) - 3*log(f*x 
+ e))/(b*x + a)^n + a^2*c*f^2*x*e^(n*log(f*x + e) - 3*log(f*x + e))/(b*...
 

Mupad [B] (verification not implemented)

Time = 1.26 (sec) , antiderivative size = 360, normalized size of antiderivative = 2.93 \[ \int (a+b x)^{-n} (c+d x) (e+f x)^{-3+n} \, dx=\frac {b\,f\,x^3\,{\left (e+f\,x\right )}^{n-3}\,\left (b\,c\,f-2\,a\,d\,f+b\,d\,e+a\,d\,f\,n-b\,d\,e\,n\right )}{{\left (a\,f-b\,e\right )}^2\,{\left (a+b\,x\right )}^n\,\left (n^2-3\,n+2\right )}-\frac {x^2\,{\left (e+f\,x\right )}^{n-3}\,\left (2\,a^2\,d\,f^2-b^2\,d\,e^2-3\,b^2\,c\,e\,f-a^2\,d\,f^2\,n+b^2\,d\,e^2\,n+2\,a\,b\,d\,e\,f-a\,b\,c\,f^2\,n+b^2\,c\,e\,f\,n\right )}{{\left (a\,f-b\,e\right )}^2\,{\left (a+b\,x\right )}^n\,\left (n^2-3\,n+2\right )}-\frac {a\,e\,{\left (e+f\,x\right )}^{n-3}\,\left (a\,c\,f+a\,d\,e-2\,b\,c\,e-a\,c\,f\,n+b\,c\,e\,n\right )}{{\left (a\,f-b\,e\right )}^2\,{\left (a+b\,x\right )}^n\,\left (n^2-3\,n+2\right )}-\frac {x\,{\left (e+f\,x\right )}^{n-3}\,\left (a^2\,c\,f^2-2\,b^2\,c\,e^2+3\,a^2\,d\,e\,f-a^2\,c\,f^2\,n+b^2\,c\,e^2\,n-2\,a\,b\,c\,e\,f+a\,b\,d\,e^2\,n-a^2\,d\,e\,f\,n\right )}{{\left (a\,f-b\,e\right )}^2\,{\left (a+b\,x\right )}^n\,\left (n^2-3\,n+2\right )} \] Input:

int(((e + f*x)^(n - 3)*(c + d*x))/(a + b*x)^n,x)
 

Output:

(b*f*x^3*(e + f*x)^(n - 3)*(b*c*f - 2*a*d*f + b*d*e + a*d*f*n - b*d*e*n))/ 
((a*f - b*e)^2*(a + b*x)^n*(n^2 - 3*n + 2)) - (x^2*(e + f*x)^(n - 3)*(2*a^ 
2*d*f^2 - b^2*d*e^2 - 3*b^2*c*e*f - a^2*d*f^2*n + b^2*d*e^2*n + 2*a*b*d*e* 
f - a*b*c*f^2*n + b^2*c*e*f*n))/((a*f - b*e)^2*(a + b*x)^n*(n^2 - 3*n + 2) 
) - (a*e*(e + f*x)^(n - 3)*(a*c*f + a*d*e - 2*b*c*e - a*c*f*n + b*c*e*n))/ 
((a*f - b*e)^2*(a + b*x)^n*(n^2 - 3*n + 2)) - (x*(e + f*x)^(n - 3)*(a^2*c* 
f^2 - 2*b^2*c*e^2 + 3*a^2*d*e*f - a^2*c*f^2*n + b^2*c*e^2*n - 2*a*b*c*e*f 
+ a*b*d*e^2*n - a^2*d*e*f*n))/((a*f - b*e)^2*(a + b*x)^n*(n^2 - 3*n + 2))
 

Reduce [F]

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

int((d*x+c)*(f*x+e)^(-3+n)/((b*x+a)^n),x)
 

Output:

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