\(\int \frac {(A+B x) (a+b x+c x^2)^p}{x^3} \, dx\) [246]

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

Optimal result

Integrand size = 21, antiderivative size = 336 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^p}{x^3} \, dx=-\frac {A \left (a+b x+c x^2\right )^{1+p}}{2 a x^2}-\frac {(2 a B-A b (1-p)) \left (a+b x+c x^2\right )^{1+p}}{2 a^2 x}+\frac {4^{-1+p} \left (2 a b B+2 a A c-A b^2 (1-p)\right ) \left (\frac {b-\sqrt {b^2-4 a c}+2 c x}{c x}\right )^{-p} \left (\frac {b+\sqrt {b^2-4 a c}+2 c x}{c x}\right )^{-p} \left (a+b x+c x^2\right )^p \operatorname {AppellF1}\left (-2 p,-p,-p,1-2 p,-\frac {b-\sqrt {b^2-4 a c}}{2 c x},-\frac {b+\sqrt {b^2-4 a c}}{2 c x}\right )}{a^2}+\frac {4^{-1-p} (2 a B-A b (1-p)) (1+2 p) (b+2 c x) \left (a+b x+c x^2\right )^p \left (-\frac {c \left (a+b x+c x^2\right )}{b^2-4 a c}\right )^{-p} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},-p,\frac {3}{2},\frac {(b+2 c x)^2}{b^2-4 a c}\right )}{a^2} \] Output:

-1/2*A*(c*x^2+b*x+a)^(p+1)/a/x^2-1/2*(2*B*a-A*b*(1-p))*(c*x^2+b*x+a)^(p+1) 
/a^2/x+4^(-1+p)*(2*a*b*B+2*A*a*c-A*b^2*(1-p))*(c*x^2+b*x+a)^p*AppellF1(-2* 
p,-p,-p,1-2*p,-1/2*(b-(-4*a*c+b^2)^(1/2))/c/x,-1/2*(b+(-4*a*c+b^2)^(1/2))/ 
c/x)/a^2/(((b-(-4*a*c+b^2)^(1/2)+2*c*x)/c/x)^p)/(((b+(-4*a*c+b^2)^(1/2)+2* 
c*x)/c/x)^p)+4^(-1-p)*(2*B*a-A*b*(1-p))*(1+2*p)*(2*c*x+b)*(c*x^2+b*x+a)^p* 
hypergeom([1/2, -p],[3/2],(2*c*x+b)^2/(-4*a*c+b^2))/a^2/((-c*(c*x^2+b*x+a) 
/(-4*a*c+b^2))^p)
 

Mathematica [A] (warning: unable to verify)

Time = 1.13 (sec) , antiderivative size = 295, normalized size of antiderivative = 0.88 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^p}{x^3} \, dx=\frac {\left (1+\frac {b-\sqrt {b^2-4 a c}}{2 c x}\right )^{-p} \left (\frac {b-\sqrt {b^2-4 a c}}{2 c}+x\right )^{-p} \left (\frac {b-\sqrt {b^2-4 a c}+2 c x}{c}\right )^p \left (\frac {b+\sqrt {b^2-4 a c}+2 c x}{c x}\right )^{-p} (a+x (b+c x))^p \left (2 B (-1+p) x \operatorname {AppellF1}\left (1-2 p,-p,-p,2-2 p,-\frac {b+\sqrt {b^2-4 a c}}{2 c x},\frac {-b+\sqrt {b^2-4 a c}}{2 c x}\right )+A (-1+2 p) \operatorname {AppellF1}\left (2-2 p,-p,-p,3-2 p,-\frac {b+\sqrt {b^2-4 a c}}{2 c x},\frac {-b+\sqrt {b^2-4 a c}}{2 c x}\right )\right )}{2 (-1+p) (-1+2 p) x^2} \] Input:

Integrate[((A + B*x)*(a + b*x + c*x^2)^p)/x^3,x]
 

Output:

