\(\int \frac {(f+g x)^n (a+2 c d x+c e x^2)}{(d+e x)^2} \, dx\) [699]

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

Optimal result

Integrand size = 28, antiderivative size = 88 \[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\frac {c (f+g x)^{1+n}}{e g (1+n)}-\frac {\left (c d^2-a e\right ) g (f+g x)^{1+n} \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {e (f+g x)}{e f-d g}\right )}{e (e f-d g)^2 (1+n)} \] Output:

c*(g*x+f)^(1+n)/e/g/(1+n)-(c*d^2-a*e)*g*(g*x+f)^(1+n)*hypergeom([2, 1+n],[ 
2+n],e*(g*x+f)/(-d*g+e*f))/e/(-d*g+e*f)^2/(1+n)
 

Mathematica [A] (verified)

Time = 0.22 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.94 \[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\frac {(f+g x)^{1+n} \left (c (e f-d g)^2+\left (-c d^2+a e\right ) g^2 \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {e (f+g x)}{e f-d g}\right )\right )}{e g (e f-d g)^2 (1+n)} \] Input:

Integrate[((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x)^2,x]
 

Output:

((f + g*x)^(1 + n)*(c*(e*f - d*g)^2 + (-(c*d^2) + a*e)*g^2*Hypergeometric2 
F1[2, 1 + n, 2 + n, (e*(f + g*x))/(e*f - d*g)]))/(e*g*(e*f - d*g)^2*(1 + n 
))
 

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 88, 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.071, Rules used = {1195, 2009}

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 \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx\)

\(\Big \downarrow \) 1195

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {c (f+g x)^{n+1}}{e g (n+1)}-\frac {g \left (c d^2-a e\right ) (f+g x)^{n+1} \operatorname {Hypergeometric2F1}\left (2,n+1,n+2,\frac {e (f+g x)}{e f-d g}\right )}{e (n+1) (e f-d g)^2}\)

Input:

Int[((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x)^2,x]
 

Output:

(c*(f + g*x)^(1 + n))/(e*g*(1 + n)) - ((c*d^2 - a*e)*g*(f + g*x)^(1 + n)*H 
ypergeometric2F1[2, 1 + n, 2 + n, (e*(f + g*x))/(e*f - d*g)])/(e*(e*f - d* 
g)^2*(1 + n))
 

Defintions of rubi rules used

rule 1195
Int[((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.)*((a_.) + (b_.)*(x 
_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(f + 
 g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, n}, x 
] && IGtQ[p, 0]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 
Maple [F]

\[\int \frac {\left (g x +f \right )^{n} \left (c e \,x^{2}+2 c d x +a \right )}{\left (e x +d \right )^{2}}d x\]

Input:

int((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x)
 

Output:

int((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x)
 

Fricas [F]

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

integrate((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x, algorithm="fricas")
 

Output:

integral((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e^2*x^2 + 2*d*e*x + d^2), x)
 

Sympy [F(-2)]

Exception generated. \[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\text {Exception raised: HeuristicGCDFailed} \] Input:

integrate((g*x+f)**n*(c*e*x**2+2*c*d*x+a)/(e*x+d)**2,x)
 

Output:

Exception raised: HeuristicGCDFailed >> no luck
 

Maxima [F]

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

integrate((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x, algorithm="maxima")
 

Output:

integrate((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e*x + d)^2, x)
 

Giac [F]

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

integrate((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x, algorithm="giac")
 

Output:

integrate((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e*x + d)^2, x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\int \frac {{\left (f+g\,x\right )}^n\,\left (c\,e\,x^2+2\,c\,d\,x+a\right )}{{\left (d+e\,x\right )}^2} \,d x \] Input:

int(((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x)^2,x)
 

Output:

int(((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x)^2, x)
 

Reduce [F]

\[ \int \frac {(f+g x)^n \left (a+2 c d x+c e x^2\right )}{(d+e x)^2} \, dx=\text {too large to display} \] Input:

int((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d)^2,x)
 

Output:

((f + g*x)**n*a*e*f*g*n + (f + g*x)**n*a*e*f*g - (f + g*x)**n*c*d**2*f*g + 
 (f + g*x)**n*c*d**2*g**2*n*x - (f + g*x)**n*c*d*e*f**2 + (f + g*x)**n*c*d 
*e*f*g*n*x - (f + g*x)**n*c*d*e*f*g*x + (f + g*x)**n*c*d*e*g**2*n*x**2 - ( 
f + g*x)**n*c*e**2*f**2*x - (f + g*x)**n*c*e**2*f*g*x**2 + int(((f + g*x)* 
*n*x)/(d**3*f*g*n + d**3*g**2*n*x - d**2*e*f**2 + 2*d**2*e*f*g*n*x - d**2* 
e*f*g*x + 2*d**2*e*g**2*n*x**2 - 2*d*e**2*f**2*x + d*e**2*f*g*n*x**2 - 2*d 
*e**2*f*g*x**2 + d*e**2*g**2*n*x**3 - e**3*f**2*x**2 - e**3*f*g*x**3),x)*a 
*d**3*e*g**4*n**3 + int(((f + g*x)**n*x)/(d**3*f*g*n + d**3*g**2*n*x - d** 
2*e*f**2 + 2*d**2*e*f*g*n*x - d**2*e*f*g*x + 2*d**2*e*g**2*n*x**2 - 2*d*e* 
*2*f**2*x + d*e**2*f*g*n*x**2 - 2*d*e**2*f*g*x**2 + d*e**2*g**2*n*x**3 - e 
**3*f**2*x**2 - e**3*f*g*x**3),x)*a*d**3*e*g**4*n**2 - int(((f + g*x)**n*x 
)/(d**3*f*g*n + d**3*g**2*n*x - d**2*e*f**2 + 2*d**2*e*f*g*n*x - d**2*e*f* 
g*x + 2*d**2*e*g**2*n*x**2 - 2*d*e**2*f**2*x + d*e**2*f*g*n*x**2 - 2*d*e** 
2*f*g*x**2 + d*e**2*g**2*n*x**3 - e**3*f**2*x**2 - e**3*f*g*x**3),x)*a*d** 
2*e**2*f*g**3*n**3 - 2*int(((f + g*x)**n*x)/(d**3*f*g*n + d**3*g**2*n*x - 
d**2*e*f**2 + 2*d**2*e*f*g*n*x - d**2*e*f*g*x + 2*d**2*e*g**2*n*x**2 - 2*d 
*e**2*f**2*x + d*e**2*f*g*n*x**2 - 2*d*e**2*f*g*x**2 + d*e**2*g**2*n*x**3 
- e**3*f**2*x**2 - e**3*f*g*x**3),x)*a*d**2*e**2*f*g**3*n**2 - int(((f + g 
*x)**n*x)/(d**3*f*g*n + d**3*g**2*n*x - d**2*e*f**2 + 2*d**2*e*f*g*n*x - d 
**2*e*f*g*x + 2*d**2*e*g**2*n*x**2 - 2*d*e**2*f**2*x + d*e**2*f*g*n*x**...