(((b - Sqrt[b^2 - 4*a*c] + 2*c*x)/c)^p*(a + x*(b + c*x))^p*(2*B*(-1 + p)*x 
*AppellF1[1 - 2*p, -p, -p, 2 - 2*p, -1/2*(b + Sqrt[b^2 - 4*a*c])/(c*x), (- 
b + Sqrt[b^2 - 4*a*c])/(2*c*x)] + A*(-1 + 2*p)*AppellF1[2 - 2*p, -p, -p, 3 
 - 2*p, -1/2*(b + Sqrt[b^2 - 4*a*c])/(c*x), (-b + Sqrt[b^2 - 4*a*c])/(2*c* 
x)]))/(2*(-1 + p)*(-1 + 2*p)*(1 + (b - Sqrt[b^2 - 4*a*c])/(2*c*x))^p*x^2*( 
(b - Sqrt[b^2 - 4*a*c])/(2*c) + x)^p*((b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(c*x 
))^p)
 

Rubi [A] (warning: unable to verify)

Time = 0.62 (sec) , antiderivative size = 384, normalized size of antiderivative = 1.14, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {1237, 25, 1237, 25, 1269, 1096, 1178, 150}

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 {(A+B x) \left (a+b x+c x^2\right )^p}{x^3} \, dx\)

\(\Big \downarrow \) 1237

\(\displaystyle -\frac {\int -\frac {(2 a B-A (b-b p)+2 A c p x) \left (c x^2+b x+a\right )^p}{x^2}dx}{2 a}-\frac {A \left (a+b x+c x^2\right )^{p+1}}{2 a x^2}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int \frac {(2 a B-A b (1-p)+2 A c p x) \left (c x^2+b x+a\right )^p}{x^2}dx}{2 a}-\frac {A \left (a+b x+c x^2\right )^{p+1}}{2 a x^2}\)

\(\Big \downarrow \) 1237

\(\displaystyle \frac {-\frac {\int -\frac {\left (\left (-A (1-p) b^2+2 a B b+2 a A c\right ) p+c (2 a B-A b (1-p)) (2 p+1) x\right ) \left (c x^2+b x+a\right )^p}{x}dx}{a}-\frac {(2 a B-A b (1-p)) \left (a+b x+c x^2\right )^{p+1}}{a x}}{2 a}-\frac {A \left (a+b x+c x^2\right )^{p+1}}{2 a x^2}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\frac {\int \frac {\left (\left (-A (1-p) b^2+2 a B b+2 a A c\right ) p+c (2 a B-A b (1-p)) (2 p+1) x\right ) \left (c x^2+b x+a\right )^p}{x}dx}{a}-\frac {(2 a B-A b (1-p)) \left (a+b x+c x^2\right )^{p+1}}{a x}}{2 a}-\frac {A \left (a+b x+c x^2\right )^{p+1}}{2 a x^2}\)

\(\Big \downarrow \) 1269

\(\displaystyle \frac {\frac {p \left (2 a A c+2 a b B-A b^2 (1-p)\right ) \int \frac {\left (c x^2+b x+a\right )^p}{x}dx+c (2 p+1) (2 a B-A b (1-p)) \int \left (c x^2+b x+a\right )^pdx}{a}-\frac {(2 a B-A b (1-p)) \left (a+b x+c x^2\right )^{p+1}}{a x}}{2 a}-\frac {A \left (a+b x+c x^2\right )^{p+1}}{2 a x^2}\)

\(\Big \downarrow \) 1096

\(\displaystyle \frac {\frac {p \left (2 a A c+2 a b B-A b^2 (1-p)\right ) \int \frac {\left (c x^2+b x+a\right )^p}{x}dx-\frac {c 2^{p+1} (2 p+1) (2 a B-A b (1-p)) \left (-\frac {-\sqrt {b^2-4 a c}+b+2 c x}{\sqrt {b^2-4 a c}}\right )^{-p-1} \left (a+b x+c x^2\right )^{p+1} \operatorname {Hypergeometric2F1}\left (-p,p+1,p+2,\frac {b+2 c x+\sqrt {b^2-4 a c}}{2 \sqrt {b^2-4 a c}}\right )}{(p+1) \sqrt {b^2-4 a c}}}{a}-\frac {(2 a B-A b (1-p)) \left (a+b x+c x^2\right )^{p+1}}{a x}}{2 a}-\frac {A \left (a+b x+c x^2\right )^{p+1}}{2 a x^2}\)

\(\Big \downarrow \) 1178

\(\displaystyle \frac {\frac {-4^p p \left (\frac {1}{x}\right )^{2 p} \left (\frac {-\sqrt {b^2-4 a c}+b+2 c x}{c x}\right )^{-p} \left (\frac {\sqrt {b^2-4 a c}+b+2 c x}{c x}\right )^{-p} \left (a+b x+c x^2\right )^p \left (2 a A c+2 a b B-A b^2 (1-p)\right ) \int \left (\frac {b-\sqrt {b^2-4 a c}}{2 c x}+1\right )^p \left (\frac {b+\sqrt {b^2-4 a c}}{2 c x}+1\right )^p \left (\frac {1}{x}\right )^{-2 p-1}d\frac {1}{x}-\frac {c 2^{p+1} (2 p+1) (2 a B-A b (1-p)) \left (a+b x+c x^2\right )^{p+1} \left (-\frac {-\sqrt {b^2-4 a c}+b+2 c x}{\sqrt {b^2-4 a c}}\right )^{-p-1} \operatorname {Hypergeometric2F1}\left (-p,p+1,p+2,\frac {b+2 c x+\sqrt {b^2-4 a c}}{2 \sqrt {b^2-4 a c}}\right )}{(p+1) \sqrt {b^2-4 a c}}}{a}-\frac {(2 a B-A b (1-p)) \left (a+b x+c x^2\right )^{p+1}}{a x}}{2 a}-\frac {A \left (a+b x+c x^2\right )^{p+1}}{2 a x^2}\)

\(\Big \downarrow \) 150

\(\displaystyle \frac {\frac {2^{2 p-1} \left (\frac {-\sqrt {b^2-4 a c}+b+2 c x}{c x}\right )^{-p} \left (\frac {\sqrt {b^2-4 a c}+b+2 c x}{c x}\right )^{-p} \left (a+b x+c x^2\right )^p \left (2 a A c+2 a b B-A b^2 (1-p)\right ) \operatorname {AppellF1}\left (-2 p,-p,-p,1-2 p,-\frac {b-\sqrt {b^2-4 a c}}{2 c x},-\frac {b+\sqrt {b^2-4 a c}}{2 c x}\right )-\frac {c 2^{p+1} (2 p+1) (2 a B-A b (1-p)) \left (-\frac {-\sqrt {b^2-4 a c}+b+2 c x}{\sqrt {b^2-4 a c}}\right )^{-p-1} \left (a+b x+c x^2\right )^{p+1} \operatorname {Hypergeometric2F1}\left (-p,p+1,p+2,\frac {b+2 c x+\sqrt {b^2-4 a c}}{2 \sqrt {b^2-4 a c}}\right )}{(p+1) \sqrt {b^2-4 a c}}}{a}-\frac {(2 a B-A b (1-p)) \left (a+b x+c x^2\right )^{p+1}}{a x}}{2 a}-\frac {A \left (a+b x+c x^2\right )^{p+1}}{2 a x^2}\)

Input:

Int[((A + B*x)*(a + b*x + c*x^2)^p)/x^3,x]
 

Output:

-1/2*(A*(a + b*x + c*x^2)^(1 + p))/(a*x^2) + (-(((2*a*B - A*b*(1 - p))*(a 
+ b*x + c*x^2)^(1 + p))/(a*x)) + ((2^(-1 + 2*p)*(2*a*b*B + 2*a*A*c - A*b^2 
*(1 - p))*(a + b*x + c*x^2)^p*AppellF1[-2*p, -p, -p, 1 - 2*p, -1/2*(b - Sq 
rt[b^2 - 4*a*c])/(c*x), -1/2*(b + Sqrt[b^2 - 4*a*c])/(c*x)])/(((b - Sqrt[b 
^2 - 4*a*c] + 2*c*x)/(c*x))^p*((b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(c*x))^p) - 
 (2^(1 + p)*c*(2*a*B - A*b*(1 - p))*(1 + 2*p)*(-((b - Sqrt[b^2 - 4*a*c] + 
2*c*x)/Sqrt[b^2 - 4*a*c]))^(-1 - p)*(a + b*x + c*x^2)^(1 + p)*Hypergeometr 
ic2F1[-p, 1 + p, 2 + p, (b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*a* 
c])])/(Sqrt[b^2 - 4*a*c]*(1 + p)))/a)/(2*a)
 

Defintions of rubi rules used

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

rule 150
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_ 
] :> Simp[c^n*e^p*((b*x)^(m + 1)/(b*(m + 1)))*AppellF1[m + 1, -n, -p, m + 2 
, (-d)*(x/c), (-f)*(x/e)], x] /; FreeQ[{b, c, d, e, f, m, n, p}, x] &&  !In 
tegerQ[m] &&  !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])
 

rule 1096
Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Rt[b^2 
 - 4*a*c, 2]}, Simp[(-(a + b*x + c*x^2)^(p + 1)/(q*(p + 1)*((q - b - 2*c*x) 
/(2*q))^(p + 1)))*Hypergeometric2F1[-p, p + 1, p + 2, (b + q + 2*c*x)/(2*q) 
], x]] /; FreeQ[{a, b, c, p}, x] &&  !IntegerQ[4*p] &&  !IntegerQ[3*p]
 

rule 1178
Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_S 
ymbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[(-(1/(d + e*x))^(2*p))*((a + 
b*x + c*x^2)^p/(e*(e*((b - q + 2*c*x)/(2*c*(d + e*x))))^p*(e*((b + q + 2*c* 
x)/(2*c*(d + e*x))))^p))   Subst[Int[x^(-m - 2*(p + 1))*Simp[1 - (d - e*((b 
 - q)/(2*c)))*x, x]^p*Simp[1 - (d - e*((b + q)/(2*c)))*x, x]^p, x], x, 1/(d 
 + e*x)], x]] /; FreeQ[{a, b, c, d, e, p}, x] && ILtQ[m, 0]
 

rule 1237
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[(e*f - d*g)*(d + e*x)^(m + 1)*((a + b* 
x + c*x^2)^(p + 1)/((m + 1)*(c*d^2 - b*d*e + a*e^2))), x] + Simp[1/((m + 1) 
*(c*d^2 - b*d*e + a*e^2))   Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p*Simp[ 
(c*d*f - f*b*e + a*e*g)*(m + 1) + b*(d*g - e*f)*(p + 1) - c*(e*f - d*g)*(m 
+ 2*p + 3)*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] && LtQ[m, -1 
] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p])
 

rule 1269
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c 
_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g/e   Int[(d + e*x)^(m + 1)*(a + b*x + 
 c*x^2)^p, x], x] + Simp[(e*f - d*g)/e   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] &&  !IGtQ[m, 0]
 
Maple [F]

\[\int \frac {\left (B x +A \right ) \left (c \,x^{2}+b x +a \right )^{p}}{x^{3}}d x\]

Input:

int((B*x+A)*(c*x^2+b*x+a)^p/x^3,x)
 

Output:

int((B*x+A)*(c*x^2+b*x+a)^p/x^3,x)
 

Fricas [F]

\[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^p}{x^3} \, dx=\int { \frac {{\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p}}{x^{3}} \,d x } \] Input:

integrate((B*x+A)*(c*x^2+b*x+a)^p/x^3,x, algorithm="fricas")
 

Output:

integral((B*x + A)*(c*x^2 + b*x + a)^p/x^3, x)
 

Sympy [F]

\[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^p}{x^3} \, dx=\int \frac {\left (A + B x\right ) \left (a + b x + c x^{2}\right )^{p}}{x^{3}}\, dx \] Input:

integrate((B*x+A)*(c*x**2+b*x+a)**p/x**3,x)
 

Output:

Integral((A + B*x)*(a + b*x + c*x**2)**p/x**3, x)
 

Maxima [F]

\[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^p}{x^3} \, dx=\int { \frac {{\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p}}{x^{3}} \,d x } \] Input:

integrate((B*x+A)*(c*x^2+b*x+a)^p/x^3,x, algorithm="maxima")
 

Output:

integrate((B*x + A)*(c*x^2 + b*x + a)^p/x^3, x)
 

Giac [F]

\[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^p}{x^3} \, dx=\int { \frac {{\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p}}{x^{3}} \,d x } \] Input:

integrate((B*x+A)*(c*x^2+b*x+a)^p/x^3,x, algorithm="giac")
 

Output:

integrate((B*x + A)*(c*x^2 + b*x + a)^p/x^3, x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^p}{x^3} \, dx=\int \frac {\left (A+B\,x\right )\,{\left (c\,x^2+b\,x+a\right )}^p}{x^3} \,d x \] Input:

int(((A + B*x)*(a + b*x + c*x^2)^p)/x^3,x)
 

Output:

int(((A + B*x)*(a + b*x + c*x^2)^p)/x^3, x)
 

Reduce [F]

\[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^p}{x^3} \, dx =\text {Too large to display} \] Input:

int((B*x+A)*(c*x^2+b*x+a)^p/x^3,x)
                                                                                    
                                                                                    
 

Output:

( - 2*(a + b*x + c*x**2)**p*a*p + (a + b*x + c*x**2)**p*a + 2*(a + b*x + c 
*x**2)**p*b*x + 4*int((a + b*x + c*x**2)**p/(2*a*p**2*x**2 - 5*a*p*x**2 + 
2*a*x**2 + 2*b*p**2*x**3 - 5*b*p*x**3 + 2*b*x**3 + 2*c*p**2*x**4 - 5*c*p*x 
**4 + 2*c*x**4),x)*a*b*p**4*x**2 - 4*int((a + b*x + c*x**2)**p/(2*a*p**2*x 
**2 - 5*a*p*x**2 + 2*a*x**2 + 2*b*p**2*x**3 - 5*b*p*x**3 + 2*b*x**3 + 2*c* 
p**2*x**4 - 5*c*p*x**4 + 2*c*x**4),x)*a*b*p**3*x**2 - 11*int((a + b*x + c* 
x**2)**p/(2*a*p**2*x**2 - 5*a*p*x**2 + 2*a*x**2 + 2*b*p**2*x**3 - 5*b*p*x* 
*3 + 2*b*x**3 + 2*c*p**2*x**4 - 5*c*p*x**4 + 2*c*x**4),x)*a*b*p**2*x**2 + 
6*int((a + b*x + c*x**2)**p/(2*a*p**2*x**2 - 5*a*p*x**2 + 2*a*x**2 + 2*b*p 
**2*x**3 - 5*b*p*x**3 + 2*b*x**3 + 2*c*p**2*x**4 - 5*c*p*x**4 + 2*c*x**4), 
x)*a*b*p*x**2 + 8*int((a + b*x + c*x**2)**p/(2*a*p**2*x - 5*a*p*x + 2*a*x 
+ 2*b*p**2*x**2 - 5*b*p*x**2 + 2*b*x**2 + 2*c*p**2*x**3 - 5*c*p*x**3 + 2*c 
*x**3),x)*a*c*p**4*x**2 - 24*int((a + b*x + c*x**2)**p/(2*a*p**2*x - 5*a*p 
*x + 2*a*x + 2*b*p**2*x**2 - 5*b*p*x**2 + 2*b*x**2 + 2*c*p**2*x**3 - 5*c*p 
*x**3 + 2*c*x**3),x)*a*c*p**3*x**2 + 18*int((a + b*x + c*x**2)**p/(2*a*p** 
2*x - 5*a*p*x + 2*a*x + 2*b*p**2*x**2 - 5*b*p*x**2 + 2*b*x**2 + 2*c*p**2*x 
**3 - 5*c*p*x**3 + 2*c*x**3),x)*a*c*p**2*x**2 - 4*int((a + b*x + c*x**2)** 
p/(2*a*p**2*x - 5*a*p*x + 2*a*x + 2*b*p**2*x**2 - 5*b*p*x**2 + 2*b*x**2 + 
2*c*p**2*x**3 - 5*c*p*x**3 + 2*c*x**3),x)*a*c*p*x**2 + 4*int((a + b*x + c* 
x**2)**p/(2*a*p**2*x - 5*a*p*x + 2*a*x + 2*b*p**2*x**2 - 5*b*p*x**2 + 2